# An 8 bit data 01101101 after transmission is received as 01001101. Explain how SEC code will detect and correct this problem.

1
by La9annamaru

2016-04-22T12:09:33+05:30
SEC means Single Error Correction

This if found in Hamming Error Correction Code

First found out the number parity bits in SEC Code.

Formula :
(2^i)-1=N+I
where,

i=number of parity bits in SEC Code

N = number of bits in Data Word.

In this case, N=8, I=? so,

2^i>=N+l at i=3

2^3-1>=8+3
7>=11 (Not True)

So, 2^i-1>=N+I at i=4

2^4-1>=8+4
15>=12(True)

Condition Satisfied.

Correction bits (parity bits) are 4.
Parity bits placed at

2^0 2^1 2^2 2^3
ie, 1 2 4 8 respectively.

P1 P2 P3 D1 D2 D3 D4 P4
1 2 3 4 5 6 7 8
? ? ? ?

D5 D6 D7 D8
9 10 11 12

D1 D2 D3 D4 D5 D6 D7 D8 are the data sent and received.

Before sending calculate Parity of Data to be sent.

P1 P2 D1 P3 D2 D3 D4 P4
1 2 3 4 5 6 7 8
? ? 0 1 1 1 0 ?
-------------------------------------
D5 D6 D7 D8
9 10 11 12
1 1 0 1
--------------------

P1 = ? 0 1 0 1 0
(Position)= 1 3 5 7 9 11

Starting Point will be after Parity position P1. ie, 2 Take 1 Skip 1 till the end of table data.

We get, 01010

It is even parity will be zero.

P2 =? 0 1 0 1 0
(Position) = 2 3 6 7 10 11

Starting Point will be after Parity position P2 . ie, 3 and Take 2 Skip 2 till the end of table data.

We get 01010
Its even parity will be zero.

P3 = ? 1 1 0 1
(Position)=4 5 6 7 12

Starting Point will be after Parity position P3 ie, 4 and Take 4 Skip 4 till the end of table data.

We get, 1101
It is even parity will be one.

P3 = ? 1 1 0 1
(Position) =8 9 10 11 12

Starting Point will be after Parity position P3 ie 4 and Take 8 Skip till the end of table data.
(Note :- data ends before taking 8 elements.)

We get, 1101

It is even parity will be one.

We found all parity bits, we will fill in the table :

P1 P2 D1 P3 D2 D3 D4 P4
1 2 3 4 5 6 7 8
0 0 0 1 1 1 0 1
------------------------------------
D5 D6 D7 D8
9 10 11 12
1 1 0 1
-------------------
Assuming all parity sent correctly.

The 8- bit Sent Data
=01101101

The 8-bit Sent Data =01001101

Check with parity bits, before that Create a new parity bit with new data.

P1=D1 D2 D4 D5 D7 =01010 Even parity will be 0 - correct.

P2 =D1 D3 D4 D6 D7
= 00010 Even parity will be 1 - incorrect.

P3=D2 D3 D4 D8 =1001
Even parity will be 0- incorrect.

P4= D5 D6 D7 D8 =1101
Even parity will be 1-correct.

After checking,

We find that common data bit numbers are D3 & D4.

But D4 is also present in P1 that means error has been occurred in D3 only.

By this we detect error in D3 and Correct it by replacing it by 0 to 1.