You are on page 1of 67

Digital Communication (GTU)

7-1

Error Correcting Codes

Chapter 7 : Error Correcting Codes

Section 7.10 :
Ex. 7.10.3 :

The parity check matrix of a (7, 4). Hamming code is as follows :

1 1 0 1 1 0 0
H=1 1 1 0 0 1 1
1 0 1 1 0 0 1 37
Calculate the syndrome vector for single bit errors.

.Page No. 7-35.

Soln. :
Steps to be followed :
Step 1 : Write the expression for syndrome.
Step 2 : Write the various errors vectors.
T

Step 3 : Then for each error vector, obtain the syndrome vector as : S = EH .
Step 1 : The syndrome vector is given by :
T

S = EH = [E]1 7 [H ]7 3
\ Syndrome vector will be represented by a 1 3 matrix.
\

[S]1 3 = [E]1 7 [H ]7 3

...(1)

Step 2 : Write various error vectors :


Various error vectors with single bit errors are as shown in Table P. 7.10.3(a). The encircled bits
represent the locations of errors.
Table P. 7.10.3(a)

orel 14

Digital Communication (GTU)

7-2

Error Correcting Codes

Step 3 : Calculate the syndromes corresponding to each error vector :


T

1.

[ S ] 1 3 = [ E ] 1 7 [ H ]7 3
T

Substituting

[ E ] = ( 1 0 0 0 0 0 0 ) and H we get,
1 1 1
1 1 0
1 0 1
[ S ] = [1 0 0 0 0 0 0]1 7 0 1 1
1 0 0
0 1 0
73
0 1 1
T
|H |
\
[ S ] = [ 1 0 0 0 0 0 0, 1 0 0 0 0 0 0,
1000000]
\
[ S ] = [ 1, 1, 1 ]
This is the syndrome for the first bit in error.
For the second bit in error,
1 1 1
1 1 0
1 0 1
[ S ] = [ 0 1 0 0 0 0 0] 0 1 1
1 0 0
0 1 0
0 1 1
\
[ S ] = [ 0 1 0 0 0 0 0, 0 1 0 0 0 0 0,
0000000]
\
[ S ] = [ 1, 1, 0]
Similarly we can obtain the other syndromes as shown in Table P. 7.10.3(b).

2.

3.

Table P. 7.10.3(b) : Syndromes for various error vectors

Corel 15

Digital Communication (GTU)

4.
5.

7-3

Error Correcting Codes

Note that the first row of Table P. 7.10.3(b), represent an error vector with no errors. The
corresponding syndrome is (0, 0, 0).
Table P. 7.10.3(b) also shows that the syndrome vectors are same as the rows of the transpose
T
matrix H .

Section 7.11 :
Ex. 7.11.2 :

Consider a (7, 4) linear block code whose generator matrix is given by :

10
G = 0

0
1.

0
1
0
0

0
0
1
0

0
0
0
1

1
1
1
0

0
1
1
1

Find all the codewords.

1
1
0
1
2.

Find the parity check matrix.

.Page No. 7-40.

Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :

Obtain the P matrix from the generator matrix.


Obtain the parity bits for each message vector using the expression,
B = MP
Obtain all the possible codewords as
X = [M:B]
T
Obtain the transpose of P matrix i.e. P and obtain the parity check matrix as :
T
[H] = [P | In k]

Step 1 : Obtain the P matrix :

Corel 22

Therefore the P matrix is given by

1
1
P = 1

0
1
1
1

1
1
0
1 4 3

Step 2 : To obtain the parity (check) bits :


The parity bits can be obtained by using the expression,
B = MP

...(1)

Digital Communication (GTU)

7-4

Error Correcting Codes

1
1
= [m0 m1 m2 m3] 1

[b0 b1 b2]1 3

0
1
1
1

1
1
0
1 4 3

Solving, we get,
b0 = m0 m1 m2
b1 = m1 m2 m3
b2 = m0 m1 m3

...(2)

Using these equations we can obtain the parity bits for each message vector. For example let the
message word be
m0 m1 m2 m3 = 0 1 0 1
b0 = 0 1 0 = 1
b1 = 1 0 1 = 0
b2 = 0 1 1 = 0
Hence the corresponding parity bits are b0 b1 b2 = 1 0 0
Therefore the complete codeword, for the message word 0 1 0 1 is

Corel 23

Similarly we can obtain the codewords for the remaining message words. All the message
vectors, the corresponding parity bits and codewords are given in Table P. 7.11.2. The code weights are
also given in the Table P. 7.11.2.
Table P. 7.11.2 : Code vectors for all the message vectors.
Sr.
No.

Message vector, M

Parity bits, B

Code words, X

m3

m2

m1

m0

b2

b1

b0

X6

X5

X4

X3

X2

X1

X0

Digital Communication (GTU)

Sr.
No.

7-5

Message vector, M

Error Correcting Codes

Parity bits, B

Code words, X

m3

m2

m1

m0

b2

b1

b0

X6

X5

X4

X3

X2

X1

X0

10

11

12

13

14

15

16

Step 4 :

To obtain the parity check matrix :

The parity check matrix [ H ] is a 3 7 matrix,


T

H = [ P : In k ]
T

The transpose matrix P is given by :


P

1 1 1 0
= 0 1 1 1
1 1 0 1 3 4

1 1 1 0 : 1 0 0
T
\ H = [ P : I3 3 ] = 0 1 1 1 : 0 1 0
1 1 0 1 : 0 0 1 3 7

...Ans.

This is the required parity check matrix.


Ex. 7.11.3 :

A (7, 4) linear block code of which generator matrix is given as :

G=

10

0
0

0
1
0
0

0
0
1
0

0
0
0
1

1
1
1
0

0
1
1
1

1
1
0
1

1.

Find code vector for any six messages

2.

Write the parity check matrix of this code.

.Page No. 7-41.

Soln. :
The generator matrix G is a k n matrix. So here it will be a 4 7 matrix in the following
format.
\ G = [ Ik | P ]

where Ik is a k k i.e. 4 4 matrix.

Digital Communication (GTU)

7-6

Error Correcting Codes

Corel 25

To obtain the parity bits for each message :


The parity bits can be obtained by using the expression
B = MP

...(2)

\ [b0, b1, b2] = [m0, m1, m2, m3]1 4 [P]4 3

...(3)

Substituting the P matrix from Equation (1) we can obtain the parity bits.

1
1
\ [b0, b1, b2] = [m0, m1, m2, m3] 1

0
1
1
1

1
1
0
1 43

P
Solving we get,
b0 = m0 m1 m2
b1 = m1 m2 m3
b2 = m0 m1 m3

...(4)

Using these equations we can obtain the parity bits for each message vector. For example let the
message word be
m0 m1 m2 m3 = 0 1 0 1
\

b0 = m0 m1 m2 = 0 1 0 =1
b1 = m1 m2 m3 = 1 0 1 =0
b2 = m0 m1 m3 = 0 1 1 =0

Hence the parity bits are b0 b1 b2 = 1 0 0


Therefore the complete codeword for the message word 0 1 0 0 is
complete codeword =

Message

Parity

Digital Communication (GTU)

7-7

Error Correcting Codes

Similarly we can obtain the codewords for other message vectors as shown in table P. 7.11.3.
Table P. 7.11.3
Sr. No.
1.
2.
3.
4.
5.
6.

Message vector
m0
m1
m2
m3
0
1
0
0
0
0

0
0
1
0
0
1

0
0
0
1
0
0

0
0
0
0
1
1

Parity bits
b0
b1
b2

x0

0
1
1
1
0
1

0
1
0
0
0
0

0
0
1
1
1
0

0
1
1
0
1
0

x1

Code vectors
x2
x3
x4

x5

x6

0
0
1
0
0
1

0
0
0
1
0
0

0
0
1
1
1
0

0
1
1
0
1
0

0
0
0
0
1
1

0
1
1
1
0
1

Parity check matrix :


The parity check matrix is given by
T

[ H ]3 7 = [ P | In k ]
T

Where P is the transpose of P and In k is I3 3 matrix.


We can obtain the transpose of P by interchanging the row and columns of P matrix in
Equation (1).

1 1 1 0
\ P = 0 1 1 1
1 1 0 1 3 4
T

Therefore the parity check matrix is given by :

1 1 1 0 1 0 0
H = 0 1 1 1 0 1 0
1 1 0 1 0 0 1 3 7
P
Ex. 7.11.4 :

...Ans.

I3 3

For a systematic linear block code, the three parity check digits, C4, C5 and C6 are given
by :
C4 = d1 d2 d3
C5 = d1 d2
C6 = d1 d3
1.

Construct generator matrix.

2.

Construct code generated by this matrix.

3.

Determine error correcting capability.

4.

Prepare a suitable decoding table.

5.

Decode the received words 101100 and 000110.

.Page No. 7-41.

Digital Communication (GTU)

7-8

Error Correcting Codes

Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :

Obtain the parity matrix P and using it, obtain the generator matrix G.
Obtain the values of C4, C5, C6 for various combinations of d1, d2, d3 and obtain all the
possible codewords.
Obtain dmin and from the value of dmin calculate the error detecting and correcting capability.

Step 4 :

Obtain the decoding table by following the steps given below :

1.

Obtain the transpose of the parity check matrix H

2.

Calculate Syndrome S = EH

3.

Write the decoding table.

Step 5 :

Decode the received words with the help of syndromes listed in the decoding table.

Step 1 : To obtain the parity matrix P and generator matrix G :


The relation between the check (parity) bits, message bits and the parity matrix P is given by :
[C4 C5 C6]1 3 = [d1, d2, d3]1 3 [P]3 3
\

P11 P12 P13


[C4 C5 C6] = [d1 d2 d3] P21 P22 P23
P31 P32 P33
\

...(1)

...(2)

C4 = P11 d1 P21 d2 P31 d3


C5 = P12 d1 P22 d2 P32 d3

(3)

C6 = P13 d1 P23 d2 P33 d3


