Library

4.5.8 Cyclic Codes

Cyclic codes are a subclass of linear block codes that possess a particularly convenient algebraic structure, making them highly practical for implementation using simple shift-register circuits. Most widely used block codes—such as Hamming, CRC, BoseChaudhuriHocquenghem (BCH), Golay, and ReedSolomon (R–S) codes—are cyclic in nature.

A binary code is said to be cyclic if:

In cyclic codes we use describe encoding operations using a generator polynomial, rather than a generator matrix. The generator polynomial g(X) for a (n,k) cyclic code is:

g(X)=g0+g1X+g2X2++gnkXnk
(4.23)

The coefficients of the polynomial, gi, are 1 or 0 for binary codes: g0 and gnk must be 1. A polynomial g(X) uniquely defines an (n,k) cyclic code if it is of degree nk and is a factor of X n+1.

The original k-bit data word is also represented as a polynomial, where the binary data bits serve as coefficients:

d(X)=d0+d1X+d2X2++dk1Xk1
(4.24)

Similarly, a cyclic-code codeword can be expressed as:

c(X)=c0+c1X+c2X2++cn1Xn1
(4.25)

A codeword is valid codeword if, and only if, g(X) divides c(X) without remainder.

4.5.8.1 Non-Systematic Codewords

A non-systematic cyclic codeword is generated by multiplying the generator polynomial by the appropriate data polynomial:

c(X)=d(X)g(X)
(4.26)

For example, the generator polynomial g(X)=1+X+X 3 can be used to generate a (7,4) cyclic code. For data word d=0011, corresponding to a data polynomial of d(X)=X 2+X 3, the codeword polynomial is:

c(X)=d(X)g(X)=(X2+X3)(1+X+X3)         =X2+X3+X5+X3+X4+X6   =X2+X4+X5+X6(4.27

(recall that in modulo-2 arithmetic X 3+X 3=0). The non-systematic codeword polynomial is therefore:

c(X)=01+0X+1X2+0X3+1X4+1X5+1X6
(4.28)

so that the equivalent binary codeword is c=0010111. Note this is non-systematic because the original data word d=0011 is not visible within the codeword.

4.5.8.2 Systematic Codewords

Cyclic codes have the useful property that any cyclic shift of a valid codeword yields another valid codeword. Since each power of X in the codeword polynomial c(X) represents a one-bit shift in time, multiplying by X represents a one-bit shift to the right. In general, for m cyclic shifts, if c(X) is a valid code polynomial, then:

cm(X)=Xmc(X)       mod(Xn+1)
(4.29)

is also a valid code polynomial. Modulo-(X n+1) arithmetic ensures that the cyclic property is maintained, since every valid codeword is a factor of (X n+1)

A systematic codeword is formed in cyclic codes with the structure:

c=(r0,r1,r2,rnk1,d0,d1,d2,dk1)
(4.30)

where there are (nk) parity-check bits, and k original data bits. The polynomial r(X) is called the parity-check polynomial:

r(X)=r0+r1X+r2X2++rnk1Xnk1
(4.31)

To form the codeword, we first right-shift the data polynomial by (nk) positions by multiplying by X nk , and then divide by the generator polynomial to obtain a quotient q(X) and the remainder r(X):

Xnkd(X)=q(X)g(X)+r(X)
(4.32)

Adding (in a modulo-2 sense) r(X) to both sides gives:

r(X)+Xnkd(X)=q(X)g(X)=c(X)
(4.33)

Thus, a valid systematic codeword is formed by adding the remainder polynomial to the shifted data polynomial.

By way of example, let us generate a systematic codeword for our data word d=0011 using the generator polynomial g(X)=1+X+X 3 to generate a (7,4) cyclic code. First, we obtain the parity-check bits (r1,r2,r3):

Xnkd(X)g(X)=q(X)+r(X)
(4.34)

That is, we need to divide X 3(X 3 + X 2) by (1+ X + X 3) (all operations modulo-2). The quotient polynomial is q(X)= X 3 + X 2 + X and remainder polynomial is r(X)=X, so the remainder word is r=010. The final codeword is therefore c=0100011.