Cyclic Redundancy Check
Cyclic Redundancy Check
2
Basics before error detection …
Parity Check :
If two bits are transposed (change places) then the computer
could be fooled into thinking the data is correct and not
CRC is an error detection code which is included in each transmitted codeword and used by the
error in the received codeword.
This is a type of polynomial code in which a bit string is represented in the form of polynomials
with coefficients of 0 and 1 only.
Polynomial arithmetic uses a modulo-2 arithmetic i.e. addition and subtraction are identical to
EXOR.
For CRC code the sender and receiver should agree upon a generator polynomial G(x).
A codeword can be generated for a given data word (message) polynomial M(x) with the help of
long division.
This technique is more powerful than the parity check and checksum error detection.
6
Procedure of error detection
CRC works on the principle of binary division. A sequence of redundant bits called CRC or CRC
remainder is appended at the end of the message. We will call this word as appended message
word .
The appended word thus obtained becomes exactly divisible by the generator word corresponding
to G (x).
The sender appends the CRC to the message word to form a codeword.
At the receiver, this codeword is divided by the same generator word which corresponds to G (x).
There is no error if the remainder of this division is zero.
But a non-zero remainder indicates presence of errors in the received code word.
Such an erroneous codeword is then rejected.
Append a train n 0s to STEPS TO
the message word
where n is 1 less than DETECT ERROR
the number of bit in
the pre decided • Step 1 USING CYCLIC
divisor. If the divisor
is 5 bit long then we REDUNDANCY
have to append 4 zero
to message. CHECK (CRC)
Divide the newly
generated data unit
in step 1 by the • Step 2
divisor (generator).
This is a binary
division.
The remainder
obtained after the • Step 3
divisor in step 2 is
the n bit CRC
7
8
LET’S GO THROUGH THE EXAMPLE
Q. 1 A bit stream 1101011011 is transmitted using the standard CRC method. The generator polynomial is x 4+x+1.
What is the actual bit string transmitted?
Solution-
The generator polynomial G(x) = x4 + x + 1 is encoded as 10011.
Clearly, the generator polynomial consists of 5 bits.
So, a string of 4 zeroes is appended to the bit stream to be transmitted.
The resulting bit stream is 11010110110000.
Now, the binary division is performed as …
9
From here, CRC = 1110.
Now,
10
REFERENCES
Stackoverflow
2 https://www.stackoverflow.com/
12