advantages of cyclic codes , application Encoder for Cyclic Codes , disadvantages of cyclic codes :-

**EXAMPLE 10.23. Obtain the code vectors for the (7, 4) code having G(p) = 1 + p + p ^{3} **

**Solution :**(i) The code vectors in the systematic form can be obtained as under :

X =MG … (i)

where M = Message matrix

and G = Generator matrix.

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

M[m

_{3}m

_{2}m

_{1}m

_{0}] = [1 0 1 0]

Therefore, X = MG = [1 0 1 0]

**equation**

Therefore, X = [1 0 1 0: 0 1 1].

**Ans.**

This is the required code word.

**10.14.7. Encoder for Cyclic Codes**

**diagram**

**FIGURE 10.34**

*Symbols used in the block diagram of encoder of cyclic codes.*

**Working operation of the encoder**

The flip-flops (F/F) of figure 10.36 are used to construct a shift register. Operation of all these flip-flops is governed by an external clock, which is not shown in figure 10.36. The flip-flop contents will get shifted in the direction of the arrow corresponding to each clock pulse. The feedback switch is closed and the output switch is connected to the message input. All the flip-flops are initialized to zero state. First

*k*message bits are shifted to the transmitter and also shifted into the shift register. After shifting the

*k*message bits the shift register will contain the (n – k) parity (or check) bits. Therefore after shifting the

*k*Message bits Parity bits message bits, the feedback switch is open circuited and the output switch is thrown to parity bit position. Now with every shift, the parity bits are transmitted over he channel. Thus this encoder generates the code words in the format shown in figure 10.35.

**diagram**

**FIGURE 10.35**

*Format of the code word.*

The encoder thus performs the division operations and generates the remainder. The remainder is nothing but the parity bits. When all the message bits are shifted out, what remains inside the shift register is remainder.

The encoder also consists of modulo-2 adders. The output of the coefficient multipliers i.e., g

_{1}, g

_{2}…. etc. are added to the flip-flop outputs to generate the parity bits.

**DIAGRAM**

**FIGURE 10.36**

*Encoder for an (n, k) cyclic code.*

**EXAMPLE 10.24. Draw the encoder for a (7, 4) cyclic Hamming code generated by the generator polynomial, G(p) = 1 + p + p**

^{3}**Solution:**The generator polynomial is given by

G(p) = p

^{3}+ 0 p

^{2}+ p + 1

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

**equation**

For a (7, 4) cyclic having code,

*n*= 7 and

_{k}= 4.

Therefore,

**equation**

Hence, G(p) = p

^{3}+ g

_{2}p

^{2}+ g

_{1}p + 1 …(iii)

Comparing equations (i) and (iii), we get obtain

g

_{1}= 1 and g

_{2}= 0 …(iv)

Thus, the encoder for a (7, 4) Hamming code is shown in figure 10.37.

**equation**

**FIGURE 10.37**

*Encoder for a cyclic Hamming code.*

**EXAMPLE 10.25. A message 10 11 01 is to be transmitted in cyclic code with a generator polynomial G(d) = d**

^{4}+ d^{3}+ 1. Obtain the transmitted code word. How many check bits (i.e., parity bits) does the encoded message contain ? Draw the encoding arrangement for the same.**Solution:**(i) First, we obtain the message polynomial M(p) i.e.,

M(p) = m

_{0 }+ m

_{1}p + m

_{2}p

^{2}+ m

_{3}p

^{3}+ m

_{4}p

^{4}+ m

_{5}p

^{5}

(ii) Then, we multiply M(p) by p

^{n-k}to obtain p

^{n-k}M(p).

(iii) After that, we divide p

^{n-k}M(p) by the generator polynomial G(p).

(iv) Lastly, we obtain the code word X as under :

X = [m

_{5}, m

_{4}, m

_{3}, m

_{2}, m

_{1}, m

_{0}: c

_{3}c

_{2}c

_{1}c

_{0}]

(i) The given message is 10 11 01. Therefore, there are 6 message bits.

Thus, k = 6

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

Therefore, number of parity bits (n – k) = 4

So, code word length n =

*k*+ 4 = 10

(iii) The message polynomial corresponding to the message 10 11 01 = [m

_{5}, m

_{4}, m

_{3}, m

_{2}, m

_{1}, m

_{0}] is given as,

