Professional Documents
Culture Documents
7-1
Section 7.10 :
Ex. 7.10.3 :
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.
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)
orel 14
7-2
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.
Corel 15
4.
5.
7-3
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 :
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
1
1
0
1
2.
Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :
Corel 22
1
1
P = 1
0
1
1
1
1
1
0
1 4 3
...(1)
7-4
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
Sr.
No.
7-5
Message vector, M
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 :
H = [ P : In k ]
T
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.
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.
2.
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 ]
7-6
Corel 25
...(2)
...(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
Message
Parity
7-7
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
[ H ]3 7 = [ P | In k ]
T
1 1 1 0
\ P = 0 1 1 1
1 1 0 1 3 4
T
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.
2.
3.
4.
5.
7-8
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 :
1.
2.
Calculate Syndrome S = EH
3.
Step 5 :
Decode the received words with the help of syndromes listed in the decoding table.
...(1)
...(2)
(3)
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.
7-9
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
3 s+1
s2
t1
and
\
3 2t + 1
Step 4 :
7-10
Decoding table :
...(4)
...(5)
P
In k
...(6)
n ( n k)
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).
7-11
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 :
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.
7-12
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 :
Find the generator matrix and the parity check matrix for this code.
2.
3.
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.
7-13
P
d ]P
P
P11 P12
21 P22
31 P32
41 P42
...(1)
P13
P23
P33
P43
P14
P24
P34
P44
(2)
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
1
1
P = 1
1
1
0
1
0
1
1
1
1
0
1
1 4 4
But k = 4
1
0
\ G = 0
0
1
0
0
0
0
1
0
0
0
0
1
:
:
:
:
1
1
1
0
1
1
0
1
0
1
1
1
1
0
1
1
...Ans.
7-14
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
d1
d2
d3
d4
C5
C6
C7
C8
d1
d2
d3
d4
C5
C6
C7
C8
10
11
12
13
14
15
7-15
t 3/2
...Ans.
2.
Let there be three errors introduced. Hence the error vector E is given by.
Corel D
3.
4.
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
7-16
= [ 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
Soln. :
th
...(1)
(n i)
(7 i)
Ri (D) = Qi (D) (D + D + 1)
3
..... i = 1, 2, ... 4.
...(2)
7-17
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 +D
Mod 2 addition
D +D
D + 0D + D + D
Mod 2 addition
D + D + D
3
D + 0D + D + 1
Mod 2 addition
+ 0D + 1
Qi (D)= D + D + 1
Ri (D)= D + 0D + 1
= 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
\
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
D +D +D
D +D+1
5
4
3
2
2
7-18
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
Obtain the code vectors for the (7, 4) code having G (D) = 1 + D + D
Soln. :
1.
The code vectors in the systematic form can be obtained, as follows :
X = MG
Where
2.
...(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 ]
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.
7-19
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 :
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 :
nk
M (D).
2.
The degree of generator polynomial is four. The degree of generator polynomial is equal to the
number of parity bits in the code.
\
3.
k =6
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)
4.
...(2)
G (D) = 1 + 0D + 0D + D + D
5.
...(3)
nk
nk
=D
...(4)
7-20
6.
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.
...(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)
...(8)
X = [101101:0100]
...Ans.
The encoded message consists of 4 check bits or parity bits b3, b2, b1 and b0.
...Ans.
7-21
= D + D + 0D + 0D + 1
...(9)
nk1
i
nk
gi D + D
i=1
...(10)
4
3
2
G (D) = D + g3 D + g2 D + g1 D + 1
(11)
...(12)
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.
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.
7-22
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 :
Step 2 :
Multiply M (D) by D
Step 3 :
Divide D
nk
Step 4 :
Step 1 :
nk
to obtain D
nk
M (D)
7-23
M (D) = 1 + 0D + 0D + D
\ M (D) = 1 + D
Step 2 :
Multiply M (D) by D
nk
...(1)
nk
\ D3 M (D) = D3 + 0 D4 + 0D5 + D6
Step 3 :
Divide D
nk
...(2)
M (D) by G (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
\
Step 4 :
Remainder polynomial
B (D) = D + 0D + 0
...(3)
Codeword polynomial
X (D)
= D M (D) + B (D)
..(4)
7-24
X =
m3
m2
m1
m0
b2
b1
b0
Message
bits
...Ans.
Parity
bits
Section 7.14 :
Ex. 7.14.3 :
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 :
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
7-25
Ex. 7.14.4 :
x +1?
Soln. :
7
Given :
Dividend : x + x + 1 = x + 0x + x + 0x + 0x + 0x + 0x + 1 = 10100001
Divisor :
x + 1 = x + 0x + 0x + 1 = 1001
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 :
Step 2 :
7-26
COREL D
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.
7-27
Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :
Step 5 :
Step 6 :
Step 7 :
Step 8 :
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.
...(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.
Step 4 :
7-28
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
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 :
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.
7-29
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
Y (x) = x + x + x + x
The syndrome vector is given by
S (x) = remainder
Y (x)
G (x)
and
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
7-30
Why are cyclic codes effective in detecting error bursts ? The message 1001001010 is to
2
2.
3.
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 :
M (D) m0 + m1 D + m2 D +
nk
Step 2 :
Multiply M (D) by D
Step 3 :
Divide D
nk
Step 4 :
Step 5 :
1.
2.
to obtain D
nk
M (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.
\
...(4)
7-31
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.
Corel 28
...(6)
7-32
nk
...(7)
X (D) = [ D11 + D8 + D5 + D3 ] + [D + 1]
...(8)
(9)
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
...(10)
7-33
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
Soln. :
Part 1 :
The degree of generator polynomial is equal to the number of parity (check) bits in the code.
\
Codeword length
n = 8 + 4 = 12
nk
i.e. x
M (x) = x + x + 0x + 0x + x + x + 0x + 0
\
M (x) = x + x + x + x
4
6
x [ M (x)] = x [ x + x + x + x ]
4
11
10
x M (x) = x + x + x + x
Corel A
7-34
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
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 :
Soln. :
Part I : To obtain the nonsystematic code vectors
M (x) = m0 + m1 x + m2 x + m3 x
...(1)
M (x) = 1 + x + x
...(2)
7-35
= (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.
nk
nk
Multiply M (x) by x
\
= x3 + x5 + x6
Step 2 :
Divide x
nk
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 ]
7-36
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.
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)
...(2)
7-37
...(3)
..(4)
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
...Ans.
7-38
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
...(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
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.
7-39
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. :
1.
7-40
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
= x1 x2.
...(2)
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
7-41
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.
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).
7-42
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....
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
7-43
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.
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
3.
7-44
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
2.
S1
S2
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
7-45
Fig. 7.16.5
Fig. P. 7.16.5
7-46
For the input sequences from 0000 to 1111 and the circuit in Fig. P. 7.16.6(a) determine
the output sequence.
Fig. P. 7.16.6(a)
Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :
7-47
Fig. P. 7.16.6
7-48
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).
7-49
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
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
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)
7-50
Soln. :
The generator sequences of the convolutional encoder are given.
The convolutional encoder is shown in Fig. P. 7.16.9.
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 .......
7-51
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).
7-52
By following this procedure we can obtain the complete code tree as shown in Fig. P. 7.16.10(c).
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.
7-53
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)
(b)
(c)
2.
3.
Soln. :
Part (a) : To obtain the codewords
Step 1 : To construct the generator matrix :
th
Ri ( x ) = Qi ( x ) G ( x )
...(1)
Ri ( x ) = Qi ( x ) ( x + x + 1) ..... i = 1, 2, ... 9.
3
...(2)
7-54
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
Qi ( x ) = x + x + 1
Ri ( x ) = x + 0x + 1
= 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
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
x +x +x
x +x+1
5
4
3
2
2
7-55
orel
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
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.
7-56
(nk)
Step 2 : Multiply M ( x ) by x
here
\
:
nk = 3
x M ( x ) = x ( x + x + 1) = x + x + x
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
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)
...Ans.
7-57
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.
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
7-58
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.
7-59
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.
7-60
Soln. :
Step 1 :
Draw the trellis diagram :
Fig. P. 7.23.1(b) shows the trellis diagram.
Encoder input
S0
State
S1
111
Output
S2
S1
111
001
S2
111
1
S1
001
S3
000
Fig. P. 7.23.1(c)
Ex. 7.23.2 :
000
110
000
001
000 .....
(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).
Soln. :
Step 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
7-61
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.
3.
V1 V2 V3 = 000
4.
V3 = m0 m1 m2 = 1 0 0 = 1
V1 V2 V3 = 1 1 1
nd
V1 V2 V3 = 0 1 0
5.
7-62
V1 V2 V3 = 0 0 1
...Ans.
2.
3.
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
7-63
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)
7-64
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.
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
7-65
Input
state
output
1
c
11
0
d
10
1
b
11
0
c
01
1
b
01
0
c
01
0
b
01
a
10
7-66
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.
7-67
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