0% found this document useful (0 votes)
17 views30 pages

Unit 5 - 2 Cyclic Codes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views30 pages

Unit 5 - 2 Cyclic Codes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 30

CYCLIC CODES

Cyclic codes are subclass of Linear block codes.


- Easy to encode
- Posses well defined structure
- have very efficient decoding structure.

A binary code is said to be Cyclic code if it exhibits two


properties
1.Linearity property : The sum of two codewords is also a
codeword.
2.Cyclic property : Any cyclic shift of a codeword is also a
codeword.
POLYNOMIAL
REPRESENTATION
A codeword of n bits with elements c0,c1,…………,cn-1 is
represented in polynomial form as
C(X) = c0X0 + c1X1 + c2X2 +…………+ cn-2Xn-2 + cn-1Xn-1

C(X) = c0 + c1X + c2X2 +…………+ cn-2Xn-2 + cn-1Xn-1

where X is an arbitrary variable.


then, its shifted vector for single cyclic shift is
X C(X) = cn-1 + c0X + c1X2 +…………+ cn-3Xn-2 + cn-2Xn-1
is also a codeword.
The coefficients are 1’s or 0’s.
Polynomial representation Ex: 1 0 0
Irreducible polynomial : A polynomial that cannot be factored.

Primitive polynomial : An irreducible polynomial of degree m


which divides 1 + Xn, if the smallest positive integer n = 2m-1, is
said to be a Primitive polynomial.

We start the generation of a (7,4) cyclic code with n = 7, by


factorizing 1 + X7 into three irreducible polynomials

1 + X7 = (1 + X) (1 + X + X3) (1 + X2 + X3)
The polynomials (1 + X + X3) and (1 + X2 + X3) are primitive
polynomials.
VARIOUS POLYNOMIALS AND THEIR DEGREE

Codeword polynomial C(X) - (n-1) or less


Message polynomial m(X) - (k-1) or less
Generator polynomial g(X) - (n-k)
Parity check polynomial h(X) - k
Syndrome polynomial s(X) - (n-k-1) or less
Generator polynomial - g(X)

An (n, k) cyclic code is specified by the complete set of


codeword polynomials of degree (n-1) or less.
C(X) = c0 + c1X + c2X2 +…………+ cn-2Xn-2 + cn-1Xn-1

Generator polynomial g(X) is a polynomial of degree (n-k) and


is a factor of 1 + Xn.
g(X) is the codeword polynomial of least degree (n-k) in the
code
The degree of g(X) is equal to number of parity bits in the
code.
The Generator polynomial is equivalent to generator matrix G.
The Generator polynomial can be written as

g(X) = 1 + g1X + g2 X2 + ……………+ gn-k-1Xn-k-1 + Xn-k

where gi is a coefficient equal to 0 or 1.


It has two terms with coefficient 1 separated by (n-k-1) terms
with undetermined coefficients

Properties of Generator polynomial

Property 1: The Generator polynomial of an (n,k) cyclic code


is unique in that it is the only codeword polynomial of
minimum degree (n-k).
Property 2 : Any multiple of generator polynomial g(X) is a
codeword polynomial.
C(X) = a(X) g(X) ;
where a(X) is a polynomial in X.
Property 3 : The generator polynomial g(X) of an (n,k) cyclic
code is a factor of the polynomial 1 + Xn.
1 + Xn = g(X) h(X)
where h(X) is a parity check polynomial.
For (7,4) cyclic code, we have
1 + X7 = (1 + X) (1 + X + X3) (1 + X2 + X3)
Let us select g(X) = 1 + X + X3
Then h(X) = (1 + X) (1 + X2 + X3) = 1 + X + X2 + X4
Property 4 : if g(X) is a polynomial of degree (n-k) and is a factor
of (1 + Xn ), then g(X) generates an (n,k) cyclic code.

Code Generation
(1) Nonsystematic codes :
C(X) = m(X) g(X)
where m(X) = m0 + m1X + m2X2 +…………+ mk-1Xk-1 is a

message polynomial of message sequence( m0 m1 m2 ……mk-1 ),


and g(X) is generator polynomial.
There are 2k codewords in an (n,k) code.
This method of code generation by multiplying m(X) by g(X) will
generate Nonsystematic codes.
(2) Systematic Code generation : To generate a systematic cyclic
code of the structure
[ b0 b1……bn-k-1 m0 m1…………..mk-1 ]
(n-k) parity bits k message bits

Three steps are involved :


(1)Multiply the message polynomial m(X) by Xn-k.
(2)Divide the product Xn-k * m(X) by the generator polynomial
g(X) obtaining the remainder b(X).
(3)Add b(X) to Xn-k * m(X), to obtain codeword polynomial C(X).
Encoder :
Operation of Encoder :

1.The gate is switched on and k message bits are shifted into the
shift register and simultaneously into the channel. As soon
as, k message bits are entered the shift register, the resulting (n-
k) bits in the register form the parity bits.
2.The gate is switched off there by breaking the feedback
connections.
3.The contents of the shift register are shifted out into the
channel.
Parity check polynomial : An (n,k) cyclic code is uniquely specified by
its generator polynomial g(X) of degree (n-k).
Such a code is also uniquely specified by another polynomial of degree

k , which is called Parity check polynomial h(X).


It is equivalent representation of parity check matrix H.
Similar to HGT = O ; in cyclic code we have h(X) g(X) = O
Accordingly; h(X) C(X) = O

