Systematic Cyclic Code - Rutvij Crutvijjoshi.co.in/index_files/lecture-26.pdf · ·...
Transcript of Systematic Cyclic Code - Rutvij Crutvijjoshi.co.in/index_files/lecture-26.pdf · ·...
Systematic Cyclic Code• In a systematic code, the first k digits are
bits and the last m = n – k digits are the parity check bits.
• For systematic code, the codeword polynomial c(x) corresponding to the data polynomial d(x) is given by
• Where ρ(x) is the remainder from dividing xn-kd(x) by g(x).
( ) ( ) ( )n kc x x d x xρ−= +
( )( ) Re( )
n kx d xx mg x
ρ−
=
• To prove this we observe that
• Where q(x) is of degree k – 1 or less. We add to both sides, and because of f(x) + f(x) = 0 under modulo-2 operation, we have
Or
( ) ( )( )( ) ( )
n kx d x xq xg x g x
ρ−
= +
( ) / ( )x g xρ
( ) ( ) ( )( )
n kx d x x q xg x
ρ− +=
( ) ( ) ( ) ( )n kq x g x x d x xρ−= +
Example• Construct a systematic (7,4) cyclic code
using a generator polynomial.SolutionAs we know g(x) = x3 + x2 + 1
Consider a data vector d = 1010
d(x) = x3 + x
so xn – kd(x) = x6 +x4
• x6 + x5 + x3
x5 + x4 + x3
x5 + x4 + x2
x3 + x2
x3 + x2 + 11
3 2
3 2 6 41
1x x
x x x x+ +
+ + +( )q x←
( )xρ←
Hence
and
C = 1010001
3
3 3
6 4
( ) ( ) ( )( ) 1
1
c x x d x xx x xx x
ρ= +
= + +
= + +
• There is one shortcut to make code table for cyclic codes by making generator matrix G.
• Find out code words only for four combinations of inputs 1000, 0100, 0010, 0001, these are 1000110, 0100011, 0010111, 0001101.
• Now recognize these four code words are the four rows of G.
• Once we make generator matrix , then code table can be create using equation
c = d.G
1000110010001100101110001101
G
⎡ ⎤⎢ ⎥⎢ ⎥=⎢ ⎥⎢ ⎥⎣ ⎦
data Code1111 11111111110 11100101101 11010001100 11001011011 10111001010 10100011001 10010111000 10001100111 01110010110 01101000101 01011100100 01000110011 00110100010 00101110001 00011010000 0000000
Generator Polynomial and Generator Matrix of Cyclic Codes
• Once the generator matrix G = [ I p] by determining the parity submatrix P
1st row of P:
2nd row of P:
Kth row of P:
1
Re( )
nxmg x
−
2
Re( )
nxmg x
−
Re( )
n kxmg x
−
• For example
• 1st row of P:
• 2nd row of P:
• 3rd row of P:
• 4th row of P:
3( ) 1g x x x= + +
62Re 1
( )xm x
g x= +
52Re 1
( )xm x x
g x= + +
42Re
( )xm x x
g x= +
3
Re 1( )xm x
g x= +
1000101010011100101100001011
G
⎡ ⎤⎢ ⎥⎢ ⎥=⎢ ⎥⎢ ⎥⎣ ⎦
111010001110101101001
H⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦
Decoding• Every valid code polynomial c(x) is a
multiple of g(x). In other words c(x) is divisible by g(x). When an error occurs during the transmission the received polynomial r(x) will not be a multiple of g(x). If the number of errors in r is correctable. Thus
1( ) ( )( )( ) ( )
r x s xm xg x g x
= +
Where the syndrome polynomial s(x) has a degree n – k – 1 or less.
If e(x) is the error polynomial thenr(x) = c(x) + e(x)
Remembering that c(x) is a multiple of g(x)
( )( ) Re( )
r xs x mg x
=
( )( ) Re( )
( ) ( )Re( )
( )Re( )
r xs x mg x
c x e xmg x
e xmg x
=
+=
=
Example
• Construct the decoding table for the single error correcting (7,4) code. Determine the data vectors transmitted for the following received vectors r: (a) 1101101 (b) 0101000 (c) 0001100
• Solution:The first step is to construct the decoding table.
• Because n – k – 1 , the syndrome polynomial of the second order, and there are seven possible nonzero syndroms.
• There are seven possible correctable single-error patterns because n = 7, we can use to find error
s = e. HT
• s = 001,010,011,100,101,110,111
• For example s = [1 1 0] then e = [1 0 0 0 0 0 0]
101110011100100111001
H⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦
error (e) syndrome (s)1000000 1100100000 0110010000 1110001000 1010000100 1000000010 0100000001 001
• r = [1 1 0 1 1 0 1]s = r. HT
= [1 1 0 1 1 0 1]
= [ 1 0 1]e = [ 0 0 0 1 0 0 0] for s = [1 0 1]
d = 1100
101110011100100111001
⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦
1101101 00010001100101
c r e= ⊕ = ⊕=