0% found this document useful (0 votes)
48 views

Error control coding

DC

Uploaded by

Kishor Gowda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Error control coding

DC

Uploaded by

Kishor Gowda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

0.1.

Linear Block Codes

Notation
In digital communication message is usually represented by binary codes, which consists only of binary
symbols 0 and 1. In such a code, the encoding and decoding functions involve the binary arithmetic
operations of modulo-2 addition and multiplication. The ordinary plus sign (+) is used to denote modulo-
2 addition. The rules for modulo-2 addition and modulo-2 multiplication are as follows:

Modulo-2 addition Modulo-2 multiplication


0+0=0 0×0=0
0+1=1 0×1=0
1+0=1 1×0=0
1+1=0 1×1=1

0.1 Linear Block Codes


• A code is said to be linear if any two codewords in the code can be added in modulo-2
arithmetic to produce a third codeword in the code.

0.1.1 Matrix description of Linear Block Codes


Consider, an (n, k) linear block code, in which k bits of the n code bits are message bits. The remaining
(n − k) bits are computed from the message bits in accordance with a prescribed encoding rule. These
(n − k) bits are referred to as parity-check bits. Block codes in which the message bits are transmitted in
unaltered form are called systematic codes.
Let [D] = d1 , d2 , . . . dk constitute a block of k arbitrary message bits. Then, there are 2k distinct
message blocks. Let this sequence of message bits be applied to a linear block encoder, producing an n-bit
codeword whose elements are denoted by

[C] = {c1 , c2 , . . . cn }

Message vector Code vector


m Generator c
Matrix
G

In a systematic linear block codes, the message bits of a codeword appears before the parity-check bits,
or vice versa. The remaining (n − k) parity-check bits in the codeword. By combining the message bits
and parity-check bits and expressed as a codeword which is as follows:

[C] = c1 , c2 , . . . ck ck+1 , ck+2 , . . . cn

The remaining (n − k) parity-check bits ck+1 , ck+2 , . . . cn are generated from k message bits using a
predetermined rule

ck+1 = P11 d1 + P21 d2 +, . . . + Pk1 dk


ck+2 = P12 d1 + P22 d2 +, . . . + Pk2 dk
.. . . .
. = .. + .. + , . . . + ..
cn = P1,n−k d1 + P2,n−k d2 +, . . . + Pk,n−k dk

 
1 0 0 . . . 0 P11 P12 . . . P1,n−k
 0 1 0 . . . 0 P21 P22 . . . P2,n−k 
[c1 , c2 , . . . ck , ck+1 ck+2 . . . cn ] = [d1 , d2 , dk ]  .. .. .. .
 
. . . ..

 . . . ... 
0 0 0 . . . 1 Pk1 Pk2 . . . Pk,n−k
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 1
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 1
0.1. Linear Block Codes

[C] = [D][G]
where [G] is called as generator matrix and is expressed as:
.
[G] = [Ik ..P ]k×n

where Ik is unity matrix of order k and P is called parity matrix of order k × (n − k)

d1 , d 2 ,...d k b1 , b2 ,...bn  k
Message bits Parity-check bits
k bits n  k bits
n bits
c1 , c2 ,........ ck ck 1ck  2 ......... cn

Figure 1: Structure of systematic codeword.

Let b0 , b1 , . . . bn−k−1 denote the (n − k) parity-check bits in the codeword. For the code to possess a
systematic structure, a codeword is divided into two parts, one of which is occupied by the message bits
and the other by the parity-check bits.
Clearly, we have the option of sending the message bits of a codeword before the parity-check bits, or
vice versa. The former option is illustrated in Figure 10.4, and its use is assumed in the following.

b0 , b1 ,...bn  k 1 m0 , m1 ,...mk 1
Parity-check bits Message bits

Figure 2: Structure of systematic codeword.

or

m0 , m1 ,...mk 1 b0 , b1 ,...bn  k 1
Message bits Parity-check bits
k bits n  k bits
n bits
Figure 3: Structure of systematic codeword.


bi i = 0, 1, . . . n − k − 1
ci =
mi+k−n i=n−k,n−k+1,...n−1
this set of probabilities must satisfy the normalization property

bi = p0i m0 + p1i m1 + . . . + pk−1,i mk−1


where the coefficients are defined as follows:

1 if bi depends on mj
pij =
0 otherwise

m = [m0 , m1 , . . . mk−1 ]
b = [b0 , b1 , . . . bn−k−1 ]
c = [c0 , c1 , . . . cn−1 ]
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 2
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 2
0.1. Linear Block Codes

 
P00 P01 ... P0,n−k−1
 P10 P11 ... P1,n−k−1 
P = .. .. .. ..
 

 . . . . 
Pk−1,0 Pk−1,1 . . . Pk−1,n−k−1
where the element pij is 0 or 1.
The codeword c may be expressed as a partitioned row vector in terms of the vectors m and b as
follows:
..
 
c= b.m

or
.
 
c = m .. b

factoring out the common message vector m


.
 
c = m P .. Ik

or
.
 
c = m Ik .. P

where
 
1 0 ··· 0
 0 1 ··· 0 
Ik =  .. .. . . .. 
 
 . . . . 
0 0 ··· 1
Define the k-by-n generator matrix
.
 
G = P .. Ik

or
.
 
G = Ik .. P

The generator matrix G is


c = mG
The sum of any two codewords in the code is another codeword. This basic property of linear block
codes is called closure. Consider a pair of code vectors ci and cj corresponding to a pair of message vectors
mi and mj , respectively, then the sum of ci and cj is:

ci + cj = mi G + mj G
= (mi + mj )G

The modulo-2 sum of mi and mj represents a new message vector. Correspondingly, the modulo-2 sum of
ci and cj represents a new code vector.
The message bits and parity-check bits are expressed in another form which is a linear block code. Let
H denote an (n − k)-by-n matrix, defined as

.. T
 
H = In−k . P

or
.
 
H = P T .. In−k

where P T is an (n − k)-by-k matrix, representing the transpose of the coefficient matrix P , and In−k is
the (n − k)-by-(n − k) identity matrix.
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 3
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 3
0.1. Linear Block Codes

 
1 0 0 ... 0 P11 P12 . . . P1,n−k
.  0 1 0 ... 0 P21 P22 . . . P2,n−k 
[G] = [Ik ..P ]  .. .. .. .
 
. . . ..

 . . . ... 
0 0 0 ... 1 Pk1 Pk2 . . . Pk,n−k
..
 
H = PT . In−k

 
P11 P21 ... Pk1 1 0 0
... 0
 P12 P22 ... Pk2 0 1 0
... 0 
[H] =  .. .. .. ..
 

 . . ... . ... . 
P1,n−k P2,n−k . . . Pk,n−k 0 0 0 ... 1

 
T
 T
 Ik
HG = P In−k
PT
= PT + PT
= 0

cH T = mGH T
= 0

The matrix H is called the parity-check matrix of the code and the above equation is mentioned as
parity-check equations.

Code vector Null vector


c Parity check 0
Matrix
H

Figure 4: Block diagram of the parity-check equation

0.1.2 Syndrome: Definition and Properties


The generator matrix G is used in the encoding operation at the transmitter. At the receiver the parity-
check matrix H is used in the decoding operation. Let r denote the 1 − by − n received vector that results
from sending the code vector c over a noisy binary channel. The vector r as the sum of the original code
vector c and a new vector e, as shown by
r =c+e
The vector e is called the error vector. The ith element of e equals 0 if the corresponding element of r
is the same as that of c. On the other hand, the ith element of eequals 1 if the corresponding element of
r is different from that of c, in which case an error is said to have occurred in the ith location. That is,
for i = 1, 2 . . . m, n, we have