Comparing Equation (3) with the given equations for C4, C5, C6 we get,
P12 = 1
P13 = 1
P11 = 1
P21 = 1
P22 = 1
P23 = 0
P32 = 0
P33 = 1
P31 = 1
Hence the parity matrix is as shown below :

1 1 1
P = 1 1 0
1 0 1 3 3
This is the required parity matrix. The generator matrix is given by :
G = [Ik : P] = [I3 : P3 3]

1 0 0 : 1 1 1
G = 0 1 0 : 1 1 0
0 0 1 : 1 0 1
This is the required generator matrix.

...Ans.

Digital Communication (GTU)

7-9

Error Correcting Codes

Step 2 : To obtain the codewords :


It has been given that,
C4 = d1 d2 d3

C5 = d1 d2

C6 = d1 d3

Using these equations we can obtain the check bits for various combinations of the bits d1, d2,
and d3. After that the corresponding codewords are obtained as shown in Table P. 7.11.4(a).
For d1 d2 d3 = 0 0 1
C4 =d1 d2 d3 = 0 0 1 = 1
C5 =d1 d2 = 0 0 = 0
C6 =d1 d3 = 0 1 = 1
\ C4 C5 C6 = 101 and the codeword is given by :
d1 d2
Codeword for d1 d2 d3 = 001 =
0 0

d3

C4

C5

C6

Similarly the other codewords are obtained. They are listed in Table P. 7.11.4(a).
Table P. 7.11.4(a) : Codewords
Sr. No.

1.
2.
3.
4.
5.
6.
7.
8.

Message vector

Check bits

Codevectors or codewords

d1

d2

d3

C4

C5

C6

d1

d2

d3

C4

C5

C6

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
1
1
0
1
0
0
1

0
0
1
1
1
1
0
0

0
1
0
1
1
0
1
0

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
1
1
0
1
0
0
1

0
0
1
1
1
1
0
0

0
1
0
1
1
0
1
0

Code weight
W (X)
0
3
3
4
4
3
3
4

Step 3 : Error correcting capacity :


The error correcting capacity depends on the minimum distance dmin. From Table P. 7.11.4(a),
dmin = 3.
\ Number of errors detectable is dmin s + 1
\

3 s+1

s2

t1

So at the most two errors can be detected.


dmin 2t + 1

and
\

3 2t + 1

Thus at the most one error can be corrected.

Digital Communication (GTU)

Step 4 :

7-10

Error Correcting Codes

Decoding table :

To write the decoding table, we have to calculate the syndrome (S)


S = EH

...(4)

where E = Error vector and H = Transpose of parity check matrix.


So let us first obtain the transpose of matrix H.
T
H = [ P : In k] n k , n

...(5)

Therefore the transpose of parity check matrix is given by


HT =

P

In k

...(6)
n ( n k)

Substituting the P matrix and the identity matrix we get,

1 1 0
1 0 1
=
1 0 0
0 1 0
0 0 1
1 1 1

...(7)

The error vector E is a 1 6 size vector. Assuming the second bit in error we can get the error
vector as

E = [0 1 0000]
where the encircled bit shows the bit in error.
Hence the syndrome is given by,

1 1 0
1 0 1
=[0 O
1 0000]
10 01 00
0 0 1
1 1 1

S = EH

S = [ 0 1 0 0 0 0, 0 1 0 0 0 0, 0 0 0 0 0 0]
S = [1 1 0]

This is the syndrome corresponding to second bit in error. Observe carefully that it is same as the
T
T
second row of the H matrix. The other syndromes can be obtained directly from the rows of H . The
decoding table consisting of the error patterns and corresponding syndrome vectors is shown in
Table P. 7.11.4(b).

Digital Communication (GTU)

7-11

Error Correcting Codes

Table P. 7.11.4(b) : Decoding Table


Sr. No.

Error vector E.
(with single bit error pattern)
0
0
0
0
0
0
0
0
0
0
0
1

1
2

Syndrome vectors

Relation with H

0
1

0
1

0
1

1st Row of H

O1

2nd Row of H

O1

3d Row of H

O1

4th Row of H

O1

5th Row of H

O1

6th Row of H

Step 5 :

Decoding of the received words :

The first given codeword is 101100. But this codeword does not exist in the codeword table
(Table P. 7.11.4(a)). This shows that error must be present in the received code vector. Let us represent
the received code word as :
Y1 = [ 1 0 1 1 0 0 ]
The syndrome for this codeword is given by,
S = Y1 H

1 1 0
1 0 1
[101100] 1 0 0
0 1 0
0 0 1
1 1 1

= [101100
\

100000

101000]

= [1 1 0]

Thus the syndrome of the received word is [ 1 1 0 ] which is same as the second syndrome in the
decoding table. Hence the corresponding error pattern is,

E = [0 1 0 0 0 0]
And the correct word can be obtained as
X1 = Y1 E = [1 0 1 1 0 0] [0 1 0 0 0 0]
X1 = [ 1 1 1 1 0 0 ]
Similarly we can perform the decoding of 000110.

This is the correct transmitted word.

Digital Communication (GTU)

7-12

Error Correcting Codes

Let X2 = 000110 ... is the second received codeword. Even this is not the valid codeword listed in
codeword table [Table P. 7.11.4(a)]. The syndrome for this can be obtained as :
S = Y2 H

1 1 0
1 0 1
= [0 0 0 1 1 0] 1 0 0
0 1 0
0 0 1
1 1 1

S = [110]

The error pattern corresponding to this syndrome is obtained from the decoding table as

E = [0 1 0 0 0 0]
Therefore the correct codeword is given by,
X2 = Y 2 E
= [0 0 0 1 1 0] [0 1 0 0 0 0]
\ X2 = [0 1 0 1 1 0]
Ex. 7.11.5 :

This is the correct transmitted word.

The parity check bits of a (8, 4) block code are generated by :


C5 = d1 + d2 + d4
C6 = d1 + d2 + d3
C7 = d1 + d3 + d4
C8 = d2 + d3 + d4
where d1, d2, d3 and d4 are the message digits.
1.

Find the generator matrix and the parity check matrix for this code.

2.

Find the minimum weight of this code.

3.

Find the error detecting capabilities of this code.

4.

Show through an example that this code can detect three errors.

Soln. :
Steps to be followed :
Step 1 : Obtain the coefficient matrix P.
Step 2 : Obtain the generator matrix G and parity check matrix H.
Step 3 : Obtain the values of C5, C6, C7 and C8 for various values of d 1, d2, d3, d4 .
Step 4 : Obtain all the possible codewords. Calculate the minimum weight.
Step 5 : Obtain dmin and calculate the error detecting and correcting capacity.
Step 6 : To show that 3 errors can be detected.

.Page No. 7-41.

Digital Communication (GTU)

7-13

Error Correcting Codes

Step 1 : Obtain the coefficient matrix P :


The relation between the check (parity) bits, message bits and coefficient matrix P is given by :
[C5 C6 C7 C8]1 4 = [d1 d2 d3 d4]1 4 [P]4 4

[C5 C6 C7 C8] = [d1 d2 d3

P
d ]P
P

P11 P12
21 P22
31 P32
41 P42

...(1)
P13
P23
P33
P43

P14
P24
P34
P44

C5 = P11 d1 P21 d2 P31 d3 P41 d4


C6 = P12 d1 P22 d2 P32 d3 P42 d4

(2)

C7 = P13 d1 P23 d2 P33 d3 P43 d4


C8 = P14 d1 P24 d2 P34 d3 P44 d4
Comparing Equation (2) with the given equations of C5, C6, C7 and C8 we get,
P11 = 1

P12 = 1

P13 = 0

P14 = 1

P21 = 1

P22 = 1

P23 = 1

P24 = 0

P31 = 1

P32 = 0

P33 = 1

P34 = 1

P41 = 0

P42 = 1

P43 = 1

P44 = 1

Hence the coefficient matrix is given by :

1
1
P = 1

1
1
0
1

0
1
1
1

1
0
1
1 4 4

Step 2 : Obtain the generator matrix G and parity check matrix H :


The generator matrix is given by :
G = [ Ik : P ]

But k = 4

1
0
\ G = 0

0
1
0
0

0
0
1
0

0
0
0
1

This is the required generator matrix.


The parity check matrix is given by :
T
H = [ P : In k ]

:
:
:
:

1
1
1
0

1
1
0
1

0
1
1
1

1
0
1
1

...Ans.

Digital Communication (GTU)

7-14

Error Correcting Codes

1
1
T
But P = 0

1
1
1
0

1
0
1
1

0
1
1
1

1
1
\ H = 0

1
1
1
0

1
0
1
1

0
1
1
1

:
:
:
:

1
0
0
0

0
1
0
0

0
0
1
0

0
0
0
1

...Ans.

Step 3 : Obtain the values of C5, C6, C7, C8 for different values of d1 d2 d3 d4 :
It has been given that,
C5 = d1 d2 d4
C6 = d1 d2 d3
C7 = d1 d3 d4
C8 = d2 d3 d4
Step 4 : Obtain all the codewords :
The remaining codewords are listed in Table P. 7.11.5.
Table P. 7.11.5 : Codewords
Sr.
No.

Message vector

Check bits

Code
weight

Code vector or codeword

d1

d2

d3

d4

C5

C6

C7

C8

d1

d2

d3

d4

C5

C6

C7

C8

10

11

12

13

14

15

Digital Communication (GTU)

7-15

Error Correcting Codes

From Table P. 7.11.5, the minimum weight of this code is 4.


\
S = [0, 0, 1, 0]
Step 5 : Obtain dmin and calculate error detecting and correcting capacity :
The minimum distance dmin is equal to the minimum weight of any non-zero code vector.
Looking at Table P. 7.11.5 we get,
dmin = 4
...Ans.
\ Number of errors detectable
dmin s + 1
\
4 s+1
\
s 3
...Ans.
Hence at the most three errors can be detected.
Number of errors that can be corrected.
dmin (2t + 1)
\
4 (2t + 1)
\

t 3/2

...Ans.

Therefore at the most 1 error can be corrected.


Step 6 : To show that 3 errors can be detected :
A non-zero syndrome indicates the presence of errors. So we are going to show that if upto three
errors are introduced, then the syndrome is non-zero.
1.

