With an example for data with a hexadecimal value of 0xda
and a polynomial 0x07
, I would find the CRC as follows (using the methodology from Wikipedia)
0xda = 11011010
11011010|00000000
111
00111010|00000000
111
00000010|00000000
11 1
00000001|10000000
1 11
00000000|01000000
But the answer should be 0x08
according to this calculator.
I need the answer to be correct for the IEEE standard Ethernet. I've found that some sources pad the data and some don't. IEEE seem to suggest padding is required if the data is less than the CRC width.
Note: I know that the CRC is not strictly the remainder of the data divided by the polynomial either.
0xda = 11011010 = 218
0x07 = 00000111 = 7
218/7 = 31 r 1
As you can see below, the IEEE outlines a lot more steps than suggested on Wikipedia. How can I be certain that the CRC calculators online give the correct values for Ethernet?
For my attempt at following the standard (with the 8 bit CRC example) a.) First 8 bits of the frame are complemented
11011010 -> 00100101
c.) Multiply by x^8 is equivalent to shifting by 8 bits (padded with zeros)
00100101 -> 00100101 00000000 = 18688
d.) Divide by G(x)
and get remainder R(x)
18688/7 = 2669 r 5
Update: I have since got an 8 bit vhdl implementation using a 256 entry lookup table working. Or at least it gives the same results as the calculator online.