FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » Hamming Code and You!

   
Author Topic: Hamming Code and You!
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
Say you have a packet of 7 bits 1110111, with Hamming Code (7,11) we add in 4 parity bits P1, P2, P4 and P8, 10111101111

So now we have 4 Parity bits and 7 data bits.

Here's a nifty chart
code:
P8|P4|P2|P1| Error
-------------------
G G G G| None
G G G B| P1
G G B G| P2
G G B B| D3
G B G G| P4
G B G B| D5
G B B G| D6
G B B B| D7
B G G G| P8
B G G B| D9
B G B B| D10
B B B B| D11

And if I remember
P1 = D3,D5,D7,D9,D11
P2 = D3,D6,D7,D10,D11
P4 = D5,D6,D7
P8 = D9,D10,D11

So consider our Packet
10111101111

Lets now arrange it:
code:
P1 P2 D3 P4 D5 D6 D7 P8 D9 D10 D11
1 0 1 1 1 1 0 1 1 1 1

On my test where I did this all by hand I made another smaller chart

code:
P1|P2|P4|P8
-------------
| | |
| | |
| | |
| | |
| | |
| | |

Now I don't know how to add in Parity bits so I took an example my prof provided.

What we do for each Parity check is add each 1 Bit at each data bit, if the result is Odd then the Parity Bit needs to be 1 to Make it even and vice versa.

So reusing our chart Checking for P1-8

Checking P1, Adding the Databits we get 4, So P1 needs to be '0' to be a good bit. And its 1... so Bad bit.

code:
P1|P2|P4|P8
-------------
B| | |

Checking for P2, Result is 4, P2 needs to be 0 to be a good bit. And it is!

code:
P8|P4|P2|P1
-------------
| | G| B

P4, Bad bit.

code:
P8|P4|P2|P1
-------------
| B| G| B

P8, Result is 3, needs to be 1 to make even and P8 is 1 so Good bit.

code:
P8|P4|P2|P1
-------------
G| B| G| B

Which if we're paying attention is Binary for 5 Meaning Data bit 5 is incorrect, so we correct the bit.

1110111 Becomes 1010111
code:
64 32 16 8 4 2 1
1 0 1 0 1 1 1

Becomes 4+3+16+64 = 87 Which is 'W' I think the answer considering the other lines would make Widgets.

I think I got this right.

[ November 14, 2008, 01:47 PM: Message edited by: Blayne Bradley ]

IP: Logged | Report this post to a Moderator
ketchupqueen
Member
Member # 6877

 - posted      Profile for ketchupqueen   Email ketchupqueen         Edit/Delete Post 
42.
Posts: 21182 | Registered: Sep 2004  |  IP: Logged | Report this post to a Moderator
SenojRetep
Member
Member # 8614

 - posted      Profile for SenojRetep   Email SenojRetep         Edit/Delete Post 
Wikipedia on Hamming Code (the Hamming(11,7) code has a nice explanation near the end).

In the encoding (I'm assuming that's what you were doing when you wrote "so consider our Packet"), I get something significantly different than what you got. For example:
P4 = D5+D6+D7 = 1+1+0 = 0

This disagrees with the "1" indicated in your message "10011001101". I get different values for some of the other parity bits as well.

Starting from the "rearranged" message, I get the same decoded word as you. One technicality: when you say "bad bit," it's not the parity bit itself is bad, but rather there is an error in the set of linear combinations of bits that encode the parity bits. It's fine to say "bad bit" as long as you realize that's not actually what a failed parity check means.

Posts: 2926 | Registered: Sep 2005  |  IP: Logged | Report this post to a Moderator
Blayne Bradley
unregistered


 - posted            Edit/Delete Post 
typo me thinks.
IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2