1 if an error has occurred in the ith location
ei =
0 otherwise
The receiver has to decode the code vector c from the received vector r. The algorithm commonly
used to perform this decoding operation starts with the computation of a 1 − by − (n − k) vector called
the error-syndrome vector or simply the syndrome.
Given a 1 − by − n received vector r, the corresponding syndrome is formally defined as
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 4
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 4
0.1. Linear Block Codes

s = rH T
The syndrome depends only on the error pattern and not on the transmitted codeword.

s = rH T
= (c + e)H T
= cH T + eH T
= eH T

Minimum Distance Considerations


Consider a pair of code vectors c1 and c2 that have the same number of elements. The Hamming distance,
denoted by d(c1 , c2 ), between such a pair of code vectors is defined as the number of locations in which
their respective elements differ.
The Hamming weight w(c) of a code vector c is defined as the number of nonzero elements in the code
vector. The Hamming weight of a code vector is the distance between the code vector and the all-zero code
vector. The minimum distance dmin of a linear block code is the smallest Hamming distance
between any pair of codewords.
The minimum distance of a linear block code is the smallest Hamming weight of the
nonzero code vectors in the code.
The minimum distance of a linear block code is defined by the minimum number of rows
of the matrix H T whose sum is equal to the zero vector.

Error-correcting capability of the code

dmin ≥ 2t + 1

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 5


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 5
0.1. Linear Block Codes

2020 Jan 7 b. The parity check bits of a (7,4) Hamming code, are generated by

c 5 = d1 + d3 + d4
c 6 = d1 + d2 + d3
c 7 = d2 + d3 + d4

where d1 , d2 , d3 , d4 are the message bits.


(i) Find the generator matrix [G] and parity check matrix [H] for this code

(ii) Prove that GH T = 0

(iii) The (n,k) linear block code so obtained has a ’dual’ code. This dual code is a (n, n-k) code having
a generator matrix H and parity check matrix G. Determine the eight code vectors of the dual code
for the (7,4) Hamming code describe above.

(iv) Find the minimum distance of the dual code determined in part (c).

Solution:
n=7 and k=4
It is a 4 × 7 matrix in which 4 × 4 identity matrix
Message bits are d1 , d2 , d3 , d4 and code bits are arranged as c1 = d1 , c2 = d2 , c3 = d3 , c4 = d4 , c5 =
d1 + d3 + d4 c 6 = d1 + d2 + d3 , c 7 = d2 + d3 + d4 ,

[C] = [c1 , c2 , c3 , c4 , c5 , c6 , c7 ]
= [d1 , d2 , d3 , d4 , (d1 + d3 + d4 ), (d1 + d2 + d3 ), (d2 + d3 + d4 )]
 
1 0 0 0| 1 1 0
 0 1 0 0| 0 1 1 
= [d1 , d2 , d3 , d4 ] 
 0 0 1 0| 1 1 1 

0 0 0 1| 1 0 1
= [D][G]

The generator matrix [G] IS  


1 0 0 0| 1 1 0
 0 1 0 0| 0 1 1 
G = [I|P ] = 
 0

0 1 0| 1 1 1 
0 0 0 1| 1 0 1
The parity check matrix H is H = [P T |In−k ] = [P T |I3 ]
 
1 0 1 0| 1 0 0
H = [P T |I3 ] =  1 1 1 0| 0 1 0 
0 1 1 1| 0 0 1

ii) Prove that GH T = 0

1 1 0
 
  0 1 1   
1 0 0 0 1 1 0   0 0 0
 1 1 1 
0 1 0 0 0 1 1  0 0 0 
[G][H T ] = 
   
 0
 1 0 1 = 
0 1 0 1 1 1    0 0 0 
 1 0 0 
0 0 0 1 1 0 1   0 0 0
 0 1 0 
0 0 1

′ ′ ′
The dual code is n, n − k = 7, 3 with message bits as d1 , d2 , d3
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 6
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 6
0.1. Linear Block Codes

 
1 0 1 1 1 0 0
′ ′ ′ ′ ′ ′
[c] = [d1 , d2 , d3 ][H] = [d1 , d2 , d3 ]  1 1 1 0 0 1 0 
0 1 1 1 0 0 1

Message Code vector Weight


1 000 0000000 0
2 001 0111001 4
3 010 1110010 4
4 011 1001011 4
5 100 1011100 4
6 101 1100101 4
7 110 0101110 4
8 111 0010111 4

By observing the dual code vector the minimum distance minimum number of ones it is four Hence
dmin = Hmin = 4

Jan-2020-CBCS 8-a For a systematic (6,3) linear block code, the parity matrix P is given by
 
1 0 1
 0 1 1 
1 1 0

i) Find all possible code words. ii) Find error detecting and correcting capability.

(06 Marks)

Solution:
n=6 and k=3
There are 23 = 8 message vectors given by u=[000, 001, 010, 011, 100, 101, 110, 111]
The code vectors V are estimated using generator matrix G which is in the form of

[C] = [D][G]

where

[G] = [Ik |P ]
 
1 0 0| 1 0 1
=  0 1 0| 0 1 1 
0 0 1| 1 1 0

[C] = [D][G]
= [d1 , d2 , d3 ][G]
 
1 0 0| 1 0 1
= [d1 , d2 , d3 ]  0 1 0| 0 1 1 
0 0 1| 1 1 0
= [d1 , d2 , d3 , (d1 , +d3 ), (d2 + d3 ), (d1 + d2 )]

Consider a message (d1 , d2 , d3 ) = (0 0 1) then its Code vector is [C]=[001110]


ii) Find error detecting and correcting capability.

dmin = 2

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 7


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 7
0.1. Linear Block Codes

Message Code vector Weight


1 000 000000 0
2 001 001110 3
3 010 010011 3
4 011 011101 4
5 100 100101 3
6 101 101011 4
7 110 110110 4
8 111 111000 3

Error detecting capability is


dmin − 1 = 2 − 1 = 1
2019-DEC-CBCS 8-b Consider a (6,3) Linea Block Code (LBC) with generator matrix
 
1 0 0 1 1 1
 0 1 0 1 1 0 
0 0 1 1 0 1
Find

i) All code words.

ii) All Hamming weights.

iii) Minimum Hamming weight

iv) Parity Check Matrix (PCM)

v) Draw the encoder circuit

(10 Marks)

Solution:
n=6 and k=3, n-k=6-3=3
There are 23 = 8 message vectors given by u=[000, 001, 010, 011, 100, 101, 110, 111]
The code vectors V are estimated using generator matrix G which is in the form of

[C] = [D][G]

where

[G] = [Ik |P ]
 
1 0 0| 1 1 1
=  0 1 0| 1 1 0 
0 0 1| 1 0 1

[C] = [D][G]
= [d1 , d2 , d3 ][G]
 
1 0 0| 1 1 1
= [d1 , d2 , d3 ]  0 1 0| 1 1 0 
0 0 1| 1 0 1
= [d1 , d2 , d3 , (d1 + d2 + d3 ), (d1 + d2 )(d1 + d3 )]

Consider a message (d1 , d2 , d3 ) = (0 0 1) then its Code vector is [C]=[001101]


iii) Minimum Hamming weight is 2
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 8
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 8
0.1. Linear Block Codes

Message Code vector Hamming Weight


1 000 000000 0
2 001 001101 3
3 010 010110 3
4 011 011011 4
5 100 100111 4
6 101 101010 3
7 110 110001 3
8 111 111100 4

iv) Parity check matrix

[G] = [Ik |P ]
 
1 0 0| 1 1 1
=  0 1 0| 1 1 0 
0 0 1| 1 0 1

Parity check matrix H is expressed as

