Cyclic Redundancy Check (CRC)
1. Fundamentals of Cyclic Codes & CRC
Cyclic Redundancy Check (CRC) is a powerful, mathematically rigorous error-detecting code based on binary polynomial division. It is the dominant error-detection algorithm used in modern networking standards, including IEEE 802.3 Ethernet, Wi-Fi, HDLC, and ATM.
Why "Cyclic"?
In cyclic codes, if a codeword is cyclically shifted (rotated), the resulting binary string is also a valid codeword in the codebook.
2. Polynomial Representation of Bit Streams
In CRC, binary bit sequences are represented as polynomials in indeterminate with binary coefficients ( or ):
- Highest power of present in the polynomial defines the Degree of the Polynomial ().
- A polynomial of degree contains binary coefficients.
3. Mathematical Mechanism of CRC
The Modulo-2 Division Rules:
- Addition and Subtraction in Modulo-2 are identical and equivalent to the XOR operation ().
- There are no carries in addition and no borrows in subtraction.
- If the leftmost bit of the current dividend is
1, the divisor aligns and XORs. - If the leftmost bit is
0, the divisor does not divide (or XORs with all0s).
4. Complete Step-by-Step Solved Numerical
Problem Statement:
A sender wants to transmit the dataword .
The Generator Polynomial is .
- Find the transmitted CRC codeword.
- Verify that the receiver detects no error if the frame arrives uncorrupted.
Step 1: Determine the Divisor and Appended Zeros
- Generator Polynomial: (4 bits).
- Degree of : .
- Append zeros to the dataword:
Step 2: Modulo-2 Division at Sender
Step 3: Construct the Transmitted Codeword
Replace the 3 appended zeros with the 3-bit remainder:
Step 4: Verification at Receiver
The receiver divides the received codeword by the generator :
Since the remainder is , the frame is accepted as uncorrupted.
5. Standard Generator Polynomials in Networking
| Name | Polynomial Expression | Degree () | Primary Industry Standard |
|---|---|---|---|
| CRC-8 | 8 | ATM Header Error Control (HEC) | |
| CRC-16 (ANSI) | 16 | USB, Modbus, ANSI | |
| CRC-CCITT | 16 | HDLC, X.25, Bluetooth | |
| CRC-32 | 32 | IEEE 802.3 Ethernet, Wi-Fi, ZIP, PNG |
6. Error-Catching Capabilities of CRC
A well-designed generator polynomial guarantees:
- Single-bit errors: Detected if has at least two non-zero terms (contains ).
- Double-bit errors: Detected if does not divide for any .
- Odd number of errors: Detected if contains as a mathematical factor.
- Burst errors of length : detected (where is the polynomial degree).
- Burst errors of length : Detected with probability ( for CRC-32).
Frequently Asked Questions
QHow many redundant bits are appended to a dataword if the generator polynomial is $x^4 + x + 1$?
The degree of is , so exactly 4 zeros are appended.
QWhy does modulo-2 division use XOR instead of ordinary subtraction?
In modulo-2 arithmetic over Galois Field , addition and subtraction are identical and carryless, precisely mapping to the electronic logic of the XOR gate.
QWhat error types are guaranteed to be detected by CRC-32?
All single-bit errors, all double-bit errors, all odd numbers of inverted bits, and all burst errors up to 32 bits in length.
QHow does the receiver verify a CRC codeword?
It divides the whole received frame (data plus CRC) by the same generator using modulo-2 division. A remainder of zero means the frame is accepted; any non-zero remainder means it is discarded.