Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
7-1
Section 7.10 :
Ex. 7.10.3 :
Soln. :
Steps to be followed :
Step 1 : Write the expression for syndrome.
Step 2 : Write the various errors vectors.
Step 3 : Then for each error vector, obtain the syndrome vector as : S = EHT.
Step 1 : The syndrome vector is given by :
S = EHT = [E]1 7 [HT]7 3
Syndrome vector will be represented by a 1 3 matrix.
...(1)
orel 14
7-2
1.
2.
3.
| HT |
[ 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,
[ S ] = [ 0 1 0 0 0 0 0]
[ 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).
Table P. 7.10.3(b) : Syndromes for various error vectors
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
matrix HT.
Section 7.11 :
Ex. 7.11.2 :
2.
Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :
Corel 22
Solving, we get,
b0 = m0 m1 m2
b1 = m1 m2 m3
...(1)
7-4
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
10
11
12
13
14
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
15
16
Step 4 :
...Ans.
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 ]
Corel 25
...(2)
...(3)
7-6
Substituting the P matrix from Equation (1) we can obtain the parity bits.
[b0, b1, b2] = [m0, m1, m2, m3]
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.
m0
0
1
0
0
0
0
Message vector
m1
m2
0
0
0
0
1
0
0
1
0
0
1
0
m3
0
0
0
0
1
1
b0
0
1
1
1
0
1
Parity bits
b1
b2
0
0
0
1
1
1
1
0
1
1
0
0
x0
0
1
0
0
0
0
x1
0
0
1
0
0
1
Code vectors
x2
x3
x4
0
0
0
0
0
1
0
0
1
1
0
1
0
1
0
0
1
1
x5
0
0
1
1
1
0
x6
0
1
1
0
1
0
...Ans.
PT
Ex. 7.11.4 :
I3 3
For a systematic linear block code, the three parity check digits, C 4, C5 and C6 are given
by :
C4 = d 1 d 2 d 3
C5 = d 1 d 2
C6 = d 1 d 3
1.
2.
3.
4.
5.
7-8
Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :
1.
2.
3.
Step 5 :
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.
Obtain the decoding table by following the steps given below :
Obtain the transpose of the parity check matrix HT
Calculate Syndrome S = EHT
Write the decoding table.
Decode the received words with the help of syndromes listed in the decoding table.
...(1)
...(2)
(3)
...Ans.
C5 = d1 d2
C6 = d1 d3
7-9
Using these equations we can obtain the check bits for various combinations of the bits d 1, 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 :
Codeword for d1 d2 d3 = 001 =
d1
d2
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.
Message
vector
d1
0
0
0
0
1
1
1
1
1.
2.
3.
4.
5.
6.
7.
8.
d2
0
0
1
1
0
0
1
1
Check bits
d3
0
1
0
1
0
1
0
1
C4
0
1
1
0
1
0
0
1
C5
0
0
1
1
1
1
0
0
C6
0
1
0
1
1
0
1
0
Codevectors or codewords
d1
0
0
0
0
1
1
1
1
d2
0
0
1
1
0
0
1
1
d3
0
1
0
1
0
1
0
1
C4
0
1
1
0
1
0
0
1
C5
0
0
1
1
1
1
0
0
C6
0
1
0
1
1
0
1
0
Code weight
W (X)
0
3
3
4
4
3
3
4
3 s+1
s2
and
3 2t + 1
t1
...(4)
7-10
...(5)
...(6)
...(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 10000]
where the encircled bit shows the bit in error.
Hence the syndrome is given by,
S = EHT = [ 0 1 0 0 0 0 ]
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
second row of the HT matrix. The other syndromes can be obtained directly from the rows of H T. 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
1
0
0
0
0
0
Step 5 :
Syndrome vectors
Relation with HT
0
1
0
1
0
1
1st Row of HT
2nd Row of HT
3d Row of HT
4th Row of HT
5th Row of HT
6th Row of HT
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 HT
= [101100]
= [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 ]
S = [110]
The error pattern corresponding to this syndrome is obtained from the decoding table as
E = [0 1 0 0 0 0]
7-12
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 d1, 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.
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
...(1)
(2)
7-13
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
G =
...Ans.
...Ans.
Sr.
No.
7-14
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
1 1 1 1
1
1
1
1
1 1 1 1
1
1
1
1
8
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
Hence at the most three errors can be detected.
Number of errors that can be corrected.
dmin (2t + 1)
...Ans.
4 (2t + 1)
t 3/2
...Ans.
7-15
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.
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 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
Then
C5 = 0 0 1 = 1
C6 = 0 0 0 = 0
C7 = 0 0 1 = 1
C8 = 0 0 1 = 1
= d1 d2 d3 d4 C5 C6 C7 C8
Corel F
7-16
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.
Given : G (D) = D3 + D + 1
Soln. :
The ith row of the generator matrix is given by Equation (7.13.23) as,
D(n i) Ri (D) = Qi (D) G (D)
...(1)
..... i = 1, 2, ... 4.
...(2)
Let us obtain the value of Qi (D). The quotient Qi (D) can be obtained by dividing D (n i) by
G (D) as per Equation (7.13.20). Therefore to obtain Qi (D), let us divide D6 by (D3 + D + 1).
The division takes place as follows :
D3 + D + 1 Quotient polynomial Qi (D)
D3 + D + 1
D6
D6 + D4 + D3
Mod 2 addition
D + D3
D4 + 0D3 + D2 + D
Mod 2 addition
D + D + D
D3 + 0D2 + D + 1
Mod 2 addition
+ 0D + 1
Qi (D)= D3 + D + 1
Ri (D)= D2 + 0D + 1
7-17
Using the same procedure, we can obtain the polynomials for the other rows of the generator
matrix as follows :
2nd Row Polynomial
D5 + D2 + D + 1
D4 + D2 + D
D3 + D + 1
7-18
Obtain the code vectors for the (7, 4) code having G (D) = 1 + D + D3
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]
X = M G = [1 0 1 0]
X = [1 0 1 0 : 0 1 1 ]
...Ans.
Soln. :
Steps to be followed :
Step 1 :
7-19
M (D) = m0 + m1 D + m2 D2 + m3 D3 + m4 D4 + m5 D5
Step 2 :
Step 3 :
Step 4 :
1.
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.
The message polynomial corresponding to the message 10 11 01= [m 5, m4, m3, m2, m1 m0] is
given as,
M (D) = m0 + m1 D + m2 D2 + m3 D3 + m4 D4 + m5 D5
...(1)
...(2)
5.
...(3)
6.
D4 + D3 + 0D2 + 0D + 1
D9 + 0D8 + D7 + D6 + 0D5 + D4
D9 + D8 + 0D7 + 0D6 + D5
Modulo 2 additions
...(4)
7-20
D8 + D7 + D6 + D5 + D4
D8 + D7 + 0D6 + 0D5 + D4
Modulo 2 additions
D +D
D6 + D5 + 0D4 + 0D3 + D2
Modulo 2 additions
D2 Remainder polynomial
7.
But
Here
...(5)
B (D) = b0 + b1 D + b2 D2 + bn k 1 Dn k 1
...(6)
(n k 1) = (10 6 1) = 3
B (D) = b0 + b1 D + b2 D2 + b3 D3
...(7)
But we have obtained b (D) = D2, 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)
X = [101101:0100]
...Ans.
...Ans.
7-21
...(9)
...(10)
G (D) = D4 + g3 D3 + g2 D2 + 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.
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.
7-22
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 + D2 +D3 for
the message bits 1 0 0 1 and find the checksum for the same.
Soln. :
Steps to be followed :
Step 1 :
Step 2 :
Step 3 :
Step 4 :
Step 1 :
7-23
M (D) = 1 + D3
Step 2 :
...(1)
Multiply M (D) by Dn k :
...(2)
D3 + D2 + D + 1
D3 + D2 + 0D + 1
Modulo - 2 additions
D6 + 0D5 + 0D4 + D3
D6 + D5 + 0D4 + D3
Modulo - 2 additions
D + 0D3 + D2
D4 + D3 + 0D2 + D
Modulo - 2 additions
D +D +D
D3 + D2 + 0D + 1
Modulo - 2 additions
Step 4 :
Remainder polynomial
B (D) = D2 + 0D + 0
...(3)
Codeword polynomial
X (D)
= D3 M (D) + B (D)
..(4)
...Ans.
7-24
X =
m3
m2
m1
m0
b2
b1
b0
Message
bits
Parity
bits
Section 7.14 :
Ex. 7.14.3 :
Soln. :
Given :
Data word : 1 1 0 1 0 1 1 0 1 1
Generator : x4 + x + 1 = x4 + 0 x3 + 0 x2 + x + 1 = 10011
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
The transmitted codeword is as follows :
corel 2
Ex. 7.14.4 :
7-25
Soln. :
Dividend : x7 + x5 + 1 = x7 + 0x6 + x5 + 0x4 + 0x3 + 0x2 + 0x + 1 = 10100001
Given :
Divisor :
x3 + 1 = x3 + 0x2 + 0x + 1 = 1001
A bit stream 10011101 is transmitted using the standard CRC method. The generator
polynomial is x3 + 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
Generator polynomial : x3 + 1 = x3 + 0x2 + 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.
A non zero remainder indicates that there is an error in the received codeword.
Ex. 7.14.6 :
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 :
G =
...Ans.
...(1)
X = [1 0 1 0]
X = [ 1 0 1 0 : 0 1 1]
Message
Parity bits
Similarly we can obtain the code words for other message vectors.
Step 3 : Calculate dmin :
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 PT :
We know that G = [ Ik : Pk (n k)]
Corel 24
P =
The transpose of this matrix can be obtained by interchanging the rows and columns.
PT =
Step 5 : Obtain the parity check matrix H :
The parity check matrix is given by :
H = [ PT : In k]
H =
Step 7 :
HT =
We can prepare the decoding table from the transpose of the parity check matrix. H T because
each row of HT 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 HT
Second row of HT
Third row of HT
Fourth row of HT
Fifth row of HT
Sixth row of HT
Seventh row of HT
Syndrome vector
0
0
0
1
0
1
1
1
1
1
1
0
0
1
1
1
0
0
0
1
0
0
0
1
x6 + x5 + 0x4 + x3 + x2 + 0x + 0
x6 + 0x5 + x4 + x3
Mod - 2 additions
x + x + 0x3 + x2
x5 + 0x4 + x3 + x2
Mod - 2 additions
x + x + 0x2 + 0x
x4 + 0x3 + x2 + x
Mod - 2 additions
x +x +x+0
x3 + 0x2 + x + 1
Mod - 2 additions
x + 0x + 1
Remainder
7-30
Ex. 7.14.7 :
= [ 1 1 0 1 1 0 0 ] [ 1 0 0 0 0 0 0]
X = [ 0 1 0 1 1 0 0]
...Ans.
Why are cyclic codes effective in detecting error bursts ? The message 1001001010 is to
be transmitted in a cyclic code with a generator polynomial g (x) = x2 + 1.
1.
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 :
Step 2 :
Step 3 :
Step 4 :
Step 5 :
1.
2.
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,
M (D) = m0 + m1 D + m2 D2 + m3 D3 + m4 D4 + m5 D5 + m6 D6 + m7 D7 + m8 D8 + m9 D9
= 0 + D + 0D2 + 1D3 + 0D4 + 0D5 + 1D6 + 0D7 + 0D8 + 1D9
M (D) = D9 + D6 + D3 + D
...(2)
The generator polynomial is,
G (D) = D2 + 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.
...(5)
Dn k M (D) = D2 [D9 + D6 + D3 + D]
= D11 + D8 + D5 + D3
4.
Corel 28
...(6)
7-32
...(7)
X (D) = [ D11 + D8 + D5 + D3 ] + [D + 1]
...(8)
(9)
G (D) = D2 + g1D + 1
...(10)
Determine the encoded message for the following 8 bit data coders using the following
CRC generating polynomial.
7-33
P (x) = x4 + x3 + x0
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
M (x) = x7 + x6 + x3 + x2
x4 [ M (x)] = x4 [ x7 + x6 + x3 + x2 ]
x4 M (x) = x11 + x10 + x7 + x6
Corel A
7-34
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
...(1)
...(2)
7-35
= 1 + x2 (1 + 1) + x3 (1 + 1) + x4 + x5 (1 + 1) + x6
But 1 + 1 = 0 ... Modulo-2 addition.
X (x) = 1 + x4 + x6
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.
Multiply M (x) by xn k :
Step 2 :
x6 + x5 + x3
x6 + x5 + x3
Remainder B (D)
0 0 0
Step 3 : Obtain the codeword polynomial X (x) :
The codeword polynomial can be obtained by adding D n k M (D) to the remainder polynomial
B (x).
X (x) = [ xn k M (x) ] B (x)
= [ x6 + x5 + 0x4 + x3 + 0x2 + 0x + 0] [ 0 + 0 + 0]
= [ 0 + 0x + 0x2 + x3 + 0x4 + x5 + x6]
7-36
Ex. 7.14.10 :
Sketch the encoder and syndrome calculator for the generator polynomial
g (x) = 1 + x2 + x3, 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 xi + x3
g (x) = 1 + g1 x + g2 x2 + x3
...(1)
...(2)
7-37
g (x) = 1 + x2 + x3
g (x) = x3 + x2 + 0x + 1
...(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 + x4
Develop encoder and syndrome calculator for this code using systematic form.
.Page No. 7-77.
Soln. :
Encoder :
The given code is (15, 11) Hamming code. With the generator polynomial g (x) = 1 + x + x 4. As
this is a (n, k) block code,
n = 15,
k = 11
nk = 4
...(1)
...(2)
g2 = 0
and
g1 = 1.
Therefore the block diagram of (15, 11) Hamming encoder is as shown in Fig. P. 7.14.11(a). g 1, g2
and g3 are multiplying coefficients. As g 3 = g2 = 0 the corresponding links are open while g 1 = 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. :
Assume that all the registers have been cleared so S1, S2 and S3 contain zeros in the beginning.
x1 = = S1 S2 S3
...(1)
2.
7-40
and
x2 = = 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
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
c4
d4
Possible paths
a0 a1 a2 a3 a4
a0 a1 b2 c3 a4
a0 a1 a2 a3 b4
a0 b1 c2 a3 b4
a0 b1 d2 c3 b4
a0 a1 b2 c3 b4
a0 a1 a2 b3 c4
a0 b1 c2 b3 c4
a0 b1 d2 d3 c4
a0 a1 b2 d3 c4
a0 a1 a2 b3 d4
a0 b1 c2 b3 d4
a0 b1 d2 d3 d4
a0 a1 b2 d3 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 a3 a4
b4 a0 a1 b2 c3 b4
c4 a0 a1 a2 b3 c4
d4 a0 a1 a2 b3 d4
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
and
...(1)
V2 = S1 S2
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 V 1 = 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 S 1 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 =
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 :
...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 ) = (1, 1, 0) and g(3 ) = (1, 1, 1)
Draw the block diagram of the encoder.
Soln. :
The generator sequences of the convolutional encoder are given.
7-50
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 C 1, C2 and C3 for each message
input.
Encoder output = C1 C2 C3 C1 C2 C3 .......
Let D1 represent the message input and let D2 D3 represent the state. The states are defined as
follows.
7-51
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
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 :
The ith row of the generator matrix is given by Equation (7.13.16) as,
x( n i ) Ri ( x ) = Qi ( x ) G ( x )
...(1)
= Qi ( x ) ( x3 + x + 1) ..... i = 1, 2, ... 9.
= Qi ( x ) ( x3 + x + 1)
...(2)
7-54
x6
x6 + x4 + x3
Mod - 2
additions
x4 + x3
x4 + 0x3 + x2 + x
Mod - 2 additions
x +x +x
x3 + 0x2 + x + 1
Mod - 2 additions
x + 0x + 1 Remainder polynomial Ri ( x )
2
Qi ( x ) = x3 + x + 1
Ri ( x ) = x2 + 0x + 1
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
x5 + x2 + x + 1
x4 + x2 + x
x3 + x + 1
7-55
orel
X = [1101]
X = [1 1 0 1 : 0 0 1]
M ( x ) = x3 + x2 + 1
Step 2 : Multiply M ( x ) by x( n k ) :
here
nk = 3
x3 M ( x ) = x3 ( x3 + x2 + 1) = x6 + x5 + x3
...Ans.
7-56
x6 + x5 + 0x4 + x3 + 0x2 + 0x + 0
x6 + 0x5 + x4 + x3
x + x + 0x3 + 0x2
x5 + 0x4 + x3 + x2
x + x + x + 0x
x4 + 0x3 + x2 + x
x + 0x + x + 0
x3 + 0x2 + x + 1
Remainder
X(x)
X(x)
= x6 + x5 + 0x4 + x3 + 0x2 + 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 a 0 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 a 0. Hence the running path metric of branch a 0
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 c1 b2 c3 b4 a5
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 :
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.
S0
S1
Output
S2
111
111
S1
001
S2
111
1
S1
001
S3
000
Fig. P. 7.23.1(c)
Ex. 7.23.2 :
000
110
000
001
000 .....
Soln. :
Step 1 :
110
101
g(2) =1 0 1
g(3) = 1 1 1
= 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
V1 = m0 m1 = m0 m1
V2 = m0 m2 = m0 m2
V3 = m0 m1 m2 = m0 m1 m2
2.
3.
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
Input
State
S0
Output
=
S4
111
So the output
Ex. 7.23.4 :
111
S2
001
001
100
1
S5
100
110
010
0
S6
110
0
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 s 2 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
0
0
1
0
1
0
1
0
1
Current state s2 s3
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 s2 s3
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)
Code word x1 x2
00
00
11
10
01
01
10
11
00
7-65
1
a
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 a 0 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 a 0. Hence the running path metric of branch a 0
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 (a 0 c1 b2 a3)
which is shaded.
By travelling along this path we can obtain the decoded sequence as,
m = 1 0 0 .....