Develop an ECC code for a 16bit data word Generate the code
Develop an ECC code for a 16-bit data word. Generate the code for the data word 0101 0000 0011 1001. Show that the code will correctly identify an error in data bit 5.
Solution
Parity positions are in 2n = 20, 21, 22, 23, 24, 25,……
=1,2,4,8,16,32,………
16-bit data word is given as 0 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1
Let D = D1, D2,D3,…. be data bits and P = P1, P2, P3,….be parity bits.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
P1
P2
D3
P4
D5
D6
D7
P8
D9
D10
D11
D12
D13
D14
D15
P16
D17
D18
D19
D20
D21
P1= write 1 number ,skip next number, write 1 number and so on….
= bit positions (1,3,5,7,9,11,13,15,17,19,21)
=P1,D3,D5,D7,D9,D11,D13,D15,D17,D19,D21
=XOR (D3,D5,D7,D9,D11,D13,D15,D17,D19,D21)
=XOR(0,1,1,0,0,0,1,1,0,1)
= 1
P2= write 2 numbers in sequence from pos.2, skip two numbers in sequence, and so on….
= bit positions (2,3,6,7,10,11,14,15,18,19)
= P2,D3,D6,D7,D10,D11,D14,D15,D18,D19
= XOR(D3,D6,D7,D10,D11,D14,D15,D18,D19)
= XOR( 0,0,1,0,0,0,1,1,0)
= 1
P4= write 4 numbers in sequence from pos.4, skip next 4 numbers in sequence and so on…
= bit positions (4,5,6,7,12,13,14,15,20,21)
=P4,D5,D6,D7,D12,D13,D14,D15,D20,D21
=XOR(D5,D6,D7,D12,D13,D14,D15,D20,D21)
= XOR (1,0,1,0,0,0,1,0,1)
= 0
P8= write 8 numbers in sequence from pos. 8 , skip next 8 numbers and so on…
=bit positions(8,9,10,11,12,13,14,15)
= P8,D9,D10,D11,D12,D13,D14,D15
= XOR(D9,D10,D11,D12,D13,D14,D15)
=XOR(0,0,0,0,0,0,1)
=1
P16= write 16 numbers in sequence from pos. 16 , skip next 16 numbers and so on…
= bit positions ( 16,17,18,19,20,21)
=P16,D17,D18,D19,D20,D21
=XOR(D17,D18,D19,D20,D21)
= XOR (1,1,0,0,1)
= 1
FINALLY è
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1
1
0
0
1
0
1
1
0
0
0
0
0
0
1
1
1
1
0
0
1
Check bits are evaluated asè
C1= XOR(P1,D3,D5,D7,D9,D11,D13,D15,D17,D19,D21)
= XOR(1,0,1,1,0,0,0,1,1,0,1) = 0
C2 = = XOR(P2,D3,D6,D7,D10,D11,D14,D15,D18,D19)
= XOR(1, 0,0,1,0,0,0,1,1,0) = 0
C4= =XOR(P4,D5,D6,D7,D12,D13,D14,D15,D20,D21)
= XOR (0,1,0,1,0,0,0,1,0,1) =0
C8 = = XOR(P8,D9,D10,D11,D12,D13,D14,D15)
=XOR(1,0,0,0,0,0,0,1) =0
C16 =XOR(P16,D17,D18,D19,D20,D21)
= XOR (1,1,1,0,0,1)=0
Since C = C16 C8 C4 C2 C1 = 00000 , THERE IS NO ERROR
Suppose there is error in bit 5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1
1
0
0
0
0
1
1
0
0
0
0
0
0
1
1
1
1
0
0
1
Check bits are evaluated asè
C1= XOR(P1,D3,D5,D7,D9,D11,D13,D15,D17,D19,D21)
= XOR(1,0,0,1,0,0,0,1,1,0,1) = 1
C2 = = XOR(P2,D3,D6,D7,D10,D11,D14,D15,D18,D19)
= XOR(1, 0,0,1,0,0,0,1,1,0) = 0
C4= =XOR(P4,D5,D6,D7,D12,D13,D14,D15,D20,D21)
= XOR (0,0,0,1,0,0,0,1,0,1) =1
C8 = = XOR(P8,D9,D10,D11,D12,D13,D14,D15)
=XOR(1,0,0,0,0,0,0,1) =0
C16 =XOR(P16,D17,D18,D19,D20,D21)
= XOR (1,1,1,0,0,1)=0
Since C = C16 C8 C4 C2 C1 = 00101 , THERE IS ERROR in bit 5
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| P1 | P2 | D3 | P4 | D5 | D6 | D7 | P8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 | P16 | D17 | D18 | D19 | D20 | D21 |