Let the transmitted code word be X = (0 0 1 0 0 1 1 1)

2.

Let there be three errors introduced. Hence the error vector E is given by.
Corel D

3.

The received signal Y = X E


Corel E

4.

The corresponding syndrome is given by S = YH

S = [1 0 1 1 0 0 1 1]

1
1
1
0
1
0
0
0

1
1
0
1
0
1
0
0

0
1
1
1
0
0
1
0

1
0
1
1
0
0
0
1

Digital Communication (GTU)

7-16

Error Correcting Codes

= [ 1 0 1 0 0 0 0 0,
1 0 0 1 0 0 0 0,
0 0 1 1 0 0 1 0,
1 0 1 1 0 0 0 1]
Substituting the values of d1, d2, d3 and d4 we obtain the various codewords as follows :
If

d1 d2 d3 d4 = 0 0 0 1
C5 = 0 0 1 = 1

Then

C6 = 0 0 0 = 0
C7 = 0 0 1 = 1
C8 = 0 0 1 = 1
Hence the codeword is X

= d1 d2 d3 d4 C5 C6 C7 C8

Corel F

Thus the syndrome is non-zero indicating the presence of errors even when three errors are
introduced. Thus it is possible to detect three errors.

Section 7.13 :
Ex. 7.13.9 :

For systematic (7, 4) cyclic code, find out the generator matrix and parity check matrix.
3

Given : G (D) = D + D + 1

.Page No. 7-65.

Soln. :

th

The i row of the generator matrix is given by Equation (7.13.23) as,


D

Ri (D) = Qi (D) G (D)

... where i = 1, 2, ... k

...(1)

It is given that the cyclic code is systematic (7, 4) code, \ n = 7, k = 4 and (n k) = 3


Substituting these values into the above expression, we get,
D

(n i)

(7 i)

Ri (D) = Qi (D) (D + D + 1)
3

..... i = 1, 2, ... 4.

With i = 1, the above equation is given by,


D Ri (D) = Qi (D) (D + D + 1)
6

...(2)

Digital Communication (GTU)

7-17

Error Correcting Codes

Let us obtain the value of Qi (D). The quotient Qi (D) can be obtained by dividing D
6

(n i)

by

G (D) as per Equation (7.13.20). Therefore to obtain Qi (D), let us divide D by (D + D + 1).
The division takes place as follows :
3

D + D + 1 Quotient polynomial Qi (D)


D3 + D + 1

D +D +D
Mod 2 addition

D +D

D + 0D + D + D
Mod 2 addition

D + D + D
3

D + 0D + D + 1
Mod 2 addition

Remainder polynomial Ri (D)

+ 0D + 1

Here the quotient polynomial

Qi (D)= D + D + 1

and the remainder polynomial

Ri (D)= D + 0D + 1

Substituting these values into Equation (2) we get,


6
3
3
D Ri (D) = (D + D + 1) (D + D + 1)
6

= D +D +D +D +D +D+D +D+1
= D + 0D + (1 1) D + (1 1) D + D + (1 1) D + 1
6

= D + 0D + 0D + 0D + D + 0D + 1
\

1st Row Polynomial D + 0D + 0D + 0D + D + 0D + 1


6

1st Row Elements 1 0 0 0 1 0 1

Using the same procedure, we can obtain the polynomials for the other rows of the generator
matrix as follows :
2nd Row Polynomial

D +D +D+1

3rd Row Polynomial

D +D +D

4th Row Polynomial

D +D+1

5
4
3

2
2

Digital Communication (GTU)

7-18

Error Correcting Codes

These polynomials can be transformed into the generator matrix as follows :


6 5 4 3
2 1 0
D D D D D D D
Row 1 1 0 0 0 : 1 0 1
Row 2 0 1 0 0 : 1 1 1
G =
Row 3 0 0 1 0 : 1 1 0
Row 4 0 0 0 1 : 0 1 1 4 7
| I4 4 | P4 3 |
This is the required generator matrix.
To obtain the parity check matrix [H] :
The parity check matrix is given by :
T

H = [P : I3 3]
T

The transpose matrix P is given by interchanging the rows and columns of the P matrix.
P

1 1 1 0
0 1 1 1
1 1 0 1

3 4

Hence the parity check matrix is given by,


1 1 1 0 : 1 0 0
H = 0 1 1 1 : 0 1 0
1 1 0 1 : 0 0 1 3 7
This is the required parity check matrix. This parity check matrix is of systematic type.
Ex. 7.13.10 :

Obtain the code vectors for the (7, 4) code having G (D) = 1 + D + D

.Page No. 7-65.

Soln. :
1.
The code vectors in the systematic form can be obtained, as follows :
X = MG
Where
2.

M = Message matrix and

...(1)
G = Generator matrix.

Let the message vector be 1 0 1 0. Let us use the generator matrix of the previous example to
write,
\

M [ m3 m2 m1 m0 ] = [1 0 1 0]
\

1
0
X = M G = [1 0 1 0] 0

X = [1 0 1 0 : 0 1 1 ]

This is the required code word.

0
1
0
0

0
0
1
0

0
0
0
1

:
:
:
:

1
1
1
0

0
1
1
1

1
1
0
1
...Ans.

Digital Communication (GTU)


Ex. 7.13.13 :

7-19

Error Correcting Codes

A message 10 11 01 is to be transmitted in cyclic code with a generator polynomial


4

G (D) = D + D + 1. Obtain the transmitted code word. How many check bits (parity bits)
does the encoded message contain ? Draw the encoding arrangement for the same.
.Page No. 7-69.

Soln. :
Steps to be followed :
Step 1 :

Obtain the message polynomial M (D).


2

M (D) = m0 + m1 D + m2 D + m3 D + m4 D + m5 D
nk

Step 2 :

Multiply M (D) by D

to obtain D

Step 3 :

Divide D

nk

Step 4 :

Obtain the code word X as

nk

M (D).

M (D) by the generator polynomial G (D).

X = [m5, m4, m3, m2, m1 m0 : b3, b2, b1 b0]


1.

The given message is : 10 11 01 therefore there are 6 message bits.


\

2.

The degree of generator polynomial is four. The degree of generator polynomial is equal to the
number of parity bits in the code.
\

Number of parity bits (n k) = 4.


\

3.

k =6

Code word length n= k + 4 = 10.

To obtain the message polynomial M (D) :

The message polynomial corresponding to the message 10 11 01= [m5, m4, m3, m2, m1 m0] is
given as,
2

M (D) = m0 + m1 D + m2 D + m3 D + m4 D + m5 D

...(1)

Substituting the values of message bits we get,


\ M (D) = 1 + 0D + D + D + 0D + D
2

4.

...(2)

Rewrite the generator polynomial :


The generator polynomial can be written in the form as :
2

G (D) = 1 + 0D + 0D + D + D
5.

...(3)

nk

Multiply the message polynomial M (D) by D


As (n k) = 4, D

nk

=D

\ D4 M (D) = D4 [ 1 + 0D + D2 + D3 + 0D4 + D5]


= D4 + 0D5 + D6 + D7 + 0D8 + D9

...(4)

Digital Communication (GTU)

7-20

Error Correcting Codes

6.

Divide D M (D) by the generator polynomial :


The division takes place as follows :
5

D +D +D
4

D + D + 0D + 0D + 1

Quotient polynomial

D + 0D + D + D + 0D + D
9

D + D + 0D + 0D + D
Modulo 2 additions

D +D +D +D +D
6

D + D + 0D + 0D + D
Modulo 2 additions

D +D

D + D + 0D + 0D + D
Modulo 2 additions

D Remainder polynomial
2

7.

To obtain the code word polynomial X (D) :


The code word polynomial is obtained by adding D
\

M (D) to the remainder polynomial B(D).

X (D) = D M (D) + B (D)

...(5)

B (D) = b0 + b1 D + b2 D + bn k 1 D

But
Here

nk

nk1

...(6)

(n k 1) = (10 6 1) = 3
\

B (D) = b0 + b1 D + b2 D + b3 D

...(7)

But we have obtained b (D) = D , so comparing the two we get b0 = 0, b1 = 0, b2 = 1 and b3 = 0.


\ Parity bits (b3, b2, b1 b0) = (0 1 0 0)

...(8)

Therefore the code word is given as :


X = [m5, m4, m3, m2, m1 m0 : b3 b2 b1 b0]
\ Code word

X = [101101:0100]

...Ans.

And the corresponding code word polynomial is given as :


9
8
7
6
5
4
3
2
X (D) = D + 0D + D + D + 0D + D + 0D + D + 0D + 0

The encoded message consists of 4 check bits or parity bits b3, b2, b1 and b0.

...Ans.

Digital Communication (GTU)

7-21

Error Correcting Codes

To draw the encoder for the cyclic code :


The generator polynomial is given by,
4
3
G (D) = D + D + 1
4

= D + D + 0D + 0D + 1

...(9)

The generator polynomial of an (n, k) cyclic code is expressed as :


G (D) = 1 +

nk1
i
nk

gi D + D
i=1

...(10)

Substitute n = 10 and k = 6 and n k = 4 in Equation (10) to get,


3
i
4
G (D) = 1 + gi D + D
i=1
\

4
3
2
G (D) = D + g3 D + g2 D + g1 D + 1

(11)

Comparing Equations (9) and (11) we get,


g1 = 0, g2 = 0 and g3 = 1

...(12)

Therefore the encoding arrangement is as shown in Fig. P. 7.13.13.

Fig. P. 7.13.13 : Encoding arrangement


Ex. 7.13.15 :

Obtain the syndrome for the received word Y = (0 1 1 0 0 0 1) if the transmitted word is
X = (0 1 1 1 0 0 1), using the syndrome calculator of Ex. 7.13.14.

.Page No. 7-72.

Soln. :

The output switch of Fig. P. 7.13.14 will be initially in position 1. It will remain in this position
until all the 7 bits of the received signal Y are shifted into register.

Digital Communication (GTU)

7-22

Error Correcting Codes

