Skip to main content

Forward error correction using Hamming code

Short answer

Forward error correction adds redundant bits so the receiver corrects errors without retransmission, suited for one-way or delay-sensitive links. In (7,4) Hamming code, 3 parity bits sit at positions 1,2,4. For data 1101, the codeword is 1010101. A single-bit error at position 6 gives syndrome 110 (binary 6), identifying and correcting the flipped bit.

Explain forward error correction techniques with example of Hamming code.

Forward error correction (FEC) adds redundant bits to the data so the receiver can detect and correct errors by itself, without asking for retransmission. It suits one-way, real-time or long-delay links (satellite, broadcast, memory). Common FEC techniques: Hamming codes, BCH and Reed-Solomon codes, convolutional codes (Viterbi), turbo and LDPC codes. The cost is extra bits (lower code rate).

Hamming (7,4) example

Parity bits are at positions 1, 2, 4 (even parity); data bits are at 3, 5, 6, 7:

  • p1 covers positions 1, 3, 5, 7
  • p2 covers positions 2, 3, 6, 7
  • p4 covers positions 4, 5, 6, 7
 position :  1  2  3  4  5  6  7
 bit      : p1 p2 d3 p4 d5 d6 d7

Encoding: data d3 d5 d6 d7 = 1 1 0 1

  • p1 = 1⊕1⊕1 = 1
  • p2 = 1⊕0⊕1 = 0
  • p4 = 1⊕0⊕1 = 0

Codeword (positions 1 to 7) = 1010101.

Error: bit 6 flips during transmission, so the received word is 1010111.

Decoding: recompute the checks:

  • c1 (positions 1, 3, 5, 7) = 1⊕1⊕1⊕1 = 0
  • c2 (positions 2, 3, 6, 7) = 0⊕1⊕1⊕1 = 1
  • c4 (positions 4, 5, 6, 7) = 0⊕1⊕1⊕1 = 1

The syndrome c4 c2 c1 = 110 = 6, so bit 6 is wrong. Flip it to get 1010101 and extract the data 1101. A single error is corrected without retransmission.

✓ Answer checked by Claude Sonnet 5.5

All Data Communication chapter 8 questions →