Hamming Code Rescue

Hamming(7,4) adds 3 parity bits to 4 data bits so that one flipped bit can be found and repaired.

1. Choose 4 data bits

2. Encoded 7-bit codeword (tap a bit to flip it in transit)

3. Parity checks

4. Result

Limit: Hamming(7,4) always corrects one flipped bit. With two flipped bits the syndrome points to a wrong position, so the decoder "corrects" the wrong bit and returns wrong data without warning. Detecting two errors needs an extra overall parity bit (SECDED).