After that the output switch is switched to position 2. The clock pulses are then applied to the
shift register to output the syndrome vector S.
Table P. 7.13.15 explains the process of syndrome generation for the received code word.
Table P. 7.13.15 : Contents of the syndrome calculation in Fig. P. 7.13.14 for the received
word 0110001

Corel 20

At the end of the seventh shift, the contents of the shift register (shaded row in Table P. 7.13.15)
represent the syndrome (0 1 1) corresponding to the received code word Y = (0 1 1 0 0 0 1)
Since the syndrome is non-zero, the received word is in error. The error pattern corresponding to

syndrome (0 1 1 ) is 0 0 0 1 0 0 0.

The encircled one indicates that the fourth bit of the received word is in error which is indeed the
case in this problem.

Ex. 7.13.16 :

Construct the (7, 4) linear code word for the generator polynomial G (D) = 1 + D +D for
the message bits 1 0 0 1 and find the checksum for the same.

Soln. :
Steps to be followed :
Step 1 :

Obtain the message polynomial M (D)

Step 2 :

Multiply M (D) by D

Step 3 :

Divide D

nk

Step 4 :

Obtain the code word X as


X = [ m3 m2 m1 m0 : b2 b1 b0 ]

Step 1 :

Message polynomial M (D) :

nk

to obtain D

nk

M (D)

M (D) by the generator polynomial G (D).

The given message is 1 0 0 1, therefore there are 4 message bits.


\ [ m3 m2 m1 m0 ] = [ 1 0 0 1]
\ M (D) = m0 + m1 D + m2 D + m3 D
2

.Page No. 7-73.

Digital Communication (GTU)

7-23

Error Correcting Codes

Substituting the values of message bits we get,


2

M (D) = 1 + 0D + 0D + D
\ M (D) = 1 + D
Step 2 :

Multiply M (D) by D

nk

...(1)

Given code is (7, 4) code. Therefore n = 7 and k = 4. Hence (n k) = 3.


\D

nk

M (D) = D3 [1 + 0D + 0D2 + D3]

\ D3 M (D) = D3 + 0 D4 + 0D5 + D6
Step 3 :

Divide D

nk

...(2)

M (D) by G (D) :

The division takes place as follows :


3

Quotient polynomial Q (D)

D +D +D+1
3

D + D + 0D + 1

D + 0D + 0D + D
6

D + D + 0D + D
Modulo - 2 additions

0D + D + 0D + 0D
5

+ D + D + 0D + D
Modulo - 2 additions

D + 0D + D
4

2
2

D + D + 0D + D
Modulo - 2 additions

D +D +D
D + D + 0D + 1
Modulo - 2 additions

D + 1 Remainder polynomial B (D)

\
Step 4 :

Remainder polynomial

B (D) = D + 0D + 0

...(3)

To obtain the codeword polynomial :

Codeword polynomial

X (D)

= D M (D) + B (D)

Substituting the values from Equations (2) and (3) we get,


X (D) = [ D6 + 0D5 + 0D4 + D3 + 0D2 + 0D + 0] + [D2 + 0D + 0]
\

X (D) = D6 + 0D5 + 0D4 + D3 + D2 + 0D + 0

..(4)

Digital Communication (GTU)

7-24

Error Correcting Codes

Therefore the codeword is given by :


X = [ m3 m2 m1 m0 : b2 b1 b0 ] = [1 0 0 1 : 1 0 0 ]

X =

m3

m2

m1

m0

b2

b1

b0

Message
bits

...Ans.

Parity
bits

Section 7.14 :
Ex. 7.14.3 :

If the frame is 110101011 and generator is x + x + 1 what would be the transmitted


frame.

.Page No. 7-76.

Soln. :
Given :

Data word : 1 1 0 1 0 1 1 0 1 1
4

Generator : x + x + 1 = x + 0 x + 0 x + x + 1 = 10011
Step 1 : Add five zeros at the end of the data word :
Add five zeros (equal to number of generator bits) at the end of data word to get the dividend as
follows :

Corel 1

Step 2 :

Carryout the long division :

Step 3 : Write the transmitted frame :


The transmitted frame is obtained by writing the data word followed by the remainder.
\

1 1 0 1 0 1 1 0 1 1 0 0 0 0 0 Dividend
+

0 1 1 1 1 Remainder

Transmitted frame 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1

Digital Communication (GTU)

7-25

Error Correcting Codes

\ The transmitted codeword is as follows :


corel 2

Ex. 7.14.4 :

What is the remainder obtained by dividing x + x + 1 by the generator polynomial


3

x +1?

.Page No. 7-76.

Soln. :
7

Given :

Dividend : x + x + 1 = x + 0x + x + 0x + 0x + 0x + 0x + 1 = 10100001
Divisor :

x + 1 = x + 0x + 0x + 1 = 1001

The long division is as follows :

The remainder is 00111 = x + x + 1 in the polynomial form.


Ex. 7.14.5 :

A bit stream 10011101 is transmitted using the standard CRC method. The generator
3

polynomial is x + 1. Show the actual bit string transmitted. Suppose the third bit from left
is inverted during transmission. Show that this error is detected at the receivers end.
.Page No. 7-77.

Soln. :
Given : Data word (Bit string) : 1 0 0 1 1 1 0 1
3

Generator polynomial : x + 1 = x + 0x + 0x + 1 = 1 0 0 1
Part I : Transmitted bits :
Step 1 :

Obtain the dividend :


Dividend = Data word + 4 zeros.

The dividend is as follows :

Digital Communication (GTU)

Step 2 :

7-26

Error Correcting Codes

Carry out the division :

COREL D

Step 3 : Obtain the actually transmitted bit stream :


The transmitted word is obtained by writing the data word followed by the remainder as follows :
Corel 4

Part II : Error detection


Step 4 : Write the erroneous received word :
The received word = 1 0 1 1 1 1 0 1

0 0 0 1

Error
At the receiver, this word is divided by the same divider used at the transmitter i.e. 1001.

Corel E

A non zero remainder indicates that there is an error in the received codeword.
Ex. 7.14.6 :

Construct

systematic

(7,

4)

cyclic

code

using

the

generator

polynomial

G (X) = x + x + 1. What are the error correcting capabilities of this code ? Construct the
decoding table and for the received codeword 1 1 0 1 1 0 0, determine the transmitted
data word.

.Page No. 7-77.

Digital Communication (GTU)

7-27

Error Correcting Codes

Soln. :
Steps to be followed :
Step 1 :

Obtain the generator matrix by using Equation (7.13.23)

Step 2 :

Then obtain the code vectors, X = MG

Step 3 :

Calculate dmin and obtain the error correcting capability.

Step 4 :

Get the transpose matrix P from P matrix.

Step 5 :

Obtain the parity check matrix H = [P : In k]

Step 6 :

Obtain the transpose matrix H .

Step 7 :

From H prepare the decoding table.

Step 8 :

Decode the received codeword Y = 1 1 0 1 1 0 0

From the given data it is clear that n = 7 and k = 4 for this code.
Step 1 : The generator matrix :
We have to use Equation (7.13.23) in order to obtain the generator matrix for the given generator
polynomial. However we have already obtained it in Ex. 7.13.9 as :

1
0
G = 0

0
1
0
0

0
0
1
0

0
0
0
1

:
:
:
:

1
1
1
0

0
1
1
1

1
1
0
1

...Ans.

Step 2 : Obtain code vectors :


The generator matrix of step 1 can be used to calculate the code vectors, because
X = MG
Where

...(1)

M = Message vector.

For example if the message vector is M = 1 0 1 0 then the corresponding codeword can be
obtained as follows.
\

1
0
X = [1 0 1 0] 0

X = [ 1 0 1 0 : 0 1 1]

0
1
0
0

0
0
1
0

0
0
0
1

:
:
:
:

1
1
1
0

0
1
1
1

1
1
0
1

Message
Parity bits
Similarly we can obtain the code words for other message vectors.
Step 3 : Calculate d min :
From codewords it is clear that the minimum distance is d min = 3. Therefore this code will be able
to detect upto 2 errors and correct upto only 1 errors.

Digital Communication (GTU)

Step 4 :

7-28

Error Correcting Codes

Transpose matrix P :
We know that G = [ Ik : Pk (n k)]

Corel 24

1
1
P = 1

0
1
1
1

1
1
0
1 4 3

The transpose of this matrix can be obtained by interchanging the rows and columns.
1 1 1 0
T
\ P = 0 1 1 1
1 1 0 1 3 4
Step 5 : Obtain the parity check matrix H :
The parity check matrix is given by :
T

H = [ P : In k]
\

1 1 1 0 : 1 0 0
H = 0 1 1 1 : 0 1 0
1 1 0 1 : 0 0 1
T

Step 6 : Obtain the transpose matrix H :


T

We can obtain the transpose matrix H by interchanging the rows and columns of H matrix.
1 0 1
1 1 1
1 1 0
T
\ H = 0 1 1
1 0 0
0 1 0
0 0 1

Step 7 :

Prepare the decoding matrix :


T

We can prepare the decoding table from the transpose of the parity check matrix. H because
T

each row of H represents a syndrome and a unique error pattern, as discussed in section 7.7 (in linear
block code). The Table P. 7.14.6 shows the error patterns and syndrome vectors.

Digital Communication (GTU)

7-29

Error Correcting Codes

Table P. 7.14.6 : Decoding table


Sr. No.
1
2
3
4
5
6
7
8

First row of H

Second row of H

Third row of H

Fourth row of H
Fifth row of H

T
T

Sixth row of H

Seventh row of H

Syndrome vector
0
0
0
1
0
1

Error vector E with single error patterns


0
0
0
0
0
0
0
1
0
0
0
0
0
0

This is the required decoding table.


Step 8 : Decode the input word.
The input word Y = 1 1 0 1 1 0 0
The received word can be expressed in the polynomial form as
6

Y (x) = x + x + x + x
The syndrome vector is given by
S (x) = remainder

Y (x)
G (x)

So let us perform the division as follows :


