Decode a clean codeword — Hamming code

coresyndrome 0 means no single error

Answer

syndrome = 0 — no error detected

Why this example is worth doing

An uncorrupted codeword gives a syndrome of zero, and the page is careful about what that does and does not prove. It means no single-bit error occurred; it does not mean the data is correct, because a two-bit error can produce a zero syndrome or, worse, a non-zero one pointing at an innocent position. That limitation is exactly what the SECDED extension addresses.

Try your own input in the Hamming code. Encode, inject an error, and watch the syndrome point straight at the flipped bit.

How the answer is reached

Hamming (7,4) decode

Received0110011Highlighted cells are parity bits.

Each check XORs its coverage set, the parity bit included. — Hamming (7,4) decode
CheckParity bitPositions checkedResult
s0p11, 3, 5, 70 (passes)
s1p22, 3, 6, 70 (passes)
s2p44, 5, 6, 70 (passes)

p1 check0 ⊕ 1 ⊕ 0 ⊕ 1 = 0checks positions 1, 3, 5, 7

p2 check1 ⊕ 1 ⊕ 1 ⊕ 1 = 0checks positions 2, 3, 6, 7

p4 check0 ⊕ 0 ⊕ 1 ⊕ 1 = 0checks positions 4, 5, 6, 7

Syndrome S000₂ = 0read with s₀ as the least significant bit

Every check passes and the syndrome is 0: no error detected.

Data word1011

Warning:

A single-error-correcting code cannot tell a double error from a single error; the syndrome then points at an innocent bit.

Source: R. W. Hamming, Bell System Technical Journal 29(2):147–160 (1950)

Compare with

Open this example in the Hamming code

The field arrives filled in with this example’s input.

Note:

Notation this page assumes

  • Bit strings are written most significant bit first, and bit 0 is the least significant bit.
  • A width is stated explicitly wherever it changes the answer; nothing is silently sign-extended or truncated.
  • Hamming positions are numbered from 1 at the left, and parity bits sit at the powers of two — positions 1, 2, 4, 8.

Sources

  • Hamming, “Error Detecting and Error Correcting Codes” (1950)