HAMMING CODE

SECDED: Single Error Correction · Double Error Detection
DATA BITS (4 bits)
ENCODED CODEWORD (7+1 = 8 bits: Hamming(7,4) + overall parity)
P=parity bits (pos 1,2,4,8) D=data bits
RECEIVED WORD — Click bits to flip (inject errors)
DECODED/CORRECTED
DATA INPUT
PARITY CHECK MATRIX H
SYNDROME CALCULATION
STATISTICS
HOW IT WORKS
Hamming(7,4): 4 data bits + 3 parity bits → 7-bit codeword. Parity bit at position 2^k covers all positions with bit k set. The syndrome s = Hr mod 2 gives the error position (s=0: no error). An overall parity bit (pos 8) enables SECDED: odd syndrome + wrong overall parity → 1 error (correct); even syndrome → 2 errors (detect, can't correct).