Escolar Documentos
Profissional Documentos
Cultura Documentos
Cyclic codes
• Important subclass of linear codes
• Encoding and syndrome computing circuits
can be implemented easily by employing shift
registers with feedback
• Because of the inherent algebraic structure, it
is possible to find different practical methods
to decode them
Description of cyclic Codes
• An n-tuple v is
v( X ) v0 v1 X v2 X 2 ..... vn 2 X n 2 vn 1 X n 1
Xv( X ) v0 X v1 X 2 v2 X 3 ..... vn 2 X n 1 vn 1 X n
v0 X v1 X 2 v2 X 3 ..... vn 2 X n 1 vn 1 X n vn 1 vn 1
vn 1 ( X n 1) vn 1 v0 X v1 X 2 v2 X 3 ..... vn 2 X n 1
vn 1 ( X n 1) v1 ( X )
i
Relation between v ( X )& v( X )
X i v( X ) q ( X )( X n 1) v i ( X )
Algebraic Properties of Cyclic Codes
Theorem 1
The nonzero code polynomial of minimum
degree in cyclic code C is unique
g( X ) g0 g1 X g2 X 2 ..... gr 1 X r 1 gr X r
Algebraic Properties of Cyclic Codes
Theorem 2
For the nonzero code polynomial of minimum
degree
g( X ) g0 g1 X g2 X 2 ..... gr 1 X r 1 gr X r
g0 1
Code Polynomial v(X) as multiple of g(X)
Xg( X ) g ( X );
1
X 2 g( X ) g2 ( X )......
X n r 1 g( X ) gn r 1( X )
So Xg( X ), X 2 g( X ),..., X nr 1 g( X ) are code
polynomials.
Linear combination of the code
polynomials = another code polynomial
(linearity property)
V ( X ) u0 g( X ) u1 Xg( X ) u2 X 2 g( X ) ... un r 1 X n r 1 g( X )
V ( X ) (u0 u1 X u2 X 2 ... un r 1 X n r 1 ) g( X )
Algebraic Properties of Cyclic Codes
Theorem 3
r 1
Let g( X ) g0 g1 X g2 X 2
..... gr 1 X gr X r
2n r k
2 ;r n k
General form of nonzero code polynomial
of minimum degree
n k 1 n k
g( X ) 1 g1 X g2 X ..... gn k 1 X
2
X
Algebraic Properties of Cyclic Codes
Theorem 4
In an (n,k) cyclic code C, there exists one and
only one code polynomial of degree n-k
n k 1 n k
g( X ) 1 g1 X g2 X ..... gn k 1 X
2
X
V ( X ) (u0 u1 X u2 X 2 ... uk 1 X k 1 ) g( X )
Theorem 5
Theorem 6
Let u (u , u , u ..., u )
0 1 2 k 1
be the message to encoded
u( X ) u u X u X 2 ... u X k 1
0 1 2 k 1
X n k u( X ) u0 X n k u1X n k 1 u2 X n k 2 ... uk 1X n 1
X n k u( X ) a( X ) g( X ) b( X )
Cyclic Code in Systematic Form
b( X ) X n k u( X ) a( X ) g( X )
u2 X n k 2 ... uk 1X n 1 a( X ) g( X )
1. Premultiply u( X ) by X n k
2. Obtain b(X) by dividing X n k u( X ) by g(X)
3. Obtain the code polynomial by combining
b(X) and X n k u( X )
Example
g( X ), Xg( X ), X 2 g( X )......., X k 1 g( X )
These code polynomials span the (n,k) code
Generator Matrix of (n,k) Cyclic Code
1 1 0 1 0 0 0
0 1 1 0 1 0 0
G
0 0 1 1 0 1 0
0 0 0 1 1 0 1
Generator Matrix of (7,4) Cyclic Code
generated by g( X ) 1 X X 3
in
systematic form
1 1 0 1 0 0 0
0 1 1 0 1 0 0
G'
1 1 1 0 0 1 0
1 0 1 0 0 0 1
Parity Check Matrix of (n,k) Cyclic
Code
( X 1) h( X )g( X )
n
h( X ) h0 h1 X h2 X 2 ..... hk 1 X k 1 hk X k
h0 hk 1
Parity Check Matrix of (n,k) Cyclic
Code
v( X ) a( X ) g( X )
h( X )v( X ) a( X ) g( X )h( X )
a( X )( X 1)
n
a( X ) a( X )X n
Parity Check Matrix of (n,k) Cyclic
Code
k 1
v( X )h( X ) a0 a1 X a2 X ..... ak 1 X
2
k 1
(a0 a1 X a2 X ..... ak 1 X
2
)X n
k 1
a0 a1 X a2 X ..... ak 1 X
2
n 1 n2 n k 1
a0 X a1 X
n
a2 X ..... ak 1 X
Parity Check Matrix of (n,k) Cyclic
Code
k
hi vn i j 0; for1 j n k
i 0
The reciprocal of h(X) is defined as
X k h( X 1 ) hk hk 1 X hk 2 X 2 ..... h0 X k
Parity Check Matrix of (n, k) Cyclic Code
X k h( X 1 ) is a factor of X n 1
hk hk 1 hk 2 . h0 0 . 0
0 hk hk 1 . . h0 . 0
H
. . . . . . . .
0 . 0 hk hk 1 . h1 h0
Parity Polynomial of (n,k) Cyclic Code
• Any codeword v in C is orthogonal to every
row of H
• Therefore H is the parity check matrix of the
cyclic code C and the row space of H is the
dual code of C
• Since the parity check matrix H is obtained
from the polynomial h(X), h(X) is called the
parity polynomial of C
Parity Polynomial of (n,k) Cyclic Code
h( X ) h0 h1 X h2 X 2 ..... hk 1 X k 1 hk X k
h0 hk 1
Theorem 7
X n k i ai ( X ) g ( X ) bi ( X ); i 0,1,......k 1
n k 1
bi ( X ) bi 0 bi1X bi 2 X ... bi,n k 1X
2
bi ( X ) X n k i ai ( X ) g ( X )
Generator Matrix of (n,k) Cyclic Code
in Systematic Form
b00 b01 b02 . . b0,n k 1 1 0 . . 0
b b11 b12 . . b1,n k 1 0 1 . . 0
10
. . . . . . . . . . .
. . . . . . . . . . .
bk 1,0 bk 1,1 bk 1,2 . . bk 1,n k 1 0 0 . . 1
Parity check Matrix of (n, k) Cyclic
Code in Systematic Form
1. Premultiply u( X ) by X n k
2. Obtain b( X ) by dividing X n k u( X ) by g ( X )
3. Obtain the code polynomial by combining b( X ) and
X n k u( X )
Encoding steps
• Initially Gate is turned on and the ‘k’ information
digits are shifted into the register from the right
end and the channel simultaneously. Shifting the
message u( X ) from the right end is equivalent to
multiply it by X n k . The contents of the shift
register are the parity check digits
• Then Gate is turned off and the parity-check
digits are shifted one by one to the channel
Encoding of (7, 4) Cyclic Code
b u b b
1(new) i 0 2
b0 b1 b2 u
b u b b b i
0(new) i 2 2(new) 1
v
0 0 0
(Initial Condition)
1 1 1 0
(First Shift)
1 1 0 1
(Second Shift)
• Suppose the message 1011 is to be encoded
Input Register Contents (b0,b1, b2)
u b ) (b b )
(ui) i 2 1(new) ui b2 b0 ) 2(new) 1
(b (b
0(new)
1 1 0 1
(Second Shift)
0 1 0 0
(Third Shift)
1 1 0 0
(Fourth Shift)
Encoding of (n, k) Cyclic Code using
Parity Polynomial
i 0
v (v0 , v1,v2 ,...vnk 1 , vnk , vnk 1 ,....vn1 )
v (v0 , v1,v2 ,...vnk 1 , u0 , u1 ,....uk 1 )
vn k 1 h0vn 1 h1vn 2 ....... hk 1vn k
uk 1 h1uk 2 ....... hk 1u0
k 1
vn k j hi vn i j 0; for1 j n k
i 0
0 0 1
0 0 1
1 0 1 1
OFF
1 0 1
0 0 1 0
OFF
r ( X ) a( X ) g ( X ) s( X )
• s(X) is polynomial of degree n-k-1 or less
• s(X) is identical to zero if and only if r(X) is a
code polynomial . s(X) is called the syndrome
Syndrome computation and Error
Detection
X v( X ) q( X )( X 1) v ( X )
i n i
v( X ) v0 v1 X v2 X 2 ..... vn 2 X n 2 vn 1 X n 1
Xv( X ) v0 X v1 X 2 v2 X 3 ..... vn 2 X n 1 vn 1 X n
v0 X v1 X 2 v2 X 3 ..... vn 2 X n 1 vn 1 X n vn 1 vn 1
vn 1 ( X n 1) vn 1 v0 X v1 X 2 v2 X 3 ..... vn 2 X n 1
vn 1 ( X n 1) v1 ( X )
Syndrome computation and Error
Detection
Theorem 8
Let s(X) be the syndrome of a received polynomial
n2 n 1
r ( X ) r0 r1 X r2 X ..... rn 2 X
2
rn 1 X
Xr ( X ) rn1 ( X 1) r ( X )
n 1
r1 ( X ) rn1 ( X n 1) Xr ( X )
Syndrome computation and Error
Detection
Xr ( X ) rn1 ( X n 1) r1 ( X )
r ( X ) rn1 ( X 1) Xr ( X )
1 n
r1 ( X ) c( X ) g ( X ) ( X )
Rg ( X ) [r ( X )] ( X )
1
Syndrome computation and Error
Detection
r1 ( X ) c( X ) g ( X ) ( X )
r ( X ) rn 1 ( X 1) Xr ( X )
1 n
c( X ) g ( X ) ( X ) rn 1 g ( X )h( X ) Xr ( X )
c( X ) g ( X ) ( X ) rn 1 g ( X )h( X ) X {a( X ) g ( X ) s( X )}
{rn 1h( X ) Xa( X )}g ( X ) Xs( X )
Xs( X ) {c( X ) rn 1h( X ) Xa( X )}g ( X ) ( X )
Syndrome computation and Error
Detection
Rg ( X ) [ Xs( X )] ( X )
Rg ( X ) [r1 ( X )] ( X )
Syndrome computation and Error
Detection
• We can obtain the syndrome s1(X) of r1(X) by
shifting the syndrome register once with s(X) as
the initial contents with the input gate disabled.
• Shifting the syndrome register once with s(X) as
the initial contents is equivalent to dividing Xs(X)
by g(X)
• The syndrome si(X) of ri(X) is obtained by shifting
the syndrome register ‘i’ times with s(X) as the
initial contents with the input gate disabled.
Syndrome circuit for (7,4) Cyclic Code
7 0 10 1 (syndrome s)
8 - 100 (syndrome s1 )
9 - 010 (syndrome s2 )
Decoding of Cyclic Codes
• Syndrome Computation
• Error correction
Decoding of Cyclic Codes
• A Straightforward approach to the design of
a decoding circuit is via a combinational logic
circuit that implements the table look-up
procedure
• The complexity of the decoding circuit tends
to grow exponentially with the code length
and the number of errors to be corrected
Decoding of Cyclic Codes
X Rg ( X ) [ X ];0 j n 1
j j
• The syndrome s11 (X) of r11 (X) is the
remainder obtained by dividing X[s(X)+Xn-1 ]
by g(X)
Rg ( X ) [ Xs ( X )] s ( X ); Rg ( X ) [ X ] 1
1 n
s ( X ) s ( X ) 1
1
1 1
r1 ( X ) rn 1 r0 X r1 X 2 ..... rn 3 X n 2 rn 2 X n 1
r11 ( X ) (rn 1 en 1 ) r0 X r1 X 2 .. rn 2 X n 1
Meggitt
Decoder
Step1 of Decoding
s1( new) s2 s0
s2( new) s1
Meggitt
Decoder
For (7,4)
Cyclic code
Decoding of (7, 4) Cyclic Code
Example
• Suppose that the codeword v = (1001011) is
transmitted and r=(1011011) is received . A
single error occurs at location X2 .
Decoding of (7, 4) Cyclic Code
generated by g ( X ) 1 X X
3
s0( new) do s2
do
s1( new) s2 s0
s2( new) s1
Gate
g0 g1 gn-k-1
b0 + b1 + b2 + bn-k-1
+