CRC check principle (cyclic redundancy check)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.