Property : The generator polynomial g(X) and the parity check polynomial
h(X) are factors of the polynomial Xn+1.
For (7,4) cyclic code, we have
X +1 = h(X) g(X)
n
1 + X7 = (1 + X) (1 + X + X3) (1 + X2 + X3)
Let us select g(X) = 1 + X + X 3
Then h(X) = (1 + X) (1 + X2 + X3) = 1 + X + X2 + X4
Calculation of Syndrome
Let the received word be W = [ w0 w1 w2………….wn-1 ].
In LBC, Syndrome s = WHT, if syndrome is zero, received
vector W is valid codeword. If not, received vector W is invalid
and presence of error is detected.

For systematic cyclic code, syndrome is computed as below.


The received word be W is written as a polynomial of degree
(n-1) or less as W(X) = w0 + w1X + w2X2 +………..+ wn-1Xn-1

Divide W(X) by the generator polynomial g(X), we obtain


W(X) = a(X) g(X) + s(X),
where a(X) is quotient and the remainder is s(X).
The remainder s(X) is a polynomial of degree (n-k-1) or less is
known as syndrome polynomial .
The (n-k) coefficients of s(X) form the syndrome s.

The presence of error in the received vector is detected if


syndrome polynomial is nonzero.

Syndrome Calculator Circuit


The syndrome calculator is identical to encoder except that the
received bits are fed into (n-k) stages of the feedback shift
register from the left end.
As soon as, all the received vector bits are shifted into the shift
register, its contents define the desired syndrome s
Once we know s, we can determine corresponding error pattern
e, and there by make the error correction by adding e to W to
get the correct codeword C.
To obtain G in systematic form from g(X) :
consider (7,4) cyclic code generated by g(X) = 1+ X+X3.
Obtain Xg(X),X2g(X),X3g(X)
Therefore, we have
g(X) = 1+ X+X3 Xg(X) = X+ X2+X4
X2g(X) = X2+ X3+X5 X3g(X) = X3+ X4+X6
The coefficeints of these polynomials are used to form (k x n)
generator matrix G as

Which is not in systematic form. By adding first row to third


row and adding the sum of first two rows to the fourth row, we
get
To obtain G in systematic form directly from g(X) :
consider (7,4) cyclic code generated by g(X) = 1+ X+X3.
Dividing X3, X4, X5 and X6 by g(X), we get
X3 = g(X)+(1+X)
X4 = Xg(X)+(X+X2)
X5 = (X2+1)g(X)+(1+X+X2)
X6 = (X3+X+1)g(X)+(1+X2)
Rearranging the above equations, we get four polynomials
g(X) = 1+X+ X3
Xg(X) = (X+X2)+ X4
(X2+1)g(X) = (1+X+X2)+ X5
(X3+X+1)g(X) = (1+X2)+ X6
Taking these four polynomial coefficients as rows of (4x7)
matrix, we obtain G in systematic form
To obtain H in systematic form from h(X): for (7,4) cyclic code
If h(X) = 1+X+X2+X4 then h(X-1) = 1+X-1+X-2+X-4
The reciprocal of h(X) is Xkh(X-1)
i.e., X4h(X-1) = X4(1+X-1+X-2+X-4) = 1+X2+X3+X4
Obtain Xkh(X-1) and its cyclic versions Xk+1h(X-1), Xk+2h(X-1)…
………… Xn-1h(X-1) .
Their coefficients form the rows of [(n-k) x n] H matrix.

X4h(X-1) = X4(1+X-1+X-2+X-4) = 1+X2+X3+X4


X5h(X-1) = X5(1+X-1+X-2+X-4) = X+X3+X4+X5
X6h(X-1) = X6(1+X-1+X-2+X-4) = X2+X4+X5+X6
The H matrix is H =

This is not in systematic form, to make it systematic add third


row to first row obtaining

H=
PROBLEM ON HAMMING CODE

i) Find the Non-systematic and systematic (7, 4)


cyclic codeword for the message 1001.
ii)Draw the encoder and indicate the contents of
the shift register for the message.
iii)Obtain the syndrome polynomial for the
received vector 0110001. Is it a valid code
vector. If not, get the correct codeword.
iv)Draw the syndrome calculator and indicate the
contents of the shift register for the received
NON-SYSTEMATIC CYCLIC CODE GENERATION
i) Message bits are 1 0 0 1
The message polynomial is 1 + X3
For (7,4) cyclic code, we have
1 + X7 = (1 + X) (1 + X + X3) (1 + X2 +
X3)
Let us select g(X) = 1 + X + X3
Then h(X) = 1 + X + X2 + X4
Non-systematic Codeword C(X) = m(x) g(X)
= ( 1 + X3 ) ( 1 +
X + X3 )
= 1 + X + X 3 + X3
SYSTEMATIC CYCLIC CODE GENERATION

i)

and g(X) = 1 + X + X3

Remainder b(X) =
ii)
iii) SYNDROME CACULATION
The received vector is
0110001
Then, the received
vector polynomial is X
+=X1+X+X
h(X)
2
+ X62+X4

X4h(X-1) = 1+X2+X3+X4
X5h(X-1) = X+X3+X4+X5
X6h(X-1) = X2+X4+X5+X6

H=

S = [110 ] H = e=[0001000]

correct codeword is C = W + e = 0 1 1 0 0 0 1 + 0 0 0 1 0
C=0111001
iv)
Some important cyclic codes

(a)Cyclic redundancy check codes (CRC Codes)


(b)Maximum Length codes (ML Codes)
(c)Golay Codes
(d)Bose – Chaudhuri – Hoequenqhem Codes (BCH Codes)
(e)Reed-Solomon Codes (RS Codes)
Other Problems

1. The generated polynomial for a (7,4) cyclic code is given by G(p)=1+P+P 3


Determine the Non-systematic codeword if message signal is 1011,1100.

2. The generated polynomial for a (7,4) cyclic hamming code is given by


G(p)=1+P+P3 Determine the systematic codeword if message signal is 1011.
END OF CYCLIC CODES

30

You might also like