1 · Original data
2 · Append zeros
3 · CRC remainder
Append zeros, then divide
Click a received bit to flip it
The sender’s frame stays the same. You change what arrives at the receiver.
XOR long division
Use XOR; there is no borrowing.A teal digit is brought down from the original dividend. Leading zeros stay visible to show the alignment.
Worked division table · all steps
Select a step number to inspect that operation in the drawing above. On the last row, the remaining bits are the remainder.
| Step | Current bits | XOR with | XOR result | Bring down | Next bits / remainder |
|---|
Why does this work?
The sender: a generator with r + 1 bits needs r check bits. Append r zeros to the data, divide using XOR, and replace those zeros with the remainder. The resulting frame divides evenly by the generator.
The receiver: divide the entire received frame by the same generator. Do not append extra zeros. A nonzero remainder detects an error; a zero remainder means no error was detected.
CRC does not correct errors. A zero remainder can also occur for some changed frames. The undetected example demonstrates this limitation.
Generator as a polynomial
Each 1 includes a power of x; each 0 omits it. The leftmost bit gives the highest power.