CRC-8 versus a simple checksum — parity and checksum
edge casewhy real protocols use CRC
Answer
F4
Why this example is worth doing
A cyclic redundancy check is polynomial division over GF(2), and its guarantee is categorical: every burst error shorter than the CRC width is detected, which no additive checksum can promise. The page gives the full RevEng parameter set — polynomial, init, reflection in and out, xor-out and the check value — because a bare polynomial is not enough to specify a CRC, and reflection is where hand-rolled implementations go wrong.
Try your own input in the Parity & checksum. Even and odd parity, one’s-complement sums and the Internet checksum, step by step.
How the answer is reached
CRC-8/SMBUS over 9 bytes
CRC-8/SMBUS treats the message as a polynomial over GF(2) and divides it by the generator, keeping the remainder.
Generatorx^8 + x^2 + x + 1— 0x07
| Parameter | Value | Meaning |
|---|---|---|
| width | 8 | register width in bits (degree of the polynomial, less one) |
| poly | 0x07 | generator polynomial, implicit x^width omitted |
| init | 0x00 | register contents before the first message bit |
| refin | false | each byte is read MSB-first |
| refout | false | the register is presented as-is |
| xorout | 0x00 | XORed into the register after reflection |
| check | 0xF4 | the published CRC of "123456789" |
| residue | 0x00 | the register after reading a valid codeword |
Register at start0x00— init
| # | Byte | Bits in | Register after |
|---|---|---|---|
| 0 | 0x31 | 00110001 | 0x97 |
| 1 | 0x32 | 00110010 | 0x72 |
| 2 | 0x33 | 00110011 | 0xC0 |
| 3 | 0x34 | 00110100 | 0xC2 |
| 4 | 0x35 | 00110101 | 0xCB |
| 5 | 0x36 | 00110110 | 0xFD |
| 6 | 0x37 | 00110111 | 0x78 |
| 7 | 0x38 | 00111000 | 0xC7 |
| 8 | 0x39 | 00111001 | 0xF4 |
Register after the message0xF4— 9 bytes read
After refout0xF4— refout is false, so nothing changes
CRC0xF4— register XOR xorout (0x00)
Appending this CRC to the message and re-running leaves the register at the residue 0x00 — that constant is how a receiver checks a frame without recomputing anything.
Source: RevEng CRC catalogue (Rocksoft™ Model CRC Algorithm, Ross Williams 1993)