Lecture 14
Lecture 14
Bit Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Code P1 P2 D1 P4 D2 D3 D4 P8 D5 D6 D7 D8 D9 D10 D11
A Hamming Code with 4 Parity Bits: P1, P2, P4 and P8
Bit # P8 P4 P2 P1
1 0 0 0 1 Parity bit Pi checks all the bit positions,
2 0 0 1 0 whose (Bit #) binary representation has 1’s in
3 0 0 1 1 position i.
4 0 1 0 0
5 0 1 0 1 Examples:
6 0 1 1 0 P1 checks the bits 1,3,5,7,9,11,13 and 15
7 0 1 1 1
8 1 0 0 0 P2 checks the bits 2,3,6,7,10,11,14 and 15
9 1 0 0 1
10 1 0 1 0 P4 checks the bits 4,5,6,7,12,13,14 and 15
11 1 0 1 1
12 1 1 0 0 P8 checks the bits 8,9,10,11,12,13,14 and 15
13 1 1 0 1
14 1 1 1 0
A Hamming Code with 4 Parity Bits: P1, P2, P4 and P8
Bit # P8 P4 P2 P1
For Even Parity, the values of P1, P2, P4
1 0 0 0 1
2 0 0 1 0
and P8 are generated as follows:
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
A Hamming Code with 3 Parity Bits
Three parity bits can check up to 4 data bits, making a 7-bit code.
Bit Position: 1 2 3 4 5 6 7
Code P1 P2 D1 P4 D2 D3 D4
A Hamming Code with 3 Parity Bits: P1, P2 and P4
Bit # P8 P4 P2 P1 For Even Parity, the values of P1, P2,
1 0 0 0 1 and P4 are generated as follows:
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
Bit Position: 1 2 3 4 5 6 7
14 1 1 1 0
Code P1 P2 D1 P4 D2 D3 D4