6
5
4
3
2
Y (x) = x + x + 0x + x + x + 0x + 0
3
2
G (x) = x + 0x + x + 1

and

The division takes place as follows.


3

x +x +x+1
3

x + 0x + x + 1

x + x + 0x + x + x + 0x + 0
6

x + 0x + x + x
Mod - 2 additions

x + x + 0x + x
5

x + 0x + x + x
Mod - 2 additions

x + x + 0x + 0x
4

x + 0x + x + x
Mod - 2 additions

x +x +x+0
3

x + 0x + x + 1
Mod - 2 additions

x + 0x + 1

Remainder

Digital Communication (GTU)

7-30

Error Correcting Codes

The remainder polynomial is given by : x + 0x + 1.


\ S = [ 1 0 1]
The nonzero syndrome indicates that there exists an error in the received codeword. The
decoding Table P. 7.14.6 indicates that the error vector corresponding to the syndrome S = 1 0 1 is given
by :
E = [1000000]
Therefore the corrected codeword is given by
X = YE
= [ 1 1 0 1 1 0 0 ] [ 1 0 0 0 0 0 0]
\ X = [ 0 1 0 1 1 0 0]
...Ans.
Ex. 7.14.7 :

Why are cyclic codes effective in detecting error bursts ? The message 1001001010 is to
2

be transmitted in a cyclic code with a generator polynomial g (x) = x + 1.


1.

How many check bits does the encoded message contain ?

2.

Obtain the transmitted code word.

3.

Draw encoding arrangement to obtain remainder bits.

4.

After the received word is clocked into the decoder input, what should be the
content of the register stores ?
.Page No. 7-77.

Soln. :
Steps to be followed :
Step 1 :

Obtain the message polynomial M (D).


2

M (D) m0 + m1 D + m2 D +
nk

Step 2 :

Multiply M (D) by D

Step 3 :

Divide D

nk

Step 4 :

Obtain the check bits.

Step 5 :

Obtain the codeword.

1.

2.

to obtain D

nk

M (D).

M (D) by the generator polynomial G (D).

The message polynomial M (D) corresponding to the given message signal (1 0 0 1 0 0 1 0 1 0).
That means there are 10 message bits.
\ k = 10
...(1)
Hence the message polynomial is given by,
2
3
4
5
6
7
8
9
M (D) = m0 + m1 D + m2 D + m3 D + m4 D + m5 D + m6 D + m7 D + m8 D + m9 D
2
3
4
5
6
7
8
9
= 0 + D + 0D + 1D + 0D + 0D + 1D + 0D + 0D + 1D
9
6
3
\ M (D) = D + D + D + D
...(2)
The generator polynomial is,
2

G (D) = D + 1

...(3)

Hence the degree of generator polynomial is 2. The degree of generator polynomial is equal to
the number of parity (check) bits in the code.
\

Number of check bits = (n k) = 2

...(4)

Digital Communication (GTU)

7-31

Length of the codeword = n = k + 2


\

3.

nk

Multiply M (D) by D
\

n = 10 + 2 = 12

Divide D

nk

...(5)

i.e. by D .

nk

M (D) = D2 [D9 + D6 + D3 + D]
= D11 + D8 + D5 + D3

4.

Error Correcting Codes

M (D) by the generator polynomial.

Corel 28

...(6)

Digital Communication (GTU)

7-32

Error Correcting Codes

The codeword polynomial :


The codeword polynomial is obtained by adding D
\

nk

M (D) to the remainder polynomial B (D).

X (D) = D M (D) + B (D)

...(7)

The remainder polynomial B (D) = D + 1


\

X (D) = [ D11 + D8 + D5 + D3 ] + [D + 1]

...(8)

Hence the corresponding codeword is given by,


Corel 29

To draw the encoder for the cyclic code :


The given generator polynomial is
G (D) = D2 + 1 = D 2 + 0D + 1

(9)

The general form of the generator polynomial is


G (D) = 1 +

nk1
i
nk

gi (D) + D
i=1

1
G (D) = 1 + gi (D) + D2 = 1 + g1 D + D2
i=1
\

G (D) = D2 + g1D + 1

Comparing Equations (9) and (10) we get, g1 = 0, g2 = 1.


Therefore the encoder is as shown in Fig. P. 7.14.7.

Fig. P. 7.14.7 : Encoder for the cyclic code

...(10)

Digital Communication (GTU)


Ex. 7.14.8 :

7-33

Error Correcting Codes

Determine the encoded message for the following 8 bit data coders using the following
CRC generating polynomial.
4

P (x) = x + x + x
1.

11001100

2.

01011111

.Page No. 7-77.

Soln. :
Part 1 :

The given message is 1 1 0 0 1 1 0 0. That means there are 8 message bits.


\k = 8

The degree of generator polynomial is equal to the number of parity (check) bits in the code.
\

Number of parity bits (n k) = 4


\

Codeword length

n = 8 + 4 = 12

The message polynomial corresponding to the message 1 1 0 0 1 1 0 0 is given by,


7

nk

i.e. x

M (x) = x + x + 0x + 0x + x + x + 0x + 0
\

M (x) = x + x + x + x

Generator polynomial is given by,


P (x) = x + x + 1

Multiply the message polynomial by x


\
\

4
6

x [ M (x)] = x [ x + x + x + x ]
4

11

10

x M (x) = x + x + x + x

Divide x M (x) by the generator polynomial as follows.

Corel A

Digital Communication (GTU)

7-34

Error Correcting Codes

To obtain the codeword polynomial X (x).


4

X (x) = x M (x) + B (x)


11

10

= (x + x + x + x ) + (x + x + x + 1)
\ X (x) = x + x + 0x + 0x + x + x + 0x + 0x + x + x + x + 1
11

10

Hence the codeword is,

Ans

Part 2 :
Similarly we can obtain the codeword for the other message. The corresponding codeword for the
message 01011111 is,
Ans

Ex. 7.14.9 :

Using the generator polynomial g (x) = 1 + x + x generate the systematic and


nonsystematic cyclic codewords for the message vectors 1011 and 1001.
.Page No. 7-77.

Soln. :
Part I : To obtain the nonsystematic code vectors

The number of message bits = k = 4.


The number of parity bits = (n k) = degree of generator polynomial = 3.
The total number of bits per codeword n = 4 + 3 = 7.

The message polynomial for the message vector 1011 is,


2

M (x) = m0 + m1 x + m2 x + m3 x

...(1)

Substituting the values of m0..., m3 we get,


2

M (x) = 1 + x + x

The generator polynomial is given by,


g (x) = 1 + x + x

The nonsystematic cyclic codeword polynomial is given by :


X (x) = M (x) g (x)

...(2)

Digital Communication (GTU)

7-35

Error Correcting Codes

= (1 + x2 + x3 ) (1 + x2 + x3 )
= 1 + x2 + x3 + x2 + x4 + x5 + x3 + x5 + x6
2

= 1 + x (1 + 1) + x (1 + 1) + x + x (1 + 1) + x
But 1 + 1 = 0 ... Modulo-2 addition.
4

X (x) = 1 + x + x

Note that the degree of the codeword polynomial is 6 i.e. (n 1). The codeword is given by,
X = (1 0 0 0 1 1 1)

...Ans.

This is the nonsystematic codeword for the message 1011.


Part II : To obtain the systematic code vector
Step 1 :

nk

nk

M (x) = x3 [1+ x2 + x3]

Multiply M (x) by x
\

= x3 + x5 + x6
Step 2 :

Divide x

nk

M (x) by the generator polynomial :

The division is as follows :


3

x
3

x +x +1

x +x +x
x +x +x

0 0 0
Remainder B (D)
X
(x)
Step 3 : Obtain the codeword polynomial
:
nk
M (D) to the remainder polynomial
The codeword polynomial can be obtained by adding D
B (x).
\ X (x) = [ x

nk

M (x) ] B (x)

= [ x + x + 0x + x + 0x + 0x + 0] [ 0 + 0 + 0]
6

= [ 0 + 0x + 0x + x + 0x + x + x ]

Digital Communication (GTU)

7-36

Error Correcting Codes

Hence the codeword is given by,


Corel G

Ex. 7.14.10 :

Sketch

the
2

encoder

and

syndrome

calculator

for

the

generator

polynomial

g (x) = 1 + x + x , and obtain the syndrome for the received codeword 1001011.
.Page No. 7-77.

Soln. :
Part I : To draw the encoder

The received code word has 7 bits hence n = 7 and the degree of generator polynomial is 3 hence
n k = 3, so k = 4. Thus the given code is a (7, 4) cyclic code.

The generator polynomial of an (n, k) cyclic code is expressed as,


nk1
i
nk

g (x) = 1 +
gi x + x
i=1
\

3 1
i
3
g (x) = 1 + gi x + x
i=1

2
3
g (x) = 1 + g1 x + g2 x + x

...(1)

The given generator polynomial is,


2
3
g (x) = 1 + 0x + x + x

Comparing Equations (1) and (2) we get,


g1 = 0, g2 = 1
Hence the encoder is as shown in Fig. P. 7.14.10(a).

Fig. P. 7.14.10(a) : Encoder

...(2)

Digital Communication (GTU)

7-37

Error Correcting Codes

Part II : Syndrome calculator

The given generator polynomial is,


2
3
g (x) = 1 + x + x
3
2
g (x) = x + x + 0x + 1

...(3)

The general form of generator polynomial is,


3
2
g (x) = x + g2 x + g1 x + 1

..(4)

Comparing Equations (3) and (4) we get,


g1 = 0, g2 = 1
The syndrome calculator is shown in Fig. P. 7.14.10(b).

Fig. P. 7.14.10(b) : Syndrome calculator


Part III : Calculation of syndrome

The output switch of Fig. P. 7.14.10(b) will be initially in position 1 until all the 7 bits of the
received signal Y are shifted into the register.
After that, the output switch is shifted to position 2. Clock pulses are then applied to the shift
register to output the syndrome vector S.
Table P. 7.14.10 explains the process of syndrome generation.
Table P. 7.14.10

Thus the required syndrome is,


S = 100

...Ans.

