Skip to main content
← All posts

Part 9: Error Detection and Correction: Parity, Checksums, CRC-32 & Hamming

Md. Harun-Or-RoshidNov 5, 20262 min readArticle
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!

Share:
Share on X
Share on LinkedIn
Share on Facebook
Share on Reddit
Share on WhatsApp
Share on Telegram
Copy link

Related reading

Error Detection & Correction: Parity, CRC | Draftsbook · Draftsbook