Computer Networks · TEE · practice
How a Hamming code locates a single error
Unit 3 · Errors, block coding and CRC · optional practice
Optional extension · no matching calculation in the two supplied papers
Optional worked extension. This calculation format was not found in the supplied December 2025 final or February 2026 re-exam. The numbers and practice marks are authored. Study the core concept and actual-paper questions first; this is extra explanation, not a TEE prediction.
Practice question. Explain the construction and single-error correction of a Hamming code. State the redundancy condition. [5 practice marks]
Answer
A basic binary Hamming code uses parity checks whose outcomes identify a single incorrect bit. For m data bits and r check bits, choose the smallest r satisfying 2r ≥ m+r+1. The syndrome must represent each of the m+r possible single-error positions and the no-error state.
2^r\ge m+r+1- Number positions starting at 1. Put parity bits at powers of two: 1,2,4,8,…; fill other positions with data in the stated order.
- Parity bit 1 checks positions whose binary index ends in 1; parity bit 2 checks positions with the 2s bit set; parity bit 4 checks positions with the 4s bit set. Use one declared even/odd parity convention throughout.
- For even parity, choose each check bit so its covered positions XOR to zero.
- At reception, repeat each parity check. Read syndrome bits with the largest parity position first; the resulting integer is the error position under the single-error assumption. Flip that bit.
- A basic Hamming code has distance 3. An additional overall parity bit creates the familiar SECDED extension: single-error correction and double-error detection. Do not claim that basic syndrome correction safely corrects two errors.
Yaad rakho: Parity powers of two; syndrome binary tells the position.