Digital Communication (GTU)


Ex. 7.14.11 :

7-38

Error Correcting Codes

The generator polynomial of a (15, 11) Hamming code is given by :


4

g (x) = 1 + x + x

Develop encoder and syndrome calculator for this code using systematic form.
.Page No. 7-77.

Soln. :
Encoder :
4

The given code is (15, 11) Hamming code. With the generator polynomial g (x) = 1 + x + x . As
this is a (n, k) block code,
n = 15,
\

k = 11

nk = 4

The given generator polynomial can be expressed as 4

...(1)

g (D) = D + g3 D + g2 D + g1 D + 1

...(2)

g (D) = 1 + D + D = D + 0D + 0D + D + 1
Generally the generator polynomial is given by
4

Comparing Equations (1) and (2) we get,


g3 = 0,
g2 = 0 and g1 = 1.
g2

Therefore the block diagram of (15, 11) Hamming encoder is as shown in Fig. P. 7.14.11(a). g1,
and g3 are multiplying coefficients. As g3 = g2 = 0 the corresponding links are open while g1 = 1

represents a shortlink.

Fig. P. 7.14.11(a) : Encoder for the (15, 11) Hamming code


Syndrome calculator :
The syndrome calculator for a generalized (n, k) code is as shown in Fig. 7.13.4 (refer
section 7.13.14) and the (15, 11) Hamming code is as shown in Fig. P. 7.14.11(b).

Digital Communication (GTU)

7-39

Error Correcting Codes

Fig. P. 7.14.11(b) : Syndrome calculator for (15, 11) Hamming code


The flip-flops connected in Fig. P. 7.14.11(b) contain the four bit syndrome vector. The switch
on the output side is kept in position 1 initially and all the bits of the received codeword Y are shifted
into the shift register. Then shift the output switch to position 2 to output the syndromes.

Section 7.16 :
Ex. 7.16.3 :

Determine the state diagram for the convolutional encoder shown in Fig. P. 7.16.3(a).
Draw the Trellis diagram through the first set of steady state transitions. On the second
Trellis diagram, show the termination of the Trellis to all-zero state.

Fig. P. 7.16.3(a)
Soln. :

Fig. P. 7.16.3(b) : Given encoder redrawn

.Page No. 7-103.

Digital Communication (GTU)

1.

7-40

Error Correcting Codes

Assume that all the registers have been cleared so S1, S2 and S3 contain zeros in the beginning.
(1)

x1 = x i = S1 S2 S3

2.

...(1)

(2)

and

x2 = x i = S1 S3

and the encoder output

= x1 x2.

...(2)

If the initial state is S3 S2 = 00 and if S1 = 0 then


Output

x1 = 0 0 0 = 0

and

x2 = 0 0 = 0
\ x1 x2 = 00 ... if S1 = 0

But if

Next state S3 S2 = 00

S1 = 1 then
x1 = 1 0 0 = 1

and

x2 = 1 0 = 1
\ x1 x2 = 11 ... if S1 = 1

Next state S3 S2 = 01

If we define the four different states as :


00 = a, 01 = b, 10 = c and 11 = d
Then the state diagram is as shown in Fig. P. 7.16.3(c).

Fig. P. 7.16.3(c) : State diagram of the given decoder

Digital Communication (GTU)

7-41

Error Correcting Codes

The code trellis in the steady state transition is as shown in Fig. P. 7.16.3(d).

Fig. P. 7.16.3(d)
Ex. 7.16.4 :

The encoder shown in Fig. P. 7.16.4(a) generates an all zero sequence which is sent over
a binary symmetric channel. The received sequence 01001000.... There are two errors in
this sequence (at second and fifth position). Show that this double error detection is
possible with correction by application of viterbi algorithm.

.Page No. 7-103.

Fig. P. 7.16.4(a)
Soln. : The trellis diagram for the encoder shown in Fig. P. 7.16.4(a) is shown in Fig. P. 7.16.4(b).

Fig. P. 7.16.4(b) : The trellis diagram

Digital Communication (GTU)

7-42

Error Correcting Codes

From these trellis diagram we have drawn the Viterbi decoding diagram of Fig. P. 7.16.4(c). The
input signal Y = 01 00 10 00....

Fig. P. 7.16.4(c) : Viterbi diagram


From the Viterbi diagram let us write the possible paths for each state a4, b4, c4 and d4 and the
running path metric for each path is as shown below.
State
a4

Possible paths
a0 a1 a2 a3 a4
a0 a1 b 2 c3 a4

b4

a0 a1 a2 a3 b 4

a0 b 1 c2 a3 b 4

a0 b 1 d 2 c3 b 4

a0 a1 b 2 c3 b 4

a0 a1 a2 b 3 c4

a0 b 1 c2 b 3 c4

a0 b 1 d 2 d 3 c4

a0 a1 b 2 d 3 c4

a0 a1 a2 b 3 d 4

a0 b 1 c2 b 3 d 4

a0 b 1 d 2 d 3 d 4

a0 a1 b 2 d 3 d 4

c4

d4

Running path metric


2

Digital Communication (GTU)

7-43

Error Correcting Codes

Out of the possible paths listed above, we select four survivor paths having the minimum value
of running path metric. The survivor paths are marked by () sign. They are :
Path

Path Metric

a4 a0 a1 a2 a 3 a4

b 4 a0 a1 b 2 c 3 b 4

c4 a0 a1 a2 b 3 c4

d 4 a0 a1 a2 b 3 d 4

Out of these survivor paths, the path having minimum running path metric equal to 2 i.e. the path
(a0 a1 a2 a3 a4 ) . Hence the encoded signal corresponding to this path is
a4 00 00 00 00.
This is corresponding to the received signal 01 00 10 00.

Corel 26

This shows that Viterbi algorithm could correct the errors present in the received signal.
Ex. 7.16.5 :

Fig. P. 7.16.5(a) depicts a rate 1/2, constraint length N = 2, convolutional code encoder.
Sketch the code tree for the same.

.Page No. 7-103.

Fig. P. 7.16.5(a)
Soln. :
1.
The constraint length k = 2 and its rate is 1/2. That means for a single input binary bit, two bits
V1 and V2 are encoded at the output.
2.
S1 acts as input and S2 acts as the state. For S2, there are two possible values.
S2 = 0

...state a

S2 = 1

...state b

Digital Communication (GTU)

3.

7-44

Error Correcting Codes

Assume that S1 and S2 both are zero. From Fig. P. 7.16.5(a) we can write that,
V1 = S1

...(1)

V2 = S1 S2

and

Step 1 : To obtain the state diagram :


Before obtaining the code tree, we have to draw the state diagram, as follows.
1.

Let the initial contents S1 S2 = 00


State

2.

S1

S2

\ Encoder state = 0 = a & encoder output


V1 = S1 = 0
V2 = S1 + S2 = 0

Now assume that a 0 is applied at the input. Then the next state is also 0 as shown in
Fig. P. 7.16.5(b). The state remains the same i.e. a and the encoder outputs are V1 = 0 and
V2 = 0.

Fig. P. 7.16.5(b)
3.

Now if the present state of the encoder is a and if the input is 1 then contents S1 S2 = 10.
With input 1 the next state of the encoder will be b and V1 = V2 = 1 as shown in
Fig. P. 7.16.5(c).

Fig. P. 7.16.5(c)
4.

Similarly we can obtain the outputs and states for the other possible states as shown in
Figs. P. 7.16.5(d) and (e).
Taking the Figs. P. 7.16.5(b), (c), (d) and (e) into consideration we can draw the state diagram as

shown in Fig. P. 7.16.5(f).


The code tree is as shown in Fig. P. 7.16.5(g). It is drawn by referring to the state diagram in
Fig. P. 7.16.5(f).

Digital Communication (GTU)

7-45

Fig. 7.16.5

(f) State diagram


(g) Code tree for the encoder of Fig. P. 7.16.5(a)

Fig. P. 7.16.5

Error Correcting Codes

Digital Communication (GTU)


Ex. 7.16.6 :

7-46

Error Correcting Codes

For the input sequences from 0000 to 1111 and the circuit in Fig. P. 7.16.6(a) determine
the output sequence.

.Page No. 7-104.

Fig. P. 7.16.6(a)
Soln. :
Steps to be followed :
Step 1 :

Assume that shift register contents are 000 initially.

Step 2 :
Step 3 :

Assume that input message is 0001.


Obtain the values of V1 and V2 for each input bit.

Step 4 :

Interleave the V1 and V2 bits to obtain the output sequence.

The solution is shown in Figs. P. 7.16.6(b) to P. 7.16.6(e).

Digital Communication (GTU)

7-47

Fig. P. 7.16.6

Error Correcting Codes

Digital Communication (GTU)


Ex. 7.16.7 :

7-48

Error Correcting Codes

For the given coder shown in Fig. P. 7.16.7(a) obtain the convolutional code for the bit
sequence 1 1 0 1 1 0 1 1 and decode it by constructing the corresponding code tree.
.Page No. 7-104.

Fig. P. 7.16.7(a)
Soln. :
Part I :

For obtaining the convolutional code for the bit sequence 1 1 0 1 1 0 1 1 refer Ex. 7.16.7.

Part II :

The code tree for the given encoder is shown in Fig. P. 7.16.7(b).

Fig. P. 7.16.7(b) : Code tree for Ex. 7.16.7

Digital Communication (GTU)

7-49

Error Correcting Codes

Follow the path showed by the thick arrows in the code tree of Fig. P. 7.16.7(b). The encircled
numbers indicate the outputs V2 V1. Table P. 7.16.7 shows the input bits, state of the encoder, next state
and encoder output.
Table P. 7.16.7
Input bit

Encoder state
m2

m1

Next state
m2

m1

Output
V1

V2

Entries

Hence the encoder output will be given by,


Encoder output = V2 V1 V2 V1 V2 V1 .......
Substituting the values of V2 V1 from Table P. 7.16.7 we can write,
Encoder output = 10 00 10 10 00 10 10 11
Ex. 7.16.8 :

Calculate the code efficiency and code rate for the system given in the previous example.
.Page No. 7-104.

