|
I need to implement a Hamming Decoder using java. I'll explain the specifications:
I need to be able to input a 15-bit string, the program will then determine and output the nearest codeword then it will output the original 11-bit message; there will be at most 1 error that needs correcting.
(here is the parity check matrix for a [15,11] code:
[0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 0 0 1]
)
Even some strong pseudocode would be of immense help and would help me better prepare for this exam. I will paypal someone 5, 10, or whatever appropriate amount of money as compensation.
|
A homework thread, for money?
|
United States3824 Posts
Check sum? Hamming Distance? Grey Code? Homework?
|
As a student in information sciences, i reckognize homework when a blog is posted about it.
|
I don't think this is technically a homework thread. He's offering compensation and not depending on help for free.
It's more like he's offering someone a small job.
|
http://en.wikipedia.org/wiki/Hamming_code#General_algorithm this can probably help you quite a bit. Obviously you'll have to reverse what they give a bit to figure out how to detect errors, but the table should be super-helpful for figuring that out. I think if you sit down and work through it manually and then write the code yourself, it'll be a lot more beneficial to you in the long run.
Edit: Also, notice that "Parity bit 1 covers all bit positions which have the least significant bit set: bit 1 (the parity bit itself), 3, 5, 7, 9, etc.". You can check such a condition with (position & 0x1). That should be helpful for looping through all the bits you need to check.
And moreover, this should help you with the process as well: http://en.wikipedia.org/wiki/Hamming_code#Hamming.2811.2C7.29_code
|
On March 03 2010 08:36 tec27 wrote:http://en.wikipedia.org/wiki/Hamming_code#General_algorithm this can probably help you quite a bit. Obviously you'll have to reverse what they give a bit to figure out how to detect errors, but the table should be super-helpful for figuring that out. I think if you sit down and work through it manually and then write the code yourself, it'll be a lot more beneficial to you in the long run. Edit: Also, notice that "Parity bit 1 covers all bit positions which have the least significant bit set: bit 1 (the parity bit itself), 3, 5, 7, 9, etc.". You can check such a condition with (position & 0x1). That should be helpful for looping through all the bits you need to check. And moreover, this should help you with the process as well: http://en.wikipedia.org/wiki/Hamming_code#Hamming.2811.2C7.29_code
Many thanks tec. I decided to skip a couple of my classes today to get this done and it wound up being easier than I anticipated. Wikipedia was exactly what I used too, the only difference is they mainly focus on [7,4] codes and mine had to be of variable length. It turns out there's a formula that easily derives the parity check matrix for any length. Once I found that it was easy.
I'll post it in case you were interested: Code length: n = 2^m - 1 Dimension: k = 2^m - m - 1 Min distance: d = 3
|
|
|
|