You are on page 1of 3

Experiment N0.

7 SC & ET 2013-14
GHRIET Page 1

Experiment No. 7
AIM:
Implementation of algorithm for decoding linear block codes.
THEORY:
After the code is transmitted, during decoding the received code
needs to be checked for any errors. If the transmitted code vector is X
and corresponding received code is Y then
X=Y if no transmission error
X Y if errors created during transmission.
The decoder detects and corrects those errors in Y by using the stored bit
patterns. For larger block length more memory is required.
To avoid this syndrome decoding is used in Linear Block Codes.
H-matrix is defined as:-
H=[I
n-k
:P
T
]
n =Total number of bits
k=Message bits
P
T
=Parity transpose.
XH
T
=(0,0,0,0..0)
For all code vectors.
When some errors are present in received code vector Y then it will not
form a valid code vectors.
Experiment N0.7 SC & ET 2013-14
GHRIET Page 2

That is whenever YH
T
(0,0,0.0) some errors are present in Y.The
non-zero output of YH
T
is called as syndrome.After calculating
syndrome matrix it is checked with each row of H
T
.If P
th
row of H
T
is
same as syndrome matrix then the error is in the p
th
bit or vice-versa the
received vector is corrected.
Each code has its own error detecting and correcting capability.
D=s+1
S = error detecting capability
d= distance between codes
d= 2t+1
t= error correcting capability
ALGORITHM:
1.Declare the input variable and arrays.
2.Take the total no of bits(n) and message bits from the user.
3.Calculate the total no of message by 2
k
.
4.Form the identity matrix.
5.Take the parity matrix of dimension k (n-k) from the user.
6.The generator matrix is formed by G=[p:I
k
].
7.Form the code matrix by multiplying message and generator matrix.
8.Form the H matrix
H=[I
n-k
:p
T
] where p
T
is a parity matrix
9.Find the H
T
i.e H transpose is called as parity check matrix.
Experiment N0.7 SC & ET 2013-14
GHRIET Page 3

10.Ask the user for received code.
11.Multiply received code and parity check matrix to get the syndrome
matrix.
12.Compare the syndrome matrix with each row of parity matrix.
13.If syndrome matrix is one matrix then there is no error in received
code.
14.The row which matches with the syndrome matrix its no corresponds
to be number of bit which has the error in received code.
15.EXOR that bit with 1 to get the corrected bit.
16.Display the corrected code.

Conclusion:-

You might also like