You are on page 1of 21

4.

1 Linear block codes


4.2 General properties of Linear Block Codes
4.3 Decoding of linear block codes
4.4 Cyclic Codes
4.5 Systematic cyclic codes
4.6 Encoders for cyclic codes
4.7 Decoding for cyclic codes
4.8 Convolutional Codes
4.9 Decoding of convolutional codes
4.10 Turbo Codes

1
Cyclic Code
Cyclic Codes

• Hamming code is useful but there exist codes that


offers same (if not larger) error control capabilities
while can be implemented much simpler.
• Cyclic code is a linear code that any cyclic shift of a
codeword is still a codeword.
• Makes encoding/decoding much simpler, no need of
matrix multiplication.
• Makes use of shift registers to generate cyclic codes
A code C is cyclic if
BASIC
DEFINITI
(i) C is a linear code; sum of
ON AND two codewords results in a
EXAMPL codeword.
ES (ii) any cyclic shift of a
codeword is also a codeword,
i.e. whenever a0,… an -1 Î C,
then also an -1 a0 … an –2 Î C.
Properties of cyclic codes

• Cyclic codes are a sub part of Linear Block codes.


• The basic properties of the cyclic codes are:
• 1. Linearity Property:
• If there are two codewords ci and cj then cp=ci+cj
should be another codeword
• 2. Cyclic Shift Property:
• If there are codewords like c1, c2, c3…. Then a cyclic
shift left or right will result in another codeword.

5
◦The code with the generator matrix
1 0 1 1 1 0 0
 
G  0 1 0 1 1 1 0
0 0 1 0 1 1 1
 
◦has codewords
◦ c1 = 1011100 c2 = 0101110 c3 =0010111
◦ c1 + c2 = 1110010 c1 + c3 = 1001011 c2 + c3 = 0111001
◦c1 + c2 + c3 = 1100101
◦and it is cyclic because the right shifts have the following impacts
◦ c1 ® c2, c2 ® c3, c3 ® c1 + c3
◦ c1 + c2 ® c2 + c3, c1 + c3 ® c1 + c2 + c3, c2 + c3 ® c1
◦c1 + c2 + c3 ® c1 + c2
6
Example

• Given a codeword set as : 0000, 0110, 1001, 1111. Check whether it is


cyclic code or not.

• Given a codeword set as : 0000, 0101, 1010, 1111. Check whether it is


cyclic code or not.

7
Codeword Polynomial

• Polynomial representation of cyclic codes.


C(x) = Cn-1xn-1 + Cn-2xn-2 + … + C1x1 + C0x0 ,
where, the coefficients may be{0,1}.
• That is, if the codeword is (1010011) (c6 first, c0 last),
we write it as x6 + x4 + x + 1.
• What will be the polynomial for the codeword 0100110?
• What will be the codeword for x3 + x2 + x + 1?
Generator Polynomial

• Generator polynomial for cyclic code is G(x):


• Code word polynomial c(x)= M(x). G(x)
• M(x)= message signal polynomial of degree <=k
• G(x) is the generator polynomial of degree (n-k)

9
• Addition and subtraction of
polynomials – Done by doing binary
addition or subtraction on each bit
individually, no carry and no
borrow.
• Division and multiplication of
polynomials.
• Find the value of p1(x). p2(x) if p1 (x)=
x3 + x2 + x + 1 and p2 (x)= x4 + x
+1

• Find the value of p1(x)+ p2(x)

• Try divide x3 + x2 + x + 1 by x + 1.10


11
• Try divide x3 + x2 + x + 1 by x + 1.

12
13

Cyclic Systematic
codes can cyclic code
be of two
types Non
systematic
cyclic code
Generation of non-systematic cyclic code
vectors
• To generate codeword C(x)= M(x). G(x)
• Multiplication of the message polynomial with the
generator polynomial
• Example: for a (7,4) cyclic code the message= 0101 and
G(x)= x3+ x+1
• Systematic Code C(x)=?
• M(x)= x2+1 for message 0101
• C(x)= (x2+1).(x3+ x+1)= x5+x3+ x2 +x3 +x+1= x5+ x2 +x+1
• C=0100111
• Code vector: ?
14
Example

• A (7,4) cyclic code with g(x) = x3 + x + 1.


• If m(x) = x3 + 1,
• C(x) = x6 + x4 + x3 + x3 +x + 1 = x6 + x4 + x + 1.
• C=1010011
Systematic Cyclic Code
• A (7,4) cyclic code with g(x) = x3 + x + 1.
• If m(x) = x3 + 1, systematic code vector?
• The process to get systematic code is:
• 1.Multiply the message polynomial with x (n-k)
m(x). x (n-k)
(x3 + 1). x (7-4)= x6+x3
• 2. Divide the m(x). x (n-k) By G(x)
• Remainder=x2+x
• 3. Add the remainder to m(x). x (n-k) to get C(x)
• C(x)= x6+x3 + x2+x
16
• Generate the systematic and non systematic code
vectors for a G(x)= x4+x3+1 for a (10,6) cyclic code, Let
m=001101
• Generate (7,4) systematic and non-systematic cyclic
code is given as: x3+ x2 +x+1; let message be 1110

17
Generator matrix of a Systematic cyclic
code
• Generator Matrix [G(x)]= [Ik | P]
• I =Identity Matrix
• P= Parity Matrix
• For a (n,k) code, the matrix G(x) has n columns and k rows
• Each row of the P matrix is given as:
• Ist Row= Rem [ xn-1/ G(x)]
• IInd Row= Rem [ xn-2/ G(x)]
• IIIrd Row= Rem [ xn-3/ G(x)]

• Kth Row= Rem [ xn-k/ G(x)]


18
• If the generator polynomial of a (7,4) cyclic code is given as: x3+ x2 +x+1;
construct the generator matrix.
• G=[Ik:P]; k=4;n=7

• Row 1 of P: Rem x6/ x3+ x2 +x+1 x2


• Row 2 of P: Rem x5/ x3+ x2 +x+1 x
1
• Row 3 of P: Rem x4/ x3+ x2 +x+1
x2 +x+1
• Row 4 of P: Rem x3/ x3+ x2 +x+1

19
Example
If the generator polynomial of a (7,4) cyclic code is given as: x 3+ x+1; construct
the generator matrix.

• If the generator polynomial of a (7,4) cyclic code is


given as: x3+x+1; construct the generator matrix
• K=4; n=7

20
Thank you

You might also like