Computer Networks · TEE · practice

Single-error correction · example 2

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 0110 using even-parity Hamming coding. Number positions left-to-right starting at 1 and insert data in that order. If bit position 3 flips, show how the receiver locates and corrects it. [7 practice marks]

Answer

Given

Data=0110; even parity; error position=3; only one bit flips.

To find

Redundant bits, complete codeword and syndrome correction.

Formula and why

2^r\ge m+r+1LaTeX: 2^r\ge m+r+1
\mathrm{syndrome}=s_1+2s_2+4s_4+\cdotsLaTeX: \mathrm{syndrome}=s_1+2s_2+4s_4+\cdots

Parity 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

CheckCovered positions (including check)Parity bit
p11, 3, 5, 71
p22, 3, 6, 71
p44, 5, 6, 70
Position1234567
Encoded bit1100110

Step 3. Introduce and check the error

Received = 1110110

Syndrome checkReceived-bit XORResult
s11 XOR 1 XOR 1 XOR 01
s21 XOR 1 XOR 1 XOR 01
s40 XOR 1 XOR 1 XOR 00

Step 4. Locate and flip

Syndrome integer=3. Flip position 3; recovered codeword=1100110; extracted data=0110.

Final answer: Codeword 1100110; syndrome 3; corrected data 0110.