Part 9: Error Detection and Correction: Parity, Checksums, CRC-32 & Hamming
Lesson Overview & Learning Objectives
Whenever electromagnetic signals travel through transmission media, thermal noise, electromagnetic interference (EMI), and cross-talk inevitably corrupt data bits. An analog spike can flip a binary 0 into a 1 or vice versa. Reliable systems require mathematical mechanisms to detect and correct transmission errors. In this article, we contrast single-bit errors versus burst errors, analyze simple and 2D parity checks, evaluate the Internet Checksum, execute polynomial division in CRC-32, and implement Hamming Forward Error Correction (FEC).
1. Types of Errors: Single-Bit vs. Burst Errors
Single-Bit Error
Only 1 bit in a given data unit (such as a byte or character) is corrupted. Rare in serial high-speed transmission because noise duration usually exceeds bit duration.
Burst Error
Two or more consecutive bits within the data unit are corrupted by transient noise impulses (e.g. lightning, motor sparks). In a 10 Gbps link, a 1-millisecond noise burst corrupts 10 million consecutive bits!
2. Cyclic Redundancy Check (CRC-32)
The most powerful hardware-implemented error-detection code used in Ethernet (802.3), Wi-Fi, and storage SATA buses is the Cyclic Redundancy Check (CRC).
CRC treats binary bit sequences as algebraic polynomials with binary coefficients. Using Modulo-2 binary division (which uses XOR addition without carry), the transmitter appends an \(n\)-bit remainder (FCS) calculated by dividing the data payload by a predetermined divisor polynomial \(G(x)\). The receiver performs the identical division: if the remainder is exactly zero, the frame is intact; otherwise, it is silently dropped.
3. Hamming Codes: Forward Error Correction (FEC)
While CRC detects errors (prompting a request for retransmission via ARQ), satellite and deep-space links incur round-trip delays that make retransmission impractical. These links require Forward Error Correction (FEC), pioneered by Richard Hamming.
According to Hamming distance theory:
- To detect \(s\) errors, the minimum Hamming distance must satisfy: \(d_{min} \ge s + 1\).
- To correct \(t\) errors, the minimum Hamming distance must satisfy: \(d_{min} \ge 2t + 1\).
By interleaving parity check bits at positions of powers of 2 (1, 2, 4, 8, ...), the Hamming code computes an error syndrome whose binary numeric value directly identifies the exact bit position that flipped, allowing the receiver to invert it back without retransmission!
Related reading
Part 10: Network Layer Addressing: IPv4 Subnetting, CIDR & IPv6 Architecture
Master logical network addressing: explore IPv4 classful ranges, CIDR slash notation, subnet mask bitwise ANDing, and modern 128-bit IPv6 architecture.
By Md. Harun-Or-Roshid
Part 8: Multiplexing Techniques: Frequency-Division (FDM) & Time-Division (TDM)
A comprehensive guide to signal multiplexing: analyzing Frequency-Division (FDM), Synchronous and Statistical Time-Division (TDM), and optical WDM.
By Md. Harun-Or-Roshid
Part 7: Pulse Modulation & Companding: PAM, PWM, PPM, PCM & Quantization
Explore analog-to-digital signal conversion: comparing PAM, PWM, PPM, Pulse Code Modulation (PCM) sampling, quantization error, and µ-law/A-law companding.
By Md. Harun-Or-Roshid
Part 6: Wireless Transmission Fundamentals: RF Spectrum, Antennas & Path Loss
Explore unguided wireless communications: analyzing radio frequency spectrum allocations, propagation modes, free-space path loss, and MIMO antennas.
By Md. Harun-Or-Roshid