Soln. :
The code efficiency and code rate are one and the same.
Code rate = Code efficiency =

k
n

Where k =Number of message bits in a codeword.


n =Number of transmitted bits.
For the encoder given in the previous example, for every input message bit, two encoded bits
V1 and V2 are transmitted.
\
Ex. 7.16.9 :

Code rate = Code efficiency =

1
2

...Ans.

A convolutional encoder has a single shift register with two stages, three modulo-2
address, and an output multiplexer. The generator sequences of the encoder are as
follows :
g

(1 )

= (1, 0, 1), g

(2 )

(3 )

= (1, 1, 0) and g

= (1, 1, 1)

Draw the block diagram of the encoder.

.Page No. 7-104.

Digital Communication (GTU)

7-50

Error Correcting Codes

Soln. :
The generator sequences of the convolutional encoder are given.
The convolutional encoder is shown in Fig. P. 7.16.9.

Fig. P. 7.16.9 : Encoder


Ex. 7.16.10 :

For the convolutional encoder shown in Fig. P. 7.16.10(a), sketch the code tree.
.Page No. 7-105.

Fig. P. 7.16.10(a)
Soln. :
The values of C1, C2 and C3 are generated, depending on the values of D1, D2 and D3 as follows,
C1 = D1 D2 D3
C2 = D1
and

C3 = D1 D2

The encoder output will be obtained by interleaving the bits C1, C2 and C3 for each message
input.
\ Encoder output = C1 C2 C3 C1 C2 C3 .......

Digital Communication (GTU)

7-51

Error Correcting Codes

Let D1 represent the message input and let D2 D3 represent the state. The states are defined as
follows.
Encoder states :
D3

D2

State
0
0
a
0
1
b
1
0
c
1
1
d
Let the initial contents of the shift register be D1 D2 D3 = 0 0 0 and the initial state is a
If the first message bit is 0 then the shift register contents are 000. Hence the encoder state is 00
and the encoder outputs are C1 C2 C3 = 0 0 0. This is shown in Fig. P. 7.16.10(b).

Fig. P. 7.16.10(b) : Development of code tree

Digital Communication (GTU)

7-52

Error Correcting Codes

By following this procedure we can obtain the complete code tree as shown in Fig. P. 7.16.10(c).

Fig. P. 7.16.10(c) : Code tree


Ex. 7.16.11 :

For the convolutional encoder shown in Fig. P. 7.16.11 find the encoder output produced
by the message sequence 1011110. Construct the code tree and show how it can be
used for finding the encoder output.

.Page No. 7-105.

Digital Communication (GTU)

7-53

Error Correcting Codes

Fig. P. 7.16.11
Soln. :
1.
2.

To find the encoder output follow the procedure given in Ex. 7.15.1.
For the construction of code tree refer section 7.15.7.

Ex. 7.16.12 :

(a)

The generator polynomial of a (7, 4) Cyclic Code is x + x + 1. Construct the


generator matrix for a systematic cyclic code and find the codeword for the
message {1101} using the general matrix.

(b)

Verify by division method.

(c)

A convolutional code is described by


g1 = [110], g2 = [101], g3 = [111]
1.

Draw the encoder corresponding to this code.

2.

Draw the state transition diagram for this code.

3.

Draw the trellis diagram for this code.

.Page No. 7-105.

Soln. :
Part (a) : To obtain the codewords
Step 1 : To construct the generator matrix :

th

The i row of the generator matrix is given by Equation (7.13.16) as,


(ni)

Ri ( x ) = Qi ( x ) G ( x )

... where i = 1, 2, ... k

...(1)

It is given that the cyclic code is systematic (7, 4) code, \ n = 7, k = 4 and ( n k ) = 3


Substituting these values into the above expression, we get,
(7i)

Ri ( x ) = Qi ( x ) ( x + x + 1) ..... i = 1, 2, ... 9.
3

With i = 1, the above equation is given by,


x Ri ( x ) = Qi ( x ) ( x + x + 1)
6

...(2)

Digital Communication (GTU)

7-54

Error Correcting Codes


(ni)

Let us obtain the value of Qi ( x ). The quotient Qi ( x ) can be obtained by dividing x


by
6
3
G ( x ) as per Equation (7.13.13). Therefore to obtain Qi ( x ), let us divide x by ( x + x + 1). The
division takes place as follows :
Quotient polynomial Qi ( x )

x +x+1
3

x +x+1

x +x +x
Mod - 2

additions
4

x +x
4

x + 0x + x + x
Mod - 2 additions

x +x +x
3

x + 0x + x + 1
Mod - 2 additions


x + 0x + 1 Remainder polynomial Ri ( x )
2

Here the quotient polynomial

Qi ( x ) = x + x + 1

and the remainder polynomial

Ri ( x ) = x + 0x + 1

Substituting these values into Equation (2) we get,


x Ri ( x ) = ( x + x + 1) ( x + x + 1)
6

= x +x +x +x +x +x+x +x+1
= x + 0x + ( 1 1 ) x + ( 1 1 ) x + x + ( 1 1 ) x + 1
6

= x + 0x + 0x + 0x + x + 0x + 1
\ 1st Row Polynomial x + 0x + 0x + 0x + x + 0x + 1
6

\ 1st Row Elements

1000101

Using the same procedure, we can obtain the polynomials for the other rows of the generator
matrix as follows :
2nd Row Polynomial

x +x +x+1

3rd Row Polynomial

x +x +x

4th Row Polynomial

x +x+1

5
4
3

2
2

Digital Communication (GTU)

7-55

Error Correcting Codes

These polynomials can be transformed into the generator matrix as follows :

orel

This is the required generator matrix.


To obtain the parity check matrix [H] :
The parity check matrix is given by :
T

H = [P : I33 ]
T

The transpose matrix P is given by interchanging the rows and columns of the P matrix.

1 1 1 0
P = 0 1 1 1
1 1 0 1 3 4
T

Hence the parity check matrix is given by,

1 1 1 0 : 1 0 0
H = 0 1 1 1 : 0 1 0
1 1 0 1 : 0 0 1 3 7
This is the required parity check matrix.
Step 2 : To obtain the codeword :
The code vectors in the systematic form is obtained as,
X = MG
where M = Message matrix G = Generator matrix

1
0
\ X = [ 1 1 0 1 ] 0

0
1
0
0

0
0
1
0

0
0
0
1

:
:
:
:

1
1
1
0

X = [1 1 0 1 : 0 0 1]
This is the required codeword.
Part (b) : Verification using division method
Step 1 : Obtain the message polynomial M ( x ) :
3

M ( x ) = m3 x + m2 x + m1 x + 1
\

M(x) = x +x +1

0
1
1
1

1
1
0
1
...Ans.

Digital Communication (GTU)

7-56
(nk)

Step 2 : Multiply M ( x ) by x

here
\

Error Correcting Codes

:
nk = 3

x M ( x ) = x ( x + x + 1) = x + x + x

Step 3 : Perform the division :


3

Divide x M ( x ) by G ( x )
3

x +x +x+1
3

x + 0x + x + 1

x + x + 0x + x + 0x + 0x + 0
6

x + 0x + x + x

x + x + 0x + 0x
5

x + 0x + x + x

x + x + x + 0x
4

x + 0x + x + x

x + 0x + x + 0
x + 0x + x + 1

Remainder

The remainder polynomial B ( x ) = 1


Step 4 : Write the codeword polynomial :
nk

M ( x ) + B ( x ) = (x + x + 0x + x + 0x + 0x + 0 ) + 1

X(x) = x

X ( x ) = x + x + 0x + x + 0x + 0x + 1
\

Codeword X = (1 1 0 1 0 0 1)

This is same as the codevector obtained in part (a).


Part (c) : To draw the convolutional encoder
Given that

g1 = [110], g2 = [101], g3 = [111]

...Ans.

Digital Communication (GTU)

7-57

Error Correcting Codes

The required encoder is shown in Fig. P. 7.16.12.

Fig. P. 7.16.12 : Convolutional encoder

Section 7.17 :
Ex. 7.17.2 :

For the convolutional encoder shown in Fig. P. 7.17.2(a), use Viterbi algorithm to decode
the encoded sequence 10, 11, 11, 11, 01.
.Page No. 7-110.

Fig. P. 7.17.2 (a) : Convolutional encoder


Soln. :
Step 1 : Encoder operation
Table P. 7.17.2 (a) : Encoder operation
Input m0
Initially 0
0
1
0
1
0
1
0
1

Current
state m1 m2
00
0 0 (a)
0 0 (a)
0 1 (b)
0 1 (b)
1 0 (c)
1 0 (c)
1 1 (d)
1 1 (d)

Next state
m1 m2
0 0 (a)
1 0 (c)
0 0 (a)
1 0 (c)
0 1 (b)
1 1 (d)
0 1 (b)
1 1 (d)

Output
x1 x2
00
00
10
01
11
11
01
10
00

Digital Communication (GTU)

7-58

Error Correcting Codes

Step 2 : Trellis diagram :

Fig. P. 7.17.2 (b) Trellis diagram


Viterbi decoding :
Step 1 : Received signal Y = 10 (First block) :

We will refer to the trellis diagram of Fig. P. 7.17.2 (b).


Consider the first block of received signal Y = 10.
Now draw the trellis diagram for the first input bit
as shown in Fig. P. 7.17.2 (c) and write X = 00 or
X = 10 and Y = 10 on the diagram.
Note that a0 represents the current state while a1, c1
represent the next state.
Fig. P. 7.17.2(c) : First step in
Viterbi algorithm

Now write the Branch Metric which are the numbers written in brackets in Fig. P. 7.17.2 (c).
These are obtained by taking difference between X and Y. So branch metric for branch a0 a1 is
(1) and that of branch a0 c1 is (0).

Then write the Running Path Metrics which are the encircled numbers in Fig. P. 7.17.2 (c).
These are obtained by summing the branch metric from a0. Hence the running path metric of
branch a0 a1 = 0 + 1 = 1 and that of the branch a0 c1 is 0.

