+ Post New Thread
Results 1 to 5 of 5

25th December 2014, 19:14 #1
 Join Date
 Aug 2011
 Posts
 2,603
 Helped
 304 / 304
 Points
 13,088
 Level
 27
hamming code for encoding 32 bits
Hello,
How many extra bits are needed in order to encode a 32 bit word using hamming code?

Advertisement

25th December 2014, 20:14 #2
 Join Date
 Jul 2010
 Location
 Sweden
 Posts
 967
 Helped
 374 / 374
 Points
 7,297
 Level
 20
Re: hamming code for encoding 32 bits
You need 6 extra bits.
The Hamming codes are perfect, but they don't exist for any number of data bits.
Two of them are Hamming(31, 26) and Hamming(63, 57).
The first number is the total number of bits, and the second is the number of data bits.
You can take Hamming(63, 57) and use only 32 of the 57 data bits.
You will have 32 data bits + 6 parity bits = 38 bits.
When doing the calculations, you can pad the 32 data bits to 57 bits by using any fixed pattern known by both the transmitter and the receiver, all zeros is OK.
1 members found this post helpful.

Advertisement

25th December 2014, 20:40 #3
 Join Date
 Aug 2011
 Posts
 2,603
 Helped
 304 / 304
 Points
 13,088
 Level
 27
Re: hamming code for encoding 32 bits
Thanks.
1. If you have an example of a VHDL Hamming (63,57)  please post it...
2. Also, do you know of any FEC algorithm that can be tailored to any bit length efficiently (not just to "magic" lengths as with Hamming) ?

Advertisement

26th December 2014, 00:11 #4
 Join Date
 Jul 2010
 Location
 Sweden
 Posts
 967
 Helped
 374 / 374
 Points
 7,297
 Level
 20
Re: hamming code for encoding 32 bits
1. I don't have VHDL code
2. Since the Hamming code is perfect, you can't beat it. 6 extra bits is the minimum to correct single bit errors in 32 data bits. The problem with a pure Hamming code is that everything is accepted. Whatever you get, it looks like the correct data or a singlebit correctable error. If you have two wrong bits it will be "corrected" to the wrong value.
By adding one more bit, a single error correcting, double error detecting (SECDED) code can be designed.
32 data bits + 7 parity bits, which seems to be a common solution.
Read this:
http://www.hackersdelight.org/ecc.pdf
1 members found this post helpful.

29th December 2014, 20:03 #5
 Join Date
 Sep 2013
 Location
 USA
 Posts
 7,232
 Helped
 1710 / 1710
 Points
 31,319
 Level
 43
Re: hamming code for encoding 32 bits
Instead of getting into a bunch of mathematical expressions for the hamming code like the link std_match provided. Here is something a bit more bare bones and oriented towards showing exactly how the check bits fit into the data http://www.cs.ucc.ie/~jvaughan/archr...ngexample.pdf
1 members found this post helpful.
+ Post New Thread
Please login