[H] = [P T |In−k ]

[H] = [P T |In−k ]
 
1 1 1| 1 0 0
=  1 1 0| 0 1 0 
1 0 1| 0 0 1

d1

d2
Input
d1 d2 d3 d3
Message

Commutator

To Channel
+ + + (d1+d2+d3)
(d1+d2)
(d1+d3)

Figure 5: Encoder circuit

Jan-2019-CBCS 7-a For a (6,3) code find all possible code vectors, if the coefficient matrix P is given by
 
1 1 0
 0 1 1 
1 0 1

i) Find code vectors.

ii) Implement the encoder

iii) Find the syndrome vector S


Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 9
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 9
0.1. Linear Block Codes

iv) Implement the syndrome circuit

(08 Marks)

Solution:
n=6 and k=3
There are 23 = 8 message vectors given by u=[000, 001, 010, 011, 100, 101, 110, 111]
The code vectors V are estimated using generator matrix G which is in the form of

[C] = [D][G]

where

[G] = [Ik |P ]
 
1 0 0| 1 1 0
=  0 1 0| 0 1 1 
0 0 1| 1 0 0

[C] = [D][G]
= [d1 , d2 , d3 ][G]
 
1 0 0| 1 1 0
= [d1 , d2 , d3 ]  0 1 0| 0 1 1 
0 0 1| 1 0 1
= [d1 , d2 , d3 , (d1 + d3 ), (d1 + d2 )(d2 + d3 )]

Consider a message (d1 , d2 , d3 ) = (0 0 1) then its Code vector is [C]=[001101]

Message Code vector Weight


1 000 000000 0
2 001 001101 3
3 010 010011 3
4 011 011110 4
5 100 100110 3
6 101 101011 4
7 110 110101 4
8 111 111000 3

ii) Implement the encoder


d1

d2
Input
d1 d2 d3 d3
Message

Commutator

To Channel
+ + + (d1+d3)
(d1+d2)
(d2+d3)

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 10


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 10
0.1. Linear Block Codes

Figure 6: Encoder-LBC-2019-Jan
iii) Find the syndrome vector S
Parity check matrix H is expressed as

[H] = [P T |In−k ]

[H] = [P T |In−k ]
 
1 0 1| 1 0 0
=  1 1 0| 0 1 0 
0 1 0| 0 0 1

iv) Implement the syndrome circuit

S = RH T
 
P
HT =  − 
In−k

1 1 0
 
 0 1 1 
 
 1 0 0 
T
 
H = − − −


 1 0 0 
 
 0 1 0 
0 0 1

S = RH T
1 1 0
 

 0 1 1 

 1 0 0 
= [r1 r2 r3 r4 r5 r6 ]  

 1 0 0 

 0 1 0 
0 0 1
= [s1 s2 s3 ]
= [(r1 + r3 + r4 ), (r1 + r2 + r5 ), (r2 + r6 )]

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 11


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 11
0.1. Linear Block Codes

Received
r1 r2 r3 r4 r5 r6
Vector

+ + +
S0 S1 S2
(r1+r3+r4) (r2+r6)
(r1+r2+r5)
Figure 7: Syndrome-LBC-2019-Jan

Feb-2022-CBCS 7-a 2017 2010 scheme For a systematic (7,4) linear block code the parity matrix P is given
by  
1 1 1
 1 1 0 
 
 1 0 1 
0 1 1
i) Find all possible code vectors.
ii) Draw the encoding circuit.
iii) A single error has occurred in the received vector R=[1011100]. Detect the error.
iii) Draw the syndrome calculation circuit.
(10 Marks)

Solution:
n = 7 and k = 4
The code vectors are estimated using generator matrix G which is in the form of

[C] = [D][G]
where
[G] = [Ik |P ]
 
1 0 0 0 | 1 1 1
 0 1 0 0 | 1 1 0 
= 
 0 0

1 0 | 1 0 1 
0 0 0 1 | 0 1 1
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 12
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 12
0.1. Linear Block Codes

[C] = [D][G]
= [d1 , d2 , d3 , d4 ][G]
 
1 0 0 0 | 1 1 1
 0 1 0 0 | 1 1 0 
= [d1 , d2 , d3 , d4 ] 
 0 0 1 0 | 1 0 1 

0 0 0 1 | 0 1 1
= [d1 , d2 , d3 , , d4 , (d1 + d2 + d3 ), (d1 + d2 + d4 )(d1 + d3 + d4 )]

Sl Message Code vector Weight


1 0000 0000000 0
2 0001 0001011 3
3 0010 0010101 3
4 0011 0011110 4
5 0100 0100110 3
6 0101 0101101 4
7 0110 0110011 4
8 0111 0111000 3
9 1000 1000111 4
10 1001 1001100 3
11 1010 1010010 3
12 1011 1011001 4
13 1100 1100001 3
14 1101 1101010 4
15 1110 1110100 4
16 1111 1111111 7

c1
c2
c3
Input
d1 d2 d3 d4 c4
Message

Commutator

c5
To Channel
+ + + (d1+d2+d3)
(d1+d2+d4) c6
(d1+d3+d4)
c7

Figure 8: Feb-2022-CBCS 7-a

S = RH T
 
P
HT =  − 
In−k
1 1 1
 
 1 1 0 
 
 1 0 1 
 
T
 0 1 1 
H = − − −


 
 1 0 0 
 
 0 1 0 
0 0 1
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 13
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 13
0.1. Linear Block Codes

1 1 1
 

 1 1 0 

 1 0 1 
T
 
S = RH = [1 0 1 1 1 0 0] 
 0 1 1 


 1 0 0 

 0 1 0 
0 0 1

[S] = [S1 , S2 , S3 ] = [1 0 1]

Syndrome bits are [1 0 1] which is presented in 3rd row of H T it indicates the error occurred in the 3rd
position of the vector counting from lest side of the received data. The received data is [1 0 1 1 1 0 0] in
which 3rd position bit is 1 which has to be changed as 0. The corrected vector is [1 0 0 1 1 0 0].

1 1 1
 

 1 1 0 

 1 0 1 
T
 
S = RH = [r1 , r2 , r3 , r4 , r5 , r6 , r7 ] 
 0 1 1 


 1 0 0 

 0 1 0 
0 0 1

[S] = [(r1 + r2 + r3 + r5 ), (r1 + r2 + r4 + r6 ), (r1 + r3 + r4 + r7 )]

Received
r7 r6 r5 r4 r3 r2 r1
Vector

+ + +
S3 S2 S1
(r1+r3+r4+r7) (r1+r2+r3+r5)
(r1+r2+r4+r6)

Figure 9: Feb-2022-CBCS 7-a

A (6,3) linear block code with a parity matrix is as shown. The received code vector R = [1 1 0 0 1 0] is
given. Detect & correct the single error that has occurred due to noise
 
1 0 1
 0 1 1 
1 1 0

Solution:

H = [P T |In−k ]
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 14
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 14
0.1. Linear Block Codes

 
1 0 1 | 1 0 0
H= 0 1 1 | 0 1 0 
1 1 0 | 0 0 1

S = RH T
 
P
HT =  − 
In−k

1 0 1
 
 0 1 1 
 
 1 1 0 
T
 
H = − − −


 1 0 0 
 
 0 1 0 
0 0 1

1 0 1
 

 0 1 1 

 1 0 0 
T
 
S = RH = [1 1 0 0 1 0] 
 − − − 


 1 0 0 

 0 1 0 
0 0 1

S1 = 1 + 0 + 0 + 0 + 0 + 0 = 1
S2 = 0 + 0 + 0 + 0 + 0 + 0 = 0
S3 = 1 + 1 + 0 + 0 + 0 + 0 = 0