Step 2 : Received signal Y = 11 (Second block) :


Fig. P. 7.17.2(d) shows the second step in Viterbi algorithm corresponding to second block
Y = 11 in the received signal.

Fig. P. 7.17.2(d) : Second step in Viterbi algorithm

Digital Communication (GTU)

7-59

Error Correcting Codes

Step 3 : Complete the viterbi diagram :

Fig. P. 7.17.2(e) : Complete Viterbi diagram


We can proceed in the same manner to obtain the final Vierbi diagram as shown in
Fig. P. 7.17.2(e).
Step 4 : Maximum likelihood path

We have to choose a path which has the smallest value of running metric and the received signal
should be decoded along this path.
As shown in Fig. P. 7.17.2(e) there is one path having "0" running matrix. We choose this path
a0 c 1 b 2 c 3 b 4 a 5
Which is shaded path in Fig. P. 7.17.2(e).
If we travel along this path, then the decoded signal is
1 0 1 0 0
A zero metric path indicates that there are no errors in the received signal.

Section 7.23 :
Ex. 7.23.1 :

1
State diagram of a rate 3 convolutional encoder is shown below :

Fig. P. 7.23.1(a)
Draw trellis diagram to find code word if input sequence is 101011.

.Page No. 7-119.

Digital Communication (GTU)

7-60

Error Correcting Codes

Soln. :
Step 1 :
Draw the trellis diagram :
Fig. P. 7.23.1(b) shows the trellis diagram.

Fig. P. 7.23.1(b) : Trellis diagram


Step 2 :
To find the code word for input = 101011
To find the code word, refer Fig. P. 7.23.1 (c)
1

Encoder input

S0

State

S1
111

Output

S2

S1

111

001

S2
111

1
S1

001

S3
000

Fig. P. 7.23.1(c)

Hence for input 101011 the code word produced is


X = 000

Ex. 7.23.2 :

000

110

000

001

000 .....

Generator vectors for a rate 1/3 convolutional encoder are


g

(1)

= 1 1 0, g

(2)

= 1 0 1, g

(3)

=111

Draw block diagram of encoder, construct encoder matrix and determine code words if
input vectors are (111) and (1011).

.Page No. 7-119.

Soln. :
Step 1 :

Block diagram of encoder :


Given g =1 1 0 \
(1)

\
(3)

(2)

(1)

(1)

(1)

g0 g1 g2
(2)

(2)

(2)

=1 0 1 \ g 0 g 1 g 2
(3)

(3)

(3)

= 111\ g0 g1 g2

110

101

111

Digital Communication (GTU)

7-61

Error Correcting Codes

The convolutional encoder is shown in Fig. P. 7.23.2.

Fig. P. 7.23.2
Step 2 :
Obtain the code words :
1.
Code word for the input vector 1 1 1
From Fig. P. 7.23.2 we get
(1)

(1)

(2)

(2)

(3)

(3)

V1 = g 0 m0 g 1 m1 = m0 m1
V2 = g 0 m0 g 2 m2 = m0 m2
(3)

V3 = g 0 m0 g 1 m1 g 2 m2 = m0 m1 m2
2.

The code word will be X = V1 V2 V3, V1 V2 V3,


Initially let m0 m1 m2 = 000
\

3.

V1 V2 V3 = 000

After 1st clock pulse, m0 m1 m2 = 1 0 0


\ V1 = m0 m1 = 1 0 = 1
V2 = m0 m2 = 1 0 = 1
and
\

4.

V3 = m0 m1 m2 = 1 0 0 = 1
V1 V2 V3 = 1 1 1

nd

After 2 clock pulse, m0 m1 m2 = 1 1 0


\

V1 V2 V3 = 0 1 0

Digital Communication (GTU)

5.

7-62

Error Correcting Codes

After 3rd clock pulse, m0 m1 m2 = 1 1 1


\
\

V1 V2 V3 = 0 0 1

Code word X = 000, 111, 010, 001

...Ans.

Similarly we can obtain the code word for 1011


Ex. 7.23.3 :

Generator vectors for a rate 1/3 convolutional encoder are :


g1 = (100), g2 = (101), g3 = (111)
1.

Draw encoder diagram

2.

Draw trellis diagram

3.

Using trellis find code vector if message vector is (101100).

4.

Using trellis, find message vector if third bit of code vector in Ex. 7.23.3 is in error.
.Page No. 7-119.

Soln. :
Step 1 :
Draw the encoder block diagram :
Fig. P. 7.23.3 shows the encoder block diagram.

Fig. P. 7.23.3
Step 2 :

Trellis diagram :
Let m0 m1 m2 = 000 initially
Encoder outputs V1 = m0
V2 = m0 m3
V3 = m0 m1 m2

Digital Communication (GTU)

7-63

Error Correcting Codes

Table P. 7.23.3
Input

Initial state

Output

Next State

m0

m1

m2

V1

V2

V3

m0

m1

m2

S0

S0

S0

S4

S4

S2

S4

S6

S2

S1

S2

S5

S1

S1

S1

S4

S5

S2

S5

S6

S6

S3

S6

S7

S3

S1

S3

S5

S7

S3

S7

S7

Referring to the Table P. 7.23.3, we can draw the trellis diagram as shown in Fig. P. 7.23.3(a)

Fig. P. 7.23.3(a) : Trellis diagram

Digital Communication (GTU)

7-64

Error Correcting Codes

Step 3 :
To find the code vector :
Message vector is 101100
1

Input
S0

State

So the output

S4
111

Output

Ex. 7.23.4 :

111

S2
001

001

100

1
S5

100
110

010

S6
110

S3
010

S1
011

011

For the convolutional encoder arrangement shown in Fig. P. 7.23.4(a), draw the state
diagram and trellis diagram. Determine the output digital sequence for the data digits
1 1 0 1 0 1 0 0. What are the dimensions of the code (n, k) and constraint length ? Use
Viterbi algorithm to decode the sequence 100 110 111 101 001 101 001 010.
.Page No. 7-120.

Fig. P. 7.23.4(a)
Soln. :
Part I :
We assume that s1 represents the current message bit while s2 s3 represent the state. So there
will be in all four states 00(a), 01(b), 10(c) and 11(d) for this encoder.

Let the output codeword be x1 x2 where


X1 = s1 s3 and x2 = s1 s2.

Initially let s1 = s2 = s3 = 0. So x1 and x2 also will be zero.

Step 1 : Prepare a table showing encoder operation :


Table P. 7.23.4(a)
Initially

Incoming bit s1

Current state s2 s3

Next state s2 s3

Code word x1 x2

0
0
1
0
1
0
1
0
1

00
0 0 (a)
0 0 (a)
0 1 (b)
0 1 (b)
1 0 (c)
1 0 (c)
1 1 (d)
1 1 (d)

00
0 0 (a)
1 0 (c)
0 0 (a)
1 0 (c)
0 1 (b)
1 1 (d)
0 1 (b)
1 1 (d)

00
00
11
10
01
01
10
11
00

Digital Communication (GTU)

7-65

Error Correcting Codes

Step 2 : Draw the state diagram :


The state diagram of Fig. P. 7.23.4(b) is drawn from Table P. 7.23.4(a).

Fig. 7.23.4(b) : State diagram


Step 3 : Trellis diagram :
Fig. P. 7.23.4(c) shows the trellis diagram :

Fig. P. 7.23.4(c) : Trellis diagram


Step 4 : Determine the output sequence :
Given input sequence 1 1 0 1 0 1 0 0
Let us use the trellis diagram to obtain the output start
from top left corner.
As the 1st input bit is 1 the trellis diagram for the first
bit is as shown in Fig. P. 7.23.4(d) and the output is 11.
Fig. P. 7.23.4(d)
Similarly we can obtain the remaining output codes as shown in Fig. P. 7.23.4(e).
1

Input
state
output

1
c

11

0
d

10

1
b

11

0
c

01

1
b

01

0
c

01

Fig. P. 7.23.4(e) : Output sequence

0
b

01

a
10

Digital Communication (GTU)

7-66

Error Correcting Codes

Thus the coded output is


X = 1110110101010110

For this code n = 2 and k = 1. The constraint length is 2.

Part II : Viterbi decoding :


Since the input sequence is too long, it is not possible to draw the entire viterbi diagram. But we
will demonstrate two to three steps.
Step 1 : Received signal Y = 10 (First block) :

We will refer to the trellis diagram of Fig. P. 7.23.4(b).

Consider the first block of received signal Y = 10.


Now draw the trellis diagram for the first input bit as shown in Fig. P. 7.23.4(f) and write X = 00
or X = 11 and Y = 10 on the diagram.

Fig. P. 7.23.4(f) : First step in Viterbi algorithm

Note that a0 represent the current state while a1, c1 represent the next state.

Now write the Branch Metric which are the numbers written in brackets in Fig. P. 7.23.4(f).
These are obtained by taking difference between X and Y. So branch metric for branch a0 a1 is
(1) and that of branch a0 c1 is also (1).

Then write the Running Path Metric which are the encircled numbers in Fig. P. 7.23.4(f). These
are obtained by summing the branch metric from a0. Hence the running path metric of branch a0
a1 = 0 + 1 = 1 and that of the branch a0 c1 is also 1.

Step 2 : Received signal Y = 01 (Second block) :


Fig. P. 7.23.4(g) shows the second step in viterbi algorithm corresponding to second block
Y = 01 in the received signal.

Fig. P. 7.23.4(g) : Second step in Viterbi

Digital Communication (GTU)

7-67

Error Correcting Codes

Step 3 : Received signal Y = 10 :


Fig. P. 7.23.4(h) shows the Viterbi diagram with
third block of received signal, Y = 10.

Fig. P. 7.23.4(h) : Third step


Step 4 : Decoding :

We have to choose the path having the smallest value of the running metric and decode the
received signal along this path.

As shown in Fig. P. 7.23.4(h) the path having smallest running metric i.e. 1 is (a0 c1 b2 a3)
which is shaded.

By travelling along this path we can obtain the decoded sequence as,
m = 1 0 0 .....
qqq

You might also like