File:Crc shift register 2.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 525 × 225 pixels, file size: 30 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: CRC shift register
Source Own work
Author Biezl
 
This W3C-unspecified vector image was created with Inkscape .

Licensing

[edit]
Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

GNU octave / MATLAB Simulation

[edit]
% Biezl 2008

% shiftRegister := andvanced circuit
% shiftRegister2 := basic circuit

printf( "Definition: data(1,1)= Bit0/LSB data(1,lenght(data)) = MSB\n");

data = [1,0,0,0,1]

polynom = [1,1,0,0,1]
shiftRegister = zeros(1, length(polynom)-1);
size(shiftRegister)
size(data)

%----

for i=length(data):-1:1

  temp = ( data(1,i) != shiftRegister(1,length(shiftRegister)) ); % MSB
  for j=length(shiftRegister):-1:2 % Schieben
    if polynom(1,j) == 0
      shiftRegister(1,j) = shiftRegister(1,j-1);
    else
      shiftRegister(1,j) = shiftRegister(1,j-1) != temp; % XOR
    end
  end
  shiftRegister(1,1) = temp; %LSB
  % shiftRegister

end

%----

shiftRegister2 = zeros(1, length(polynom)-1);
dataExt = [zeros(1, length(polynom)-1), data];

for i=length(dataExt):-1:1

  temp = ( dataExt(1,i) != shiftRegister2(1,length(shiftRegister2)) ); % MSB
  temp2 = shiftRegister2(1,length(shiftRegister2));
  for j=length(shiftRegister2):-1:2
    if polynom(1,j) == 0
      shiftRegister2(1,j) = shiftRegister2(1,j-1);
    else
      shiftRegister2(1,j) = shiftRegister2(1,j-1) != temp2;
    end
  end
  shiftRegister2(1,1) = temp; %LSB
  shiftRegister2

end

%----

check = [ shiftRegister, data ]; % LSB -> MSB
shiftRegisterCheck = zeros(1, length(polynom)-1);

for i=length(check):-1:1

  temp = ( check(1,i) != shiftRegisterCheck(1,length(shiftRegisterCheck)) ); % MSB
  for j=length(shiftRegisterCheck):-1:2
    if polynom(1,j) == 0
      shiftRegisterCheck(1,j) = shiftRegisterCheck(1,j-1);
    else
      shiftRegisterCheck(1,j) = shiftRegisterCheck(1,j-1) != temp;
    end
  end
  shiftRegisterCheck(1,1) = temp; %LSB
  % shiftRegisterCheck

end

%----

check2 = [ shiftRegister2, data ]; % LSB -> MSB
shiftRegisterCheck2 = zeros(1, length(polynom)-1);

for i=length(check2):-1:1

  temp = ( check2(1,i) != shiftRegisterCheck2(1,length(shiftRegisterCheck2)) ); % MSB
  temp2 = shiftRegisterCheck2(1,length(shiftRegisterCheck2)) ; % MSB
  for j=length(shiftRegisterCheck2):-1:2
    if polynom(1,j) == 0
      shiftRegisterCheck2(1,j) = shiftRegisterCheck2(1,j-1);
    else
      shiftRegisterCheck2(1,j) = shiftRegisterCheck2(1,j-1) != temp2;
    end
  end
  shiftRegisterCheck2(1,1) = temp; %LSB
  %shiftRegisterCheck2

end

%----

shiftRegister
shiftRegisterCheck

shiftRegister2
shiftRegisterCheck2

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current06:16, 23 July 2008Thumbnail for version as of 06:16, 23 July 2008525 × 225 (30 KB)Biezl (talk | contribs){{Information |Description= |Source= |Date= |Author= |Permission= |other_versions= }}
17:56, 21 July 2008Thumbnail for version as of 17:56, 21 July 2008525 × 225 (29 KB)Biezl (talk | contribs){{Information |Description={{en|1=CRC shift register}} |Source=Own work by uploader |Author=Biezl |Date= |Permission= |other_versions= }} {{Inkscape}} {{ImageUpload|full}} Category:Coding theory

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: