Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a common way of naming or distinguishing between these two kinds of SECDED Hamming code? For now, I'm calling them "the odd+even Hamming code" and "the extended Hamming code". All the descriptions I've seen for the odd+even Hamming code simply call it "the" Hamming code, which is confusing when I try to contrast it with a slightly different code that other documents also call "the" Hamming code.

The "odd+even Hamming code" and the "extended Hamming code" are extremely similar.

One way to distinguish them is at the receiver: A receiver that uses the extended Hamming code re-calculates only the "odd ECC word" plus an overall parity bit. (The "odd ECC word" alone is called "the" Hamming code by Wikipedia: Hamming code).

A receiver that uses the odd+even Hamming code (called "the" Hamming code by "TN-29-08: Hamming Codes for NAND Flash Memory Devices", "Hamming code explanation", "Error correction in Flash memory" , etc.) re-calculates both the "odd ECC word" plus the "even ECC word" (but apparently not the overall parity bit).

Given some received 8-bit codeword abcd_efgh, (here "^" represents the xor operator),

Calculated only by extended Hamming code:

a^b^c^d^e^f^g^h == overall parity bit

Calculated only by odd+even Hamming code:

a^b^c^d         == parity of even half (bit 3 of even ECC word)
a^b  ^  e^f     == parity of even fourths (bit 2 of even ECC word)
a  ^c  ^e  ^g   == parity of even bits (bit 1 of even ECC word)

Calculated by both codes:

        e^f^g^h == parity of odd half  (bit 3 of odd ECC word)
    c^d  ^  g^h == parity of odd fourths  (bit 2 of odd ECC word)
  b  ^d  ^f  ^h == parity of odd bits  (bit 1 of odd ECC word)

(I'm designing something like a wireless Holter monitor for temperature logging and other data collection. It stores data in flash and transmits the data wirelessly.)

Which of these two kinds of "Hamming code" is better for data storage?

Which of these two kinds of "Hamming code" is better for wireless communication?

Is there a common way of naming or distinguishing between these two kinds of Hamming code?

(Is there some other Stack Exchange site better for questions about error-correction coding -- perhaps Computer Science Stack Exchange or Electronics Stack Exchange ?)

share|cite|improve this question
It is difficult to answer any of these questions without knowing what kind of errors may be created by A) in the storage medium, B) in wireless communication. As a rule the extended Hamming code offers more robust protection, because it has one extra bit of redundancy. But if, e.g. storage medium is not so likely to produce that many errors, then you may be able to afford to drop that bit for more efficient storage. That may be moot, if you prefer byte aligned data, when the extended code can be used without combining the bits from several bytes. – Jyrki Lahtonen Aug 12 '13 at 16:07
.. and unless the amount of data you are transmitting in a single burst is very small indeed, I would not consider either of these codes for wireless transmission. Their blocks are just so short, so a wireless channel is bound to drop a byte every now and then, but a longer code will average out thermal noise better. How many bits per packet are we talking about (a ballpark figure is enough)? – Jyrki Lahtonen Aug 12 '13 at 16:13
@JyrkiLahtonen: Yes, I see that "the extended Hamming code" offers more robust protection than "the odd ECC word" alone. However, it is not obvious to me whether "the extended Hamming code" is more or less robust than "the odd+even Hamming code" ("the odd ECC word" and "the even ECC word"). If you could say a few words about why the extended Hamming code is more (or less) robust than "the odd+even Hamming code", I would be happy to accept that as an answer. – David Cary Aug 13 '13 at 3:53
@JyrkiLahtonen: (a) I suspect that every kind of Flash memory has the same vulnerability as DRAM -- cosmic rays, draining stored charge in a small region of the chip. Hopefully I can arrange things so that any single stored codeword has its bits spread far enough apart that any single cosmic ray, although damaging dozens of physically nearby bits, will only damage one bit per codeword. So I hope that the Hamming codes used in DRAM ECC memory will work just as well for flash memory. – David Cary Aug 13 '13 at 4:42
@JyrkiLahtonen: I'm looking at one protocol with about 32 data bits per packet, and another protocol with about 4096 data bits per packet. – David Cary Aug 13 '13 at 4:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.