1, CRC based on "modulo two operations."
Modulo two operations are similar to ordinary binary operations, but the difference is that there is no carry and borrow.
For example:
Addition: 010+110=100
Subtraction: 010-110=100
No carry and borrow make the addition and subtraction of modulo two operations equal to XOR or operation.
Multiplication:
1010
* 101
————
1010
0000
1010
————
100010
Division:
See, modulo two operation of the multiplication is similar to the ordinary binary multiplication, the only difference is no carry borrow (the remainder of the Division sample in front of that 0 can not tube, see below will know)
2. CRC Calibration Process
1) Select a divisor (the term is called generate polynomial), assuming that the divisor binary is K-bit.
2) The original code left shift k-1 bit to get a new code, such as the original Code 1001,k 4, then the shift becomes 1001000.
3) New code modulo two divided by this divisor, to get a k-1 bit of the remainder (check code). If the remainder is dissatisfied with the k-1 bit, manually in the front with 0 fill, such as if the remaining 1, then fill 001.
4) The new code plus this check code to get CRC code, such as the above example, the final CRC code is 1001001.
5) Send
6) After receiving this CRC code divided by the previously selected divisor, the remainder of 0 is transmitted without error. Otherwise, according to the remainder and the generation of a number of polynomial operations (the book is simply a bunch of crap, not understand), you can get the dislocation.
(Image from http://blog.csdn.net/lycb_gz/article/details/8201987)