Electronic – CRC-16 Calculation

crcfpgamath

I'm trying to calculate the CRC-16 in hex form using a seed of 0x0000. For your convenience, here's the polynomial for CRC-16

\$ x^{16} + x^{15} + x^2 + 1 \$

I have the following packet sequence that I want to compute the CRC-16 for:

f0 f0 03 01 b4 04 01 67 40 17

The CRC is calculated to be 7a 8b by the hardware that I'm working with. I'm having trouble connecting the dots between the data byte sequence, the polynomial, and the final results even after reading a few search results regarding CRC-16. I've also noticed the OpenCores community, and I'm wondering if there are any of you who used the libraries to calculate checksums?

Best Answer

Looks like you got it right actually, just swap the bytes. When I run your data sequence

F0F00301B40401674017

through this online CRC calculator I get a calculated CRC-16 of:

0x8B7A

which is just you calculated answer with the bytes swapped. Congrats friend, looks like you've got yourself a reusable CRC-16 module!