S = [S1 , S2 , S3 ] = [1 0 0] 6= 0
Compare this syndrome bits with the rows of H T . The syndrome bit S = [1 0 0] which is present in the
4th row of H T . Hence 4th bit of the received vector counting from left is having an error. The error bit
has been identified and has to be corrected. If it is 0 it has to be changed as 1 or if it is 1 it has to be
changed as 0.
The received code vector is R = [1 1 0 0 1 0] it has to changed as R = [1 1 0 1 1 0]

Jan-2019-CBCS 7-a The parity check bits of a (8,4) linear block code is given by

C 5 = d1 + d2 + d4
C 6 = d1 + d2 + d3
C 7 = d1 + d3 + d4
C 8 = d2 + d3 + d4

i) Find generator and parity check matrix of this code

ii) Find all the code vectors.

iii) Draw the encoding and syndrome calculation circuit.

(08 Marks)

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 15


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 15
0.1. Linear Block Codes

Solution:
n = 8 and k = 4
 
1 0 0 0 | 1 1 1 0
 0 1 0 0 | 1 1 0 1 
G=
 0

0 1 0 | 0 1 1 1 
0 0 0 1 | 1 0 1 1

H = [P T |In−k ]
 
1 1 0 1 | 1 0 0 0
 1 1 1 0 | 0 1 0 0 
H=
 1

0 1 1 | 0 0 1 0 
0 1 1 1 | 0 0 0 1

[C] = [d1 , d2 , d3 , d4 , (d1 + d2 + d4 ), (d1 + d2 + d3 ), (d1 + d3 + d4 ), (d2 + d3 + d4 )]

Sl Message Code vector Weight


1 0000 00000000 0
2 0001 00011011 4
3 0010 00100111 4
4 0011 00111100 4
5 0100 01001101 4
6 0101 01010110 4
7 0110 01101010 4
8 0111 01110001 4
9 1000 10001110 4
10 1001 10010101 4
11 1010 10101001 4
12 1011 10110010 4
13 1100 11000011 4
14 1101 11011001 5
15 1110 11100101 5
16 1111 11111111 8

The minimum weight other than zero code vector is minimum weight. In this code vector minimum
weight is 4.

Error detecting capability is=dmin − 1 = 3

Jan-2019-CBCS (2015 scheme) 8-a In an LBC, the syndrome is given by

S 1 = r 1 + r2 + r 3 + r 5
S 2 = r 1 + r2 + r 4 + r 6
S 3 = r 1 + r3 + r 4 + r 7

i) Find parity check matrix H

ii) Draw the encoder circuit.

iii) Find the code vectors for all input sequences.

iii) What is the syndrome for the received data 1011011 ?


Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 16
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 16
0.1. Linear Block Codes

(08 Marks)

Solution:

1 0 1
 

 1 1 0 


 1 1 1 

T
 0 1 1 
H = 

 − − − 


 1 0 0 

 0 1 0 
0 0 1
 
1 1 1 0 | 1 0 0
H= 0 1 1 1 | 0 1 0 
1 0 1 1 | 0 0 1

H = [P T | In−k ]
G = [Ik | P ]

 
1 0 0 0 | 1 0 1
 0 1 0 0 | 1 1 0 
G=
 0

0 1 0 | 1 1 1 
0 0 0 1 | 0 1 1
n = 7 and k = 4

[C] = [D][G] = [d1 , d2 , d3 , d4 ][G]


 
1 0 0 0 | 1 0 1
 0 1 0 0 | 1 1 0 
= [d1 , d2 , d3 , d4 ] 
 0 0 1 0 | 1 1 1 

0 0 0 1 | 0 1 1
= [d1 , d2 , d3 , , d4 , (d1 + d2 + d3 ), (d2 + d3 + d4 )(d1 + d3 + d4 )]

ii)] The encoder circuit.

Sl Message Code vector Weight


1 0000 0000000 0
2 0001 0001011 3
3 0010 0010111 3
4 0011 0011100 4
5 0100 0100110 3
6 0101 0101101 4
7 0110 0110001 4
8 0111 0111010 3
9 1000 1000111 4
10 1001 1001110 3
11 1010 1010010 3
12 1011 1011001 4
13 1100 1100011 3
14 1101 1101000 4
15 1110 1110100 4
16 1111 1111111 7

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 17


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 17
0.1. Linear Block Codes

c1
c2
c3
Input
d1 d2 d3 d4 c4
Message

Commutator

c5
To Channel
+ + + (d1+d2+d3)
(d2+d3+d4) c6
(d1+d3+d4)
c7

Figure 10: 2019-15-7a-Encoder-LBC


The syndrome for the received data 1011011 is

1 0 1
 

 1 1 0 

 1 1 1 
T
 0 1 1 
S = RH = [r1 , r2 , r3 , r4 , r5 , r6 , r7 ]  

 − − − 

 1 0 0 
 0 1 0 
0 0 1
1 0 1
 

 1 1 0 


 1 1 1 

T
 0 1 1 
S = RH = [1, 0, 1, 1, 0, 1, 1]  

 − − − 

 1 0 0 

 0 1 0 
0 0 1

[S] = [(1 + 0 + 1 + 0 + 0 + 0 + 0)(0 + 0 + 1 + 1 + 0 + 1 + 0)(1 + 0 + 1 + 1 + 0 + 0 + 1)] = [0, 1, 0]

Jan-2020-CBCS 7-c Design a syndrome calculating circuit for a (7, 4) cyclic code g(X) = 1 + X + X 3 and
also calculate the syndrome of the received vector R=1110101
Solution:

Gate

g0= 1 g1 = 1 g2= 0
Input
Gate + S0 + S1 S2
Syndrome
Output

Figure 11: 2020-Jan-1c

2019-DEC-CBCS 8-b A (7,4) cyclic code has the generator g(X) = 1 + X + X 3 . Find the code vector
both in systematic and non systematic form for the message bits (1101)
Solution:

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 18


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 18
0.1. Linear Block Codes

Table 1: 5.3: Contents of the syndrome register with r=(1110101)

Shift Input Register contents


Shift Input Register contents
0 0 0 (initial state) 0 0 0
1 1 1 0 0 (first shift) 1 1 0 0
2 1 1 0 0 (second shift) 1 1 1 0
3 1 1 1 0 (third shift) 0 0 1 1
4 0 0 1 1 (fourth shift) 1 0 1 1
5 1 0 1 1 (fifth shift) 1 0 1 1
6 0 1 1 1 (sixth shift) 0 1 1 1
7 1 1 0 1 (syndrome s) 1 0 0 1
8 - 1 0 0 (syndrome s(1) )
9 - 0 1 0 (syndrome s(2) )

Gate

g0=1 g1=1
g2=0
Code
word
P0 + P1 P2 +

Message Xn-k u(X)

Parity Check digits


Figure 12: 2019-8-b

Input Register contents


0 0 0 (initial state)
1 1 1 0 (first shift)
0 0 1 1 (second shift)
1 0 0 1 (third shift)
1 0 0 0 (fourth shift)

When message bit is 1 the g0 and g1 are 1 After four shift, the contents of the register are (0 0 0) and
the codeword is (0 0 0 1 0 1 1)

2019-DEC-CBCS 8-b Draw the encoder circuit of a cycling code using (n-k) bit shift registers and explain
it.

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 19


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 19
0.1. Linear Block Codes

Gate

g0 g1 gn-k-1
g2
Code
+ + word
R0 + R1 R2 +

Message Input u(X)

R Registers
Parity Check digits

+ Modulo 2 adders

If g=1 closed path and


g0 if g-0 open path

Figure 13: Encoder circuit

