Search code examples
equationcrccrc16

Implement CRC algorithm from equation


I'm dealing with a device which say to use this 16 bit cyclic redundancy check:

CCITT CRC-16 with polynomial x^16 + x^12 + x^5 + x^1

I looked for an implementation of such algorithm, but I did find only ones with the last term of the equation equal to 1 (i.e. x^0) instead of x^1, like this one or this.

I was going to implement the algorithm by myself, when I realized I don't know how to start. How is it supposed to develop a CRC calculation starting from an equation?


Solution

  • This PDF file explains the subject: hackersdelight.org/crc.pdf.

    I also recommend Computer Networks by Andrew Tanenbaum, as it has a chapter on the CRC algorithm.

    Finally, I would double-check to see that your device does in fact implement that form of CRC as opposed to the standard one. It might just be a typo.