SECDED: adding an overall parity bit — Hamming code

exam standardone extra bit buys double detection

Answer

00110011

Why this example is worth doing

Appending one more parity bit over the entire codeword raises the minimum distance from three to four, which is enough to distinguish a correctable single error from an uncorrectable double one. The page gives the three-case decode rule — syndrome zero and overall parity good means clean, syndrome non-zero with parity failed means correct it, syndrome non-zero with parity good means a double error — and notes this is what ECC memory actually implements.

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

SECDED (8,4) encode

SECDED (8,4): a Hamming (7,4) codeword plus an overall parity bit at position 0, giving minimum distance 4.

Data word1011

Parity bits occupy the power-of-two positions; the payload fills the rest in order. — SECDED (8,4) encode
PositionBinary indexHoldsBit
0000p0 (overall)0
1001p10
2010p21
3011d11
4100p40
5101d20
6110d31
7111d41

Each parity bit is the XOR of the data bits it covers, so every check comes out even.

p00 ⊕ 1 ⊕ 1 ⊕ 0 ⊕ 0 ⊕ 1 ⊕ 1 = 0covers positions 1, 2, 3, 4, 5, 6, 7

p11 ⊕ 0 ⊕ 1 = 0covers positions 3, 5, 7

p21 ⊕ 1 ⊕ 1 = 1covers positions 3, 6, 7

p40 ⊕ 1 ⊕ 1 = 0covers positions 5, 6, 7

Codeword00110011Highlighted cells are parity bits.

Warning:

Position 0 holds the overall parity bit and is written first.

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

Compare with

Open the Hamming code

This input is entered in the tool itself — it is too rich for a link to carry.

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)