2019-DEC-CBCS 8-a Explain the syndrome calculation and error detection with help of neat diagram for
cyclic codes.
2019-DEC-CBCS 8-b Consider a (15,7) binary cyclic code with g(x) = 1 + X 4 + X 6 + X 7 + X 8

i) Draw the encoder circuit


ii) Obtain the codeword for the input (00111)
iii) Draw the syndrome calculating circuit.

Solution:

Gate
g0=1 g4=1 g6=1 g7=1

R0 R1 R2 R3 + R4 R5 + R6 + R7 +

Message Input: 00111

Figure 14: Encoder circuit

Shifts Input D R0 R1 R2 R3 R4 R5 R6 R7
0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 1 0 1 1
2 1 0 1 0 0 0 1 0 1
3 1 0 0 1 0 0 0 1 0
4 0 0 0 0 1 0 0 0 1
5 0 1 0 0 0 1 0 1 1
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 20
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 20
0.1. Linear Block Codes

The code word is, the content of the register in the last shift is 10001011, hence code word is 10001011-
00111
iii) Draw the syndrome calculating circuit.

Gate
g0=1 g4=1 g6=1 g7=1

+ S0 S1 S2 S3 + S4 S5 + S6 + S7

Syndrome
Figure 15: Syndrome calculating circuit.

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 21


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 21
0.2. Cyclic Codes

0.2 Cyclic Codes


A binary code is said to be a cyclic code if it exhibits two fundamental properties:

1. Linearity Property: The sum of any two codewords in the code is also a codeword.

2. Cyclic Property: Any cyclic shift of a codeword in the code is also a codeword.

If c0 , c1 , . . . cn−1 , of a codeword then

c0 , c1 , c2 , . . . cn−2 , cn−1
cn−1 , c0 , c1 , . . . cn−3 , cn−2
cn−2 , cn−1 c0 , . . . cn−4 , cn−3
c0 , c1 , c2 , . . . cn−2 , cn−1

are all codeword

Code Polynomial
Let u = (1 0 1 0) be the message vector, then the corresponding message polynomial is u(X) = 1 + X 2 .
Let the generator polynomial is g(X) = 1 + X + X 3 .
Let c0 , c1 , , c2 . . . cn−1 , be the code C. The code polynomial of C is:

c(X) = c0 + c1 X + c2 X 2 , . . . cn−1 X n−1

where the power of X corresponds to the bit position, and the coefficients are 0s and 1s
Multiplying u(X) by g(X) results in the following code polynomial :

c(X) = u(X) × g(X)


= (1 + X 2 )(1 + X + X 3 ) = 1 + X + X 2 + X 5

The code vector is (1 1 1 0 0 1 0)

Table 2: (7,4) cyclic code generated by g(x) = 1 + X + X 3

Messages Code Code


Vectors Polynomials
(0000) (0000000) 0=0.g(x)
(1000) (1101000) 1 + X + X 3 = 1.g(x)
(0100) (0110100) X + X 2 + X 4 = X.g(x)
(1100) (1011100) 1 + X 2 + X 3 + X 4 = (1 + X).g(x)
(0010) (0011010) X 2 + X 3 + X 5 = X 2 .g(x)
(1010) (1110010) 1 + X + X 2 + X 5 = (1 + X 2 ).g(x)
(0110) (0101110) X + X 3 + X 4 + X 5 = (X + X 2 ).g(x)
(1110) (1000110) 1 + X 4 + X 5 = (1 + X + X 2 ).g(x)
(0001) (0001101) X 3 + X 4 + X 6 = X 3 .g(x)
(1001) (1100101) 1 + X + X 4 + X 6 = (1 + X 3 ).g(x)
(0101) (0111001) X + X 2 + X 3 + X 6 = (X + X 3 ).g(x)
(1101) (1010001) 1 + X 2 + X 6 = (1 + X + X 3 ).g(x)
(0011) (0010111) X 2 + X 4 + X 5 + X 6 = (X 2 + X 3 ).g(x)
(1011) (1111111) 1 + X + X 2 + X 3 + X 4 + X 5 + X 6 = (1 + X 2 + X 3 ).g(x)
(0111) (0100011) X + X 5 + X 6 = (X + X 2 + X 3 ).g(x)
(1111) (1001011) 1 + X 3 + X 5 + X 6 = (1 + X + X 2 + X 3 ).g(x)

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 22


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 22
0.2. Cyclic Codes

• Encoding in systematic form consists of three steps:

1. Step 1 Pre-multiply the message u(X) by X n−k


2. Step 2 Obtain the remainder b(X) from dividing X n−k u(X) by the generator polynomial g(X)
3. Step 3 Combine b(X) and X n−k u(X) to obtain the code polynomial b(X) + X n−k u(X)

• Consider the (7, 4) cyclic code generated by g(X) = 1 + X + X 3

• Let u(X) = 1 + X 3 1001 be the message to be encoded.

• Pre-multiply the message u(X) = 1 + X 3 by X n−k =(1 + X 3 )(X 3 ) = X 3 + X 6

• Dividing X 3 u(X) = X 3 + X 6 by g(X)

• we obtain the remainder b(X) = X + X 2

• The code polynomial is v(X) = b(X) + X 3 u(X) = X + X 2 + X 3 + X 6

• The corresponding code vector is v = (0 1 1 1 0 0 1)

x3 + x
x3 + x + 1)x6 + x3
6
x +x +x 4 3

.........................................................
x4
x4 + x2 + x
.........................................................
x2 + x

x + x2 011

• Consider an (n, k) cyclic code C with generator polynomial

g(X) = g0 + g1 X + . . . + gn−k X n−k (1)

• The k code polynomials g(X), Xg(X), . . . , X k−1 g(X) span C

• If the n-tuples corresponding to these k code polynomials are used as the rows of an k x n matrix,
then the generator matrix G is:
 
g0 g1 g2 . . . . gn−k 0 0 0 . . 0
 0 g0 g1 g2 . . . . gn−k 0 0 . . 0 
 
G =  0 0 g0 g1 g2 . . . . gn−k 0 . . 0
 

 .. 
 . 
0 0 . . . 0 g0 g1 g2 . . . . gn−k
Note: g0 = gn−k = 1
 
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
The generator matrix G′ constructed is not in systematic form. This can be changed into We into a
systematic form by adding the first row to the third row, and adding the sum of the first two rows
to the fourth row.
 
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
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 23
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 23
0.2. Cyclic Codes

These manipulations result in the desired generator matrix:

Encoding operation using generator polynomial:

• Encoding of an (n, k) cyclic code in systematic form consists of three steps:

1. Multiply the message polynomial u(X) by X n−k


2. Divide X n−k u(X) by g(X) to obtain the remainder b(X)
3. Form the code word b(X) + X n−k u(X)

• All these three steps can be accomplished with a division circuit which is a linear (n-k)-stage shift
register with feedback connections based on the generator polynomial

g(X) = 1 + g1 X + g2 X 2 + . . . + gn−k−1 X n−k−1 + X n−k (2)

Gate
Enable
g0=1 g1 g2 gn-k-1

R0 + R1 + R2 + Rn-k-1 +
Flip-flop
Parity
Modulo-2
adder
check digits

Message X n  k u ( X ) To channel

Figure 16: Encoding circuit for an (n,k) cyclic code

Encoding operation is as follows:


Step 1

• With the gate turned on, the k information digits u0 , u1 , . . . , uk−1 are shifted into the circuit and
simultaneously into the communication channel

• Shifting the message u(X) into the circuit from the front end is equivalent to premultiplying u(X)
by X n−k

• As soon as the complete message has entered the circuit, the n - k digits in the register form the
remainder and thus they are the parity-check digits.
Step 2

