Description

hamming code

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Related Documents

Share

Transcript

Hamming code
Building on what you have learnt about parity bits we are now going to see a system that not only allows you to
detect
if the data you have been sent is incorrect, but it will allow you to
correct
the error. The way hamming code does this is to use multiple check digits in the same piece of sent data.
Checking if correct
[edit]
1.
Number the column headings 2.
Highlight the column headings that are powers of 2 (1,2,4,8), these are the parity bits 3.
Insert your data and highlight the parity bits 4.
Work your way through the parity bits 1.
2^0 = 1 : check 1, skip 1, check 1, skip 1 ... write down whether it's odd or even parity 2.
2^1 = 2 : check 2, skip 2, check 2, skip 2 ... write down whether it's odd or even parity 3.
2^2 = 4 : check 4, skip 4, check 4, skip 4 ... write down whether it's odd or even parity 4.
etc..
Example: Odd Parity Hamming Code Check
Let's take a look a an example of data sent with odd parity
11 10 09 08 07 06 05 04 03 02 01 number the columns and highlight the powers of 2
1 0 0 0 0 0 0 1 1 1 1 insert your data 1 0 0 0 0 0 0 1 1 1 1 highlight the check bits
1
0
0
0
1
1
taking the 1st power of 2^0 (1) check 1 skip 1 = odd parity
1
0
0
0
1
1
taking the 2nd power of 2^1 (2) check 2 skip 2 = odd parity
0
0
0
1
taking the 3rd power of 2^2 (4) check 4 skip 4 = odd parity
1
0
0
0
taking the 4th power of 2^3 (8) check 8 skip 8 = odd parity Note that for the check 8 skip 8 we ran out of digits, not to worry, take it as far as the bits given allow. As we can see eacparity, this number is correct.
Exercise: Even Parity Hamming Code Question
Now try this example with even parity: 10101100011 [Collapse]
Answer :
11 10 09 08 07 06 05 04 03 02 01 number the columns and highlight the powers of 2
1 0 1 0 1 1 0 0 0 1 1 insert your data 1 0 1 0 1 1 0 0 0 1 1 highlight the check bits
1
1
1
0
0
1
taking the 1st power of 2^0 (1) check 1 skip 1 = even parity
1
0
1
1
0
1
taking the 2nd power of 2^1 (2) check 2 skip 2 = even parity
1
1
0
0
taking the 3rd power of 2^2 (4) check 4 skip 4 = even parity
1
0
1
0
taking the 4th power of 2^3 (8) check 8 skip 8 = even parity All are even parity, the data should be even parity, therefore it has been sent and received correctly 11011110010 being sent with odd parity [Collapse]
Answer :
11 10 09 08 07 06 05 04 03 02 01 number the columns and highlight the powers of 2
1 1 0 1 1 1 1 0 0 1 0 insert your data 1 1 0 1 1 1 1 0 0 1 0 highlight the check bits
1
0
1
1
0
0
taking the 1st power of 2^0 (1) check 1 skip 1 = odd parity
1
1
1
1
0
1
taking the 2nd power of 2^1 (2) check 2 skip 2 = odd parity
1
1
1
0
taking the 3rd power of 2^2 (4) check 4 skip 4 = odd parity
1
1
0
1
taking the 4th power of 2^3 (8) check 8 skip 8 = odd parity All are odd parity, the data should be odd parity, therefore it has been sent and received correctly 00100011110 being sent with even parity [Collapse]
Answer :
11 10 09 08 07 06 05 04 03 02 01 number the columns and highlight the powers of 2
0 0 1 0 0 0 1 1 1 1 0 insert your data 0 0 1 0 0 0 1 1 1 1 0 highlight the check bits
0
1
0
1
1
0
taking the 1st power of 2^0 (1)
check 1 skip 1 = odd parity! Dodgy!
0
0
0
0
1
1
taking the 2nd power of 2^1 (2) check 2 skip 2 = even parity. OK
0
0
1
1
taking the 3rd power of 2^2 (4) check 4 skip 4 = even parity! OK
0
0
1
0
taking the 4th power of 2^3 (8) check 8 skip 8 =
odd parity. Dodgy!
We have a mixture of odd and even parity, this means that there has been a mistake in sending this data. But where is th
Detecting and correcting errors
[edit]
1.
Number the column headings 2.
Highlight the column headings that are powers of 2 (1,2,4,8), these are the parity bits 3.
Insert your data and highlight the parity bits 4.
Work your way through the parity bits 1.
2^0 = 1 : check 1, skip 1, check 1, skip 1 ... write down whether it's odd or even parity 2.
2^1 = 2 : check 2, skip 2, check 2, skip 2 ... write down whether it's odd or even parity 3.
2^2 = 4 : check 4, skip 4, check 4, skip 4 ... write down whether it's odd or even parity 4.
etc.. 5.
If there is a disparity between rows, highlight all the error data and find where it overlaps

We Need Your Support

Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks