One of the more effective methods of error detection
There are many different CRC's - they are all computed in the same fashion but vary in length.
The most common are 12, 16, and 32 bits.
Kermit uses a 16-bit CRC recommended by the ITU (formerly CCITT).
A 16-bit CRC will miss only one error in 216.
Longer CRC's are more effective that short ones at detecting errors.
Shift registers are initialized to 0's.
Each time a bit is received, every bit in the shift registers is shifted right.
For example, a 1 is received. It is XORed in G3 with a 0 shifted out of b0 to produce 1, which is shifted into b15.
Four received bits later, it will have been shifted to b11, where it is XORed in G1 and shifted into b10.
The important thing to recognize is that once a bit is received, it continues to influence the contents of the shift registers.
If one bit is received incorrectly, the contents of the shift registers will be different that they would have been if all bits had been received correctly.
Both transmitter and receiver have identical CRC circuits. At the end of the block of data, the sending terminal transmits the contents of its CRC registers.
Download C source code for calculating CRCs
Back to Error Detection and Correction