• Break the feedback connection by turning off the gate.


Step 3

• Shift the parity-check digits out and send them into the channel

• These n-k parity-check digits b0 , b1 , . . . , bn−k−1 , together with the k information digits, form a
complete code vector

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 24


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 24
0.2. Cyclic Codes

Example

• Consider the (7, 4) cyclic code generated by g(X) = 1 + X + X 3

• The encoding circuit based on g(X) is shown in Figure 17

• Suppose that the message u = (1 0 1 1) is to be encoded

• As the message digits are shifted into the register, the contents in the register are:

The generator polynomial is

g(X) = 1 + X + X 3
= g0 + g1 X + g2 X 2 + g3 X 3

The generator polynomial coefficients are


g0 = 1, g1 = 1, g2 = 0

Enable

Gate

g0=1 g1=1 g2=0

Code
word
R0 + R1 R2 +

g( X )  1 X  X 3
Message 1011

Parity Check
digits

Figure 17: Encoder for the (7,4) cyclic code generated by g(X) = 1 + X + X 3

1011 1 + X2 + X3 X 3 (1 + X 2 + X 3 ) = X 3 + X 5 + X 6

X3 + X2 + X + 1
X3 + X + 1)X 6 + X 5 + X 3
X6 + X4 + X3
.........................................................
X5 + X4
X5 + X3 + X2
.........................................................
X4 + X3 + X2
X4 + X2 + X
.........................................................
X3 + X
X3 + X + 1
.........................................................
1

100
After four shift, the contents of the register are (1 0 0) and the codeword is (1 0 0 1 0 1 1)

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 25


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 25
0.2. Cyclic Codes

Register contents
Shifts Input
R0 R1 R2
Initial state 0 0 0
1 1 1 1 0
2 1 1 0 1
3 0 1 0 0
4 1 1 0 0

Syndrome Computation and Error Detection


• Let r = (r0 , r1 , . . . , rn−1 ) be the received vector and due to the channel noise, the received vector
may not be the same as the transmitted code vector

• In the decoding of a linear code, the first step is to compute the syndrome s = r.H T , where H is the
parity check matrix

• If the syndrome is zero, r is a code vector and decoder accepts r as the transmitted code vector

• If the syndrome 6= 0 r is not a code vector and the presence of errors has been detected

• The received vector r is treated as a polynomial of degree n-1, or less,

r(X) = r0 + r1 X + . . . + rn−1 X n−1

• Dividing r(X) by the generator polynomial g(X), we obtain

r(X) = a(X)g(X) + s(X)

• The remainder s(X) is a polynomial of degree n-k-1 or less

• The n - k coefficients of s(X) form the syndrome s

• s(X) is identical to zero if and only if the received polynomial r(X) is a code polynomial.

• The syndrome computation can be accomplished with a division circuit as shown in Figure 18

Gate
Enable
g0=1 g1 g2 g n  k 1
r(x)
+ S0 + S1 + + Sn-k-1
Received Flip-flop Syndrome
vector Modulo-2
adder

Figure 18: Syndrome calculator for the (n,k)

Example

• A syndrome circuit for the (7, 4) cyclic code g(X) = 1 + X + X 3 is shown in Fig. 5.6

• Suppose that the received vector is r = (0 0 1 0 1 1 0)

• The syndrome of r is, s = (1 0 1)

• As the received vector is shifted into the circuit, the contents in the register are given in Table 5.3

• At the end of the seventh shift, the register contains the syndrome s = (1 0 1)

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 26


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 26
0.2. Cyclic Codes

• If the register is shifted once more with the input gate disabled, the new contents will be s(1) (X) =
(1 0 0), which is the syndrome of r(1) (X) = (0 0 0 1 0 1 1), a cyclic shift of r

 
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
 
1 0 0 1 0 1 1
H= 0 1 0 1 1 1 0 
0 0 1 0 1 1 1

1 0 0
 
 0 1 0 
 
 0 0 1 
T
 
 1
S = r.H = [0 0 1 0 1 1 0]  1 0 
 = [1 0 1]
 0 1 1 
 
 1 1 1 
1 0 1

Gate

g0=1 g1=1

Received
bits
+ S0 + S1 S2
Syndrome
3
Modulo-2 Flip-flop output
g( X )  1 X  X adder

Figure 19: Syndrome calculator for the (7,4) cyclic code generated by g(X) = 1 + X + X 3

Register contents
Shifts Input
S0 S1 S2
Initial state 0 0 0
1 0 0 0 0
2 1 1 0 0
3 1 1 1 0
4 0 0 1 1
5 1 0 1 1
6 0 1 1 1
7 0 1 0 1

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 27


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 27
0.2. Cyclic Codes

2022 FEB (18EC54) Jan 7 b. Design an encoder for a (7, 4) binary cyclic code generated by g(X) =
1 + X + X 3 and verify its operation using the message vectors (1001) and (1011)

Solution:
The encoder diagram as shown in Figure 20.

Enable
Gate

g0=1 g1=1

R0 + R1 R2 + Code
word
Message Xn-k u(X)

Parity Check
digits

Figure 20: Syndrome calculator for the (7,4) cyclic code generated by g(X) = 1 + X + X 3

Shift Input Register contents


0 0 0 (initial state)
1 1 1 1 0 (first shift)
2 0 0 1 1 (second shift)
3 0 1 1 1 (third shift)
4 1 0 1 1 (fourth shift)

The code vector is 0111001

Shift Input Register contents


0 0 0 (initial state)
1 1 1 1 0 (first shift)
2 0 0 1 1 (second shift)
3 1 0 0 1 (third shift)
4 1 0 0 0 (fourth shift)

The code vector is 0001001

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 28


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 28
0.2. Cyclic Codes

2020 FEB (2017 scheme) Jan 7 c. Design a syndrome calculating circuit for a (7, 4) cyclic code with
g(X) = 1 + X + X 3 and also calculate the syndrome of the received vectors (1110101).

Solution:
The encoder diagram as shown in Figure 20.

Gate
Enable

Received g0=1 g1=1 g2=0


bits Syndrome
+ S0 + S1 S2
output
Modulo-2 Flip-flop
adder

Figure 21: Syndrome calculator for the (7,4) cyclic code generated by g(X) = 1 + X + X 3

The generator polynomial is

g(X) = 1 + X + X 3
= g0 + g1 X + g2 X 2 + g3 X 3

The generator polynomial coefficients are


g0 = 1, g1 = 1, g2 = 0

Register contents
Shifts Input
S0 S1 S2
Initial state 0 0 0
1 1 1 0 0
2 0 0 1 0
3 1 1 0 1
4 0 1 0 0
5 1 1 1 0
6 1 1 1 1
7 1 0 0 1

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 29


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 29
0.2. Cyclic Codes

2001 Consider the (15,11) cyclic code generated by g(X) = 1 + X + X 4

(a) Draw the feedback register encoding circuit for this cyclic code. Find the code vector in systematic
form for the message D(X) = X 2 + X 3 + X 4 .

(b) Illustrate the encoding procedure with the message vector 0 1 1 0 1 0 0 1 0 1 1 by listing the states
of the register with each input.

(c) Verify the code polynomial by using the division method.

Solution:
The encoder diagram as shown in Figure 22.

Gate
Enable

g0=1 g1=1 g2=0 g3=0


R0 + R1 R2 R3 +
Flip-flop
Modulo-2
adder g(X )  1 X  X 4
Message 01101001011 To channel

Figure 22: Syndrome calculator for the (7,4) cyclic code generated by g(X) = 1 + X + X 4

Shift register contents


