Search code examples
chamming-code

How many bits can a Hamming code (255 247) detect and correct?


I am looking for a simple answer to a simple question but I have yet to find a straight forward answer.

For the Hamming code sequence (7 4), it can either do 1-bit detection and correction or 2-bit error detection.

I would like to know the same thing for the (255 247) Hamming sequence. If there is an algorithm to work this out I would very much appreciate it as I am interested in knowing this information for the other Hamming sequences.

Is there also perhaps a C code example for (255 247) encoding exclusively?


Solution

  • The minimum hamming distance determines the error detection/correction capabilities of a code.

    Hamming codes (eg. Hamming(7,4) or Hamming(255,247)) have a hamming distance of 3 (d = 3), so can detect 2-bit errors (d - 1 = 2) or correct 1-bit errors ((d - 1) / 2 = 1).