6 HammingCode
6 HammingCode
6 HammingCode
Hamming code
Parity bits
ASCII 7 bit code (hex 00 to 7F)
Could use 8th bit for parity bit:
X1011010
01011010
11011010
Word:
With Error:
Identifying error:
Hamming Distance
The
Hamming Distance
For any coding whose members have a Hamming distance
of three, any one bit error can be detected and
corrected. Why?
And any two bit error can be detected. Why?
Syndrome
Data
Code
The output of the Compare to the Corrector is termed the syndrome, and is
K bits long
Example: For M = 8:
12
11
10
Bit number
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
D8
D7
D6
D5
D4
D3
D2
C2
C1
Data bit
Check bit
C8
D1
C4
exor D4 exor D5
exor D7
exor D3 exor D4
exor D6 exor D7
D2 exor D3 exor D4
exor D8
Why this ordering? Because we want the syndrome, the Hamming test word,
to yield the address of the error.
Example:
Data stored = 00111001
Check bits:
Putting it together:
Example:
Example:
Word fetched:
Check Bits:
Comparing:
C8 C4 C2 C1
0 1
1 0 Syndrome
SEC-DEC Example
Requires One Extra Check Bit
Single Error Correction:
Word
With Errors
Identifying Error
SEC Attempt
IS SEC Correct?