posted
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
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.
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 |