Number of Shifts Input
R0 R 1 R2 R3
Initial state 0 0 0 0
1 1 1 1 0 0
2 1 1 0 1 0
3 0 0 1 0 1
4 1 0 0 1 0
5 0 0 0 0 1
6 0 1 1 0 0
7 1 1 0 1 0
8 0 0 1 0 1
9 1 0 0 1 0
10 1 1 1 0 1
11 0 1 0 1 0

The content of the shift register is 1010 hence the message vector is 1010 0 1 1 0 1 0 0 1 0 1 1

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 30


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 30
0.2. Cyclic Codes

X n−k D(X) = X 4 (X + X 2 + X 4 + X 7 + X 9 + X 10 ) = X 14 + X 13 + X 11 + X 8 + X 6 + X 5

X 4 + X + 1)X 14 + X 13 + X 11 + X 8 + X 6 + X 5 (X 10 + X 9 + X 5 + X 4 + X + 1
- X 14 + X 11 + X 10
- ———————————–
- X 13 + X 10 + X 8 + X 6 + X 5
- X 13 + X 10 + X 9
- ———————————–
- X9 + X8 + X6 + X5
- X9 + X6 + X5
- ———————————–
- X8
- X8 + X5 + X4
- ———————————–
- X5 + X4
- X5 + X2 + X
- ———————————–
- X4 + X2 + X
- X5 + X + 1
- ———————————–
- X2 + 1
- R(X) = 1 + X 2

The code vector polynomial is R(X) + xn−k D(X)

R(X) = 1 + X 2 + X 5 + X 6 + X 8 + X 11 + X 13 + X 14
= [101001101001011]

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 31


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 31
0.2. Cyclic Codes

Consider a (15,11) linear cyclic code has a generator polynomial g(X) = 1 + X + X 4

(i) Draw the the block diagram of the encoder.

(ii) Illustratge the encoder procedure with the message vector 1 1 0 0 1 1 0 1 0 1 1 by listing the states
of the register (the right most bit is the earliest bit ).

(iii) Verify the validity of the code vector so formed by using division method.

Solution:
i) The encoder circuit is.
The generator polynomial is g(X) = 1 + X + X 4 . The coefficients of g are:

g(X) = 1 + X + X 4
= g0 + g1 X + g2 X 2 + g3 X 3 + g4 X 4

The generator polynomial coefficients are


g0 = 1, g1 = 1, g2 = 0, g3 = 0
The encoder circuit is as shown in Figure 23.

Gate
Enable
g0=1 g1=1 g2=0 g3=0
R0 + R1 R2 R3 +
Flip-flop
Modulo-2
adder g(X )  1 X  X 4
Message 11001101011 To channel

Figure 23: (15-11) Cyclic Encoder

Register contents
Shifts Input
R0 R 1 R2 R3
Initial state 0 0 0 0
1 1 1 1 0 0
2 1 1 0 1 0
3 0 0 1 0 1
4 1 0 0 1 0
5 0 0 0 0 1
6 1 0 0 0 0
7 1 1 1 0 0
8 0 0 1 1 0
9 0 0 0 1 1
10 1 0 0 0 1
11 1 0 0 0 0

The Code vector is [0 0 0 0 1 1 0 0 1 1 0 1 0 1 1]

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 32


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 32
0.2. Cyclic Codes

A (15,5) linear cyclic code has a generator polynomial g(X) = 1 + X + X 2 + X 4 + X 5 + X 8 + X 10

(i) Draw the the block diagram of the encoder.

(ii) Find the code polynomial for the message D(X) = 1 + X 3 + X 4 by listing the states of the register
with each binary message input.

(ii) Verify the validity of the code vector so formed by using division method.

Solution:
i) The encoder circuit is.
The generator polynomial is g(X) = 1 + X + X 2 + X 4 + X 6 + X 8 + X 10 . The coefficients of g are:
g0 = 1, g1 = 1, g2 = 1, g3 = 0, g4 = 1, g5 = 1, g6 = 0, g7 = 0, g8 = 1, g9 = 0
The syndrome calculation circuit is as shown in Figure 25.

Enable
Gate
g0=1 g1=1 g2=1 g4=1 g5=1 g8=1

R0 + R1 + R2 R3 + R4 + R5 R6 R7 + R8 R9 +

Flip-flop
Modulo-2
adder g ( X )  1  X  X 2  X 4  X 5  X 8  X 10
D( X )  1  X 3  X 4
Message 10011 To
channel

Figure 24: Encoder

Register contents
Shifts Input
R0 R1 R2 R3 R 4 R5 R6 R7 R8 R9
Initial state 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 0 1 1 0 0 1 0
2 1 1 0 0 1 1 0 1 0 1 1
3 0 1 0 1 0 0 0 0 1 1 1
4 0 1 0 1 1 1 1 0 0 0 1
5 1 0 1 0 1 1 1 1 0 0 0

Code vector is 010111100010011


Code polynomial g(X) = X + X 3 + X 4 + X 5 + X 6 + X 10 + X 13 + X 14

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 33


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 33
0.2. Cyclic Codes

X n−k D(X) = X 10 (1 + X 3 + X 4 ) = X 14 + X 13 + X 10

X 10 + X 8 + X 5 + X 4 + X 2 + X + 1)X 14 X 13 + X 10 + (X 4 + X 3 + X 2 + X
- X 14 + X 12 + X 9 + X 8 + X 6 + X 5 + X 4
- ———————————————
- X 13 + X 12 + X 10 + X 9 + X 8 + X 6 + X 5 + X 4
- X 13 + X 11 + X 8 + X 7 + X 5 + X 4 + X 3
- ———————————————
- X 12 + X 11 + X 10 + X 9 + X 7 + X 6 + X 5 + X 3
- X 12 + X 10 + X 7 + X 6 + X 4 + X 3 + X 2
- ———————————————
- X 11 + X 9 + X 4 + X 2
- X 11 + X 9 + X 6 + X 5 + X 3 + X 2 + X
- ———————————————
- X6 + X5 + X4 + X3 + X
- R(X) = X + X + X 4 + X 5 + X 6
3

The code vector polynomial is R(X) + xn−k D(X)

= X + X 3 + X 4 + X 5 + X 6 + X 10 (1 + X 3 + X 4 )
= X + X 3 + X 4 + X 5 + X 6 + X 10 + X 13 + X 14
= [010111100010011]

010111100010011

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 34


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 34
0.2. Cyclic Codes

2023 Jan 18EC54 8a 2001 FEB (2017 scheme) Jan 7 a.The generator polynomial of a (15,7) cyclic code is
g(X) = 1 + X 4 + X 6 + X 7 + X 8
(i) Draw the encoder circuit.
(ii) Obtain the codeword for the input (00111)
(iii) Find the code vector for the message D(X) = X 2 + X 3 + X 4 using encoder circuit.
(iv) Draw the syndrome calculation circuit.
(v) Find the syndrome of the received polynomial Z(X) = 1 + X + X 3 + X 6 + X 8 + X 9 + X 11 + X 14
(vi) Assume that the first and last bits of the code vector V (X) for D(X) = X 2 + X 3 + X 4 suffer
transmission errors. Find the syndrome of V (X).

Solution:
i) The encoder circuit is.
The generator polynomial is g(X) = 1 + X 4 + X 6 + X 7 + X 8 . The coefficients of g are:
g0 = 1, g1 = 0, g2 = 0, g3 = 0, g4 = 1, g5 = 0, g6 = 1, g7 = 1, g8 = 1
The encoder circuit is for the (15,7) cyclic code as shown in Figure 25.

Gate
Enable
g0=1 g4=1 g6=1 g7=1

R0 R1 R2 R3 + R4 R5 + R6 + R7 +
Flip-flop
Modulo-2
g(X )  1 X 4  X 6  X 7  X 8
adder
Message 00111
To channel

