CRC paper

advertisement
CRC Error Detection
Trevor Parker
College of Engineering
University of North Florida
EEL4514
10/30/2012
N00695137@unf.edu
ABSTRACT- The purpose of this paper is to
explain what CRC Error Detection is, how it
functions and what it’s used for.
Keywords – Cyclic Redundancy check (CRC),
checksum, Negative Acknowledgement, shift
register, Exclusive OR(XOR)
What is CRC?
CRC stands for Cyclic Redundancy Check and is a
method for detecting errors in data transmissions.
Check bits are added to the message before it is sent,
when the CRC receives the message it will check if
the check bits have been altered, if so then there are
errors. If an error is found a NAK (negative
acknowledgement) transmission is sent back to the
sender telling it to resend the transmission.
of errors, but if 1 is the result it counts as an error and
has the sender retry transmission. This can all be seen
on the right hand side of the example in Figure 1.
The generator polynomial can be adjusted to allow
for the capture of multiple different errors, such as:
single bit error, 2 isolated single bit errors, odd
number of bit errors, short burst errors, long burst
errors, and longer burst errors. Some common CRCs
are: CRC-12 (where r-bit is 12 and the polynomial
generator is x12 + x11 + x3 + x2 + x + 1), CRC-16
(where r-bit is 16 and the polynomial generator is x16
+ x15 + x2 + 1), and CRC-32 (where r-bit is 32 and
the polynomial generator is x32+ x26+ x23+ x22
+x16+ x12+x11+ x10+ x8+ x7+ x5+ x4+ x2+ x+ 1).
How the sender creates the CRC
CRC treats the message as a polynomial. The sender
and receiver devices agree on a fixed polynomial
(generator Polynomial), where to check r-bit the
generator polynomial must be degree r. The sender
attaches r 0-bits to the m-bit message and divides the
result by the generator polynomial, which creates a
remainder polynomial with r coefficients (checksum).
The data transmitted to the Receiver is the m-bit
message followed by the checksum. This can all be
seen on the left hand side of the example in Figure 1,
whereas M(x) is the message signal, P(x) is the
generator signal, and C(x) is the checksum.
Figure 1, Example of Send and receive CRC
How the Receiver uses the CRC
Hardware
Once the receiver receives the message sent by the
sender the CRC divides the message (m-bit message
+ r-bit checksum) by the generator polynomial and
checks to see if the r-bit remainder is 0. If 0 is
received then the system will accept the code as free
It is noticeably quicker if the hardware does the work
rather than the program, the hardware part is
performed using shift registers and X-OR gates (as
can be seen in Figure 2).
REFERENCE
Power Point, Ohio State University, computer
Interfacing and Protocols, ECE 766, winter 2005.
Provided by: Professor Merckel.
http://www.erg.abdn.ac.uk/~gorry/eg3567/dlpages/crc.html
http://ww.hackersdelight.org/crc.pdf
Figure 2, hardware example of 16bit CRC
Download