PDA

View Full Version : Hamming code and distance


maiamorbific
Sep30-09, 03:35 PM
*Devise a code for the digits 0 to 9 whose Hamming distance is 2.*

My efforts to answer this problem are kind of hard to explain, but I'll try. First I wrote out the digits 0 to 9 in binary. Then I tried to find a number that was only 2 numbers different from each one (get 2 ones when XOR them), but there was no single code that worked for all 9 numbers. I found one that worked from 0 to 7, but once the digits changed to 1000 it didn't work anymore.

Am I even approaching this right? Please help.

Jeff Reid
Sep30-09, 06:55 PM
You need 3 redunancy bits for a distance of 2, which allows you to correct single bit errors. Since it takes 4 bits to represent the numbers 0 through 9, you need a 7 bit code.