Figure 25: Encoder for the (15,7) cyclic code.

Register contents
Shifts Input
R0 R1 R2 R 3 R4 R5 R6 R7
Initial state 0 0 0 0 0 0 0 0
1 1 1 0 0 0 1 0 1 1
2 1 0 1 0 0 0 1 0 1
3 1 0 0 1 0 0 0 1 0
4 0 0 0 0 1 0 0 0 1
5 0 1 0 0 0 0 0 1 1

X n−k D(X) = X 8 (X 2 + X 3 + X 4 ) = X 10 + X 11 + X 12

X 8 + X 7 + X 6 + X 4 + 1)X 12 + X 11 + X 10 (+X 4
- X 12 + X 11 + X 10 + X 8 + X 4
- ———————————–
- X8 + X4
- X8 + X7 + X6 + X4 + 1
- ———————————–
- R(X) = 1 + X 6 + X 7

R(X) = 1 + X 6 + X 7 = 1 + (0)X + (0)X 2 + (0)X 3 + (0)X 4 + (0)X 5 + (1)X 6 + (1)X 7


= [10000011]

The code vector V is

[V ] = [R D] = [10000011 0011100]
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 35
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 35
0.2. Cyclic Codes

The syndrome calculation circuit is


The generator polynomial is g(X) = 1 + X 4 + X 6 + X 7 + X 8 . The coefficients of g are:
g0 = 1, g1 = 0, g2 = 0, g3 = 0, g4 = 1, g5 = 0, g6 = 1, g7 = 1, g8 = 1 The syndrome calculation circuit is
as shown in Figure 26.

Gate
Enable
g0=1 g4=1 g6=1 g7=1

S0 S1 S2 S3 + S4 S5 + S6 + S7
Flip-flop Syndrome
g(X )  1 X 4  X 6  X 7  X 8
ZX=110100101101001

Figure 26: Syndrome calculator for the (7,4) cyclic code generated by g(X) = 1 + X 4 + X 6 + X 7 + X 8

Register contents
Shifts Input
S0 S1 S 2 S3 S4 S 5 S6 S7
Initial state 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0
2 0 0 1 0 0 0 0 0 0
3 0 0 0 1 0 0 0 0 0
4 1 1 0 0 1 0 0 0 0
5 0 0 1 0 0 0 1 0 0
6 1 1 0 1 0 0 1 0 0
7 1 1 1 0 1 0 0 1 0
8 0 0 1 1 0 1 0 0 1
9 1 0 0 1 1 1 1 1 1
10 0 1 0 0 1 0 1 0 0
11 0 0 1 0 0 1 0 1 0
12 1 1 0 1 0 0 1 0 1
13 0 1 1 0 1 1 0 0 1
14 1 0 1 1 0 0 1 1 1
15 1 0 0 1 1 1 0 0 0

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 36


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 36
0.2. Cyclic Codes

The syndrome of the received polynomial for Z(X) = 1 + X + X 3 + X 6 + X 8 + X 9 + X 11 + X 14 is


The syndrome of the received signal Z(X) is obtained as the remainder resulting from division of Z(X)
by g(X) is
X 8 + X 7 + X 6 + X 4 + 1)X 14 + X 11 + X 9 + X 8 + X 6 + X 3 + X + 1(X 6 + X 5 + X 2 + X + 1
- X 14 + X 13 + X 12 + X 10 + X 6
- ———————————–
- X 13 + X 12 + X 11 + X 10 + X 9 + X 8 + X 3 + X + 1
- X 13 + X 12 + X 11 + X 9 + X 5
- ———————————–
- X 10 + X 8 + X 5 + X 3 + X + 1
- X 10 + X 9 + X 8 + X 6 + X 2
- ———————————–
- X9 + X6 + X5 + X3 + X2 + X + 1
- X9 + X8 + X7 + X5 + X
- ———————————–
- X8 + X7 + X6 + X3 + X2 + X + 1
- X8 + X7 + X6 + X4 + 1
- ———————————–
- X4 + X3 + X2

The remainder (syndrome) is S(X) = X 2 + X 3 + X 4


The syndrome vector is (n-k)=15-7=8 bit vector S=[0 0 1 1 1 0 0 0]

vi) When the first and last bits of the code vector V (X) for D(X) = X 2 + X 3 + X 4 suffer
transmission errors then the received code vector is.
The code vector is

[V ] = [100000110011100]

When the first and last bits of the code vector suffer transmission errors then

[Z] = [000000110011101]

Z(X) = X 6 + X 7 + X 10 + X 11 + X 12 + X 14

2003 July 7 b .The generator polynomial of a (15,7) cyclic code is g(X) = 1 + X 4 + X 6 + X 7 + X 8

(ii) Find the code word in systematic form for the message (0 1 0 1 0 1 0) clearly explaining all the steps.
In particular list the state of the registers in each step of code computation.

(ii) Verify your answer by direct hand calculation.

Solution:
i) The encoder circuit is.
The generator polynomial is g(X) = 1 + X 4 + X 6 + X 7 + X 8 . The coefficients of g are:
g0 = 1, g1 = 0, g2 = 0, g3 = 0, g4 = 1, g5 = 0, g6 = 1, g7 = 1, g8 = 1
The encoder circuit is for the (15,7) cyclic code as shown in Figure 25.
From the above table the last row of the table is 0 1 0 1 1 0 0 0 and the vector is
V=[0 1 0 1 1 0 0 0 0 1 0 1 0 1 0]
(ii) Verify your answer by direct hand calculation.
Given data D is [ 0 1 0 1 0 1 0 ] D(X) = X + X 3 + X 5
Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 37
Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 37
0.2. Cyclic Codes

Gate
Enable
g0=1 g4=1 g6=1 g7=1

R0 R1 R2 R3 + R4 R5 + R6 + R7 +
Flip-flop
Modulo-2
g(X )  1 X 4  X 6  X 7  X 8
adder
Message 010010
To channel

Figure 27: Encoder for the (15,7) cyclic code.

Register contents
Shifts Input
R0 R1 R2 R3 R4 R5 R6 R7
Initial state 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
2 1 1 0 0 0 1 0 1 1
3 0 1 1 0 0 1 1 1 0
4 1 1 1 1 0 1 1 0 0
5 0 0 1 1 1 0 1 1 0
6 1 1 0 1 1 0 0 0 0
7 0 0 1 0 1 1 0 0 0

g(X) = 1 + X 4 + X 6 + X 7 + X 8

X n−k D(X) = X 8 (X + X 3 + X 5 ) = X 13 + X 11 + X 9

Divide X n−k D(X) by g(X) g(X) = 1 + X 4 + X 6 + X 7 + X 8

X 8 + X 7 + X 6 + X 4 + 1)X 13 + X 11 + X 9 (X 5 + X 4 + X 3 + X
- X 13 + X 12 + X 11 + X 9 + X 5
- ———————————–
- X 12 + X 5
- X 12 + X 11 + X 10 + X 8 + X 4
- ———————————–
- X 11 + X 10 + X 8 + X 5 + X 4
- X 11 + X 10 + X 9 + X 7 + X 3
- ———————————–
- X9 + X8 + X7 + X5 + X4 + X3
- X9 + X8 + X7 + X5 + X
- ———————————–
- X4 + X3 + X

Remainder Polynomial is R(X) = X + X 3 + X 4 Vector R=[01011000]


The code vector V is

[V ] = [R D]
= [01011000 0101010]

Dr. J. Divya Lakshmi, Professor & HOD, Dept. of ECE, SKIT 38


Dr. Manjunatha P Prof., Dept of ECE, JNN College of Engg Shimoga [email protected] 38

You might also like