Computer Networks · TEE · practice
Single-error correction · example 1
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. Encode data 1011 using even-parity Hamming coding. Number positions left-to-right starting at 1 and insert data in that order. If bit position 5 flips, show how the receiver locates and corrects it. [7 practice marks]
Answer
Given
Data=1011; even parity; error position=5; only one bit flips.
To find
Redundant bits, complete codeword and syndrome correction.
Formula and why
2^r\ge m+r+1\mathrm{syndrome}=s_1+2s_2+4s_4+\cdotsParity positions correspond to binary index bits, so a single flipped position changes precisely its index checks.
Step-by-step solution
Step 1. Choose redundancy
m=4; r=3: 23=8 ≥ 4+3+1=8; one fewer parity bit fails.
Step 2. Place data and compute checks
| Check | Covered positions (including check) | Parity bit |
|---|---|---|
| p1 | 1, 3, 5, 7 | 0 |
| p2 | 2, 3, 6, 7 | 1 |
| p4 | 4, 5, 6, 7 | 0 |
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| Encoded bit | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
Step 3. Introduce and check the error
Received = 0110111
| Syndrome check | Received-bit XOR | Result |
|---|---|---|
| s1 | 0 XOR 1 XOR 1 XOR 1 | 1 |
| s2 | 1 XOR 1 XOR 1 XOR 1 | 0 |
| s4 | 0 XOR 1 XOR 1 XOR 1 | 1 |
Step 4. Locate and flip
Syndrome integer=5. Flip position 5; recovered codeword=0110011; extracted data=1011.
Final answer: Codeword 0110011; syndrome 5; corrected data 1011.