On Tue, Jun 12, 2012 at 12:02 AM, Chuck Guzis <cclist at sydex.com> wrote:
Doesn;t that
assume the 'extra' bits are known to be correct. Those
can be in error too (even if the'real' data bits are correct),
Not necessarily--they're included in the Hamming distance, so a
single error, even in the syndrome bits can be corrected.
A 21 bit word for a 16 bit word will detect all single-bit errors but
a pure Hamming SECDED would require 22 bits (4 SEC + 1 added parity).
?However, there exist other codes with SECDED properties--Hsiao codes-
-that will allow for SECDED in (21:16). ? ?I believe that the popular
(72:64) SECDED code is a shortened Hamming code.
Time to get the terminology and math straight. Please forgive me if I
sound pedantic:
(31,26) (26 data bits + 5 parity bits) is a Hamming code. We only need
16 data bits, so we use (21,16), which is called a truncated Hamming
code. It's capable of single-bit error correction, but not capable of
double-bit error detection (or, more precisely, a double-bit error is
seen as an error in a third bit, which then gets "corrected", so a
double-bit error gets turned into a triple-bit error!).
By adding an extra parity bit to the Hamming code, you get an extended
truncated Hamming code (22,16). Extended Hamming is a SECDED code.
Hsiao code is another SECDED code. It uses the same number of bits as
an extended truncated Hamming code, but is easier to implement in
silicon.
A (72,64) SECDED code could be extended truncated Hamming or Hsiao.
SECDED can not be done with less bits (unless you increase the word
size of course).
Here's an example of a (21,16) truncated Hamming code:
0 000 1111010 11010
---------------------
1 0 0 0 1 1 0 0 1 0 0 - p1
=00 00 11 10 10 - p2
= 1000 1010 10 - p3
= 11111010 - p4
= 111010 - p5
---------------=-----
100100011111010111010
Cheers,
Camiel