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
| Position | Binary index | Holds | Bit |
|---|---|---|---|
| 0 | 000 | p0 (overall) | 0 |
| 1 | 001 | p1 | 0 |
| 2 | 010 | p2 | 1 |
| 3 | 011 | d1 | 1 |
| 4 | 100 | p4 | 0 |
| 5 | 101 | d2 | 0 |
| 6 | 110 | d3 | 1 |
| 7 | 111 | d4 | 1 |
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 = 0— covers positions 1, 2, 3, 4, 5, 6, 7
p11 ⊕ 0 ⊕ 1 = 0— covers positions 3, 5, 7
p21 ⊕ 1 ⊕ 1 = 1— covers positions 3, 6, 7
p40 ⊕ 1 ⊕ 1 = 0— covers positions 5, 6, 7
Codeword00110011Highlighted cells are parity bits.
Position 0 holds the overall parity bit and is written first.
Source: R. W. Hamming, Bell System Technical Journal 29(2):147–160 (1950)