M(p) = m

_{0}+ m

_{1}p + m

_{2}p

^{2}+ m

_{3}p

^{3}+ m

_{4}p

^{4}+ m

_{5}p

^{5 }…(i)

Substituting the values of message bits, we obtain

M(p) = 1 + 0p + p

^{2}+ p

^{3}+ 0 p + p

^{5}…(ii)

(iv) The generator polynomial can be written in the form as under:

G(p)=1 + 0p + 0p

^{2}+ p

^{3}+ p

^{4}…(iii)

(v) Let us multiply the message polynomial M(p) by p

^{n-k}

Since (n – k) = 4; so p

^{n-k }= p

^{4}

Therefore, p

^{4}M(p) = p

^{4}[1 + 0 p + p

^{2}+ p

^{3}+ p

^{4}+ p

^{5}]

or p

^{4}M(p) = p

^{4}+ 0p

^{5}+ p

^{6}+ p

^{7}+ 0 p

^{8}+ p

^{9 }…(iv)

(vi) Now, we divide p

^{4}M(p) by the generator polynomial

The division takes place as under :

**equation**

**equation**

**equation**

(vii) The code word polynomial can be obtained by adding p

^{n-k}M(p) to the remainder polynomial C(p).

Thus, X(p) = p

^{4}M(p) + C(p) …(v)

But C(p) = c

_{0}+ c

_{1}p + c

_{2}p

^{2}+ … c

_{n-k-1}p

^{n-k-1 }…(vi)

Here, (n-k-1) = (10 + 6 – 1) = 3

Therefore, C(p) = c

_{0}+ c

_{1}p + c

_{2}p

^{2}+ c

_{3}p

^{3 }…(vii)

But we have obtained c(p) = p

^{2}, so, comparing the two, we obtain c

_{0}= 0,

c

_{1 }= 0, c

_{2}= 1 and c

_{3}= 0

Therefore, Parity bits (c

_{3}, c

_{2}, c

_{1}c

_{0}) = (0 1 0 0) …(viii)

Therefore the code word is given as under :

X = [m

_{5}, m

_{4}, m

_{3}, m

_{2}, m

_{l}, m

_{0}, c

_{3}c

_{2}c

_{1}c

_{0}]

Thus, Code word X= [1 0 1 1 0 1 : 0 1 0 0]

And the corresponding code word polynomial is given as under :

X(p) = p

^{9}+ 0 p

^{8}+ p

^{7}+ p

^{6}+ 0p

^{5 }+ p

^{4}+ 0 p

^{3}+ p

^{2}+ 0 p + 0

**Ans.**

The encoded message consists of 4 check bits or parity bits c

_{3}, c

_{2}, c

_{1}and c

_{0}.

Now, let us draw the encoder for the cyclic code.

The generator polynomial is given as

G(p) = p

^{4}+ p

^{3}+ 1

or G(p) = p

^{4}+ p

^{3}+ 0 p

^{2}+ 0 p + 1 …(ix)

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

**equation**

Substituting n = 10 and

*k*= 6 and

*n*– k = 4 in equation (

*x*), we shall have

**equation**

or G(p) = p

^{4}+ g

_{3}p

^{3}+ g

_{2}p

^{2}+ g

_{2}p

^{2}+ g

_{1}p

^{1}…(xi)

Comparing equations (ix) and (xi) we get,

g

_{l}= 0

g

_{2}= 0

and g

_{3}= 1

Therefore, the coding arrangement is shown in figure 10.38.

**diagram**

**FIGURE 10.38**

*Encoding arrangement.*

**Advantages of cyclic codes**

**The advantage of cyclic codes over most of the other codes are as under :**

(i) They are easy to encode.

(ii) They possess a well defined mathematical structure which has led to development of very efficient decoding schemes for them.

(iii) The methods c that are to be used for error detection and correction are simpler and easy to implement.

(iv) These methods do not need look-up table decoding.

(v) It is possible to detect the error bursts using the cyclic codes.

**Drawbacks of cyclic codes**

**Even though the error detection is simpler, the error correction is slightly more complicated. This is due to the complexity of the combination logic circuit used for error correction.**