Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Chapter 5 Cyclic Codes

• Let v = (v0 , v1 , · · · , vn−1 ). The n-tuple v (1) = (vn−1 , v0 , · · · , vn−2 ) is called


a cyclic shift of v. Repeat the same operation i times, we have

v (i) = (vn−i , vn−i+1 , · · · , vn−i−1 )

1
DEFINITION 5.1 An (n, k) linear code C is called a cyclic code if every cyclic
shift of a code vector in C is also a code vector in C.

• An n-tuple can be written in polynomial form. The polynomial forms of v and


v (1) are v(X) = v0 + v1 X + v2 X 2 + · · · + vn−1 X n−1 and
v (1) (X) = vn−1 + v0 X + v1 X 2 + · · · + vn−2 X n−1 respectively.
• Xv(X) = v0 X + v1 X 2 + · · · + vn−2 X n−1 + vn−1 X n
= vn−1 (1 + X n ) + vn−1 + v0 X + · · · + vn−2 X n−1
= vn−1 (1 + X n ) + v (1) (X)

• X 2 v(x) = (vn−1 X + vn−2 )(1 + X n ) + v (2) (X)


X i v(X) = q(X)(X n + 1) + v (i) (X)

• v (i) (X) = X i v(X) (mod X n + 1)

2
THEOREM 5.1 The nonzero code polynomial of minimum degree in a binary
cyclic code C is unique.

Proof. Suppose that g(X) and g ′ (X) are both codewords of C and both have min-
imum degree r. Since g(X) + g ′ (X) ∈ C and is of degree less than r, then
g(X) + g ′ (X) = 0. This implies g(X) = g ′ (X).

THEOREM 5.2 Let g(X) = g0 + g1 X + · · · + X r be the nonzero code polynomial


of minimum degree in an (n, k) cyclic code C. Then, the constant term g0 must be
nonzero.

3
THEOREM 5.3 Let g(X) = g0 + g1 X + · · · + gr−1 X r−1 + X r be the nonzero
code polynomial of minimum degree in an (n, k) cyclic code C. A binary polyno-
mial of degree n−1 or less is a code polynomial if and only if it is a multiple of g(X).

Proof.
(⇐) Let v(X) = a(X)g(X), where a(X) is a polynomial of degree less than n − r.
Then, deg(v(X)) < n. Write a(X) = a0 + a1 X + · · · + an−r−1 X n−r−1 . Then
v(X) = a0 g(X) + a1 Xg(X) + · · · + an−r−1 X n−r−1 g(X). Hence, v(X) ∈ C.

(⇒) Let v(X) ∈ C. Then, v(X) = a(X)g(X) + b(X), deg(b(X)) < deg(g(X)).
Since a(X)g(X) ∈ C, then b(X) ∈ C. Hence, b(X) = 0.

4
THEOREM 5.4 In an (n, k) cyclic code C, there exists one and only one code
polynomial of degree n − k, i.e.,

g(X) = 1 + g1 X + · · · + X n−k .

Every code polynomial is a multiple of g(X), and every binary polynomial of degree
n − 1 or less that is a multiple of g(X) is a code polynomial.

• Let v(X) be a code polynomial of C. Then, v(X) = u(X)g(X), where


u(X) = u0 + u1 X + · · · + uk−1 X k−1 .

• u(X) is the message polynomial and g(X) is called the generator polynomial
of C.

5
THEOREM 5.5 The generator polynomial g(X) of an (n, k) cyclic code is a factor
of X n + 1.
Proof. Write X k g(X) = (X n + 1) + g ′ (X). Note that g ′ (X) is in C. Hence,
g ′ (X) = a(X)g(X). Thus, X n + 1 = {X k + a(X)}g(X).

THEOREM 5.6 If g(X) is a polynomial of degree n − k and is a factor of xn + 1,


then g(X) generates an (n, k) cyclic code.

6
EXAMPLE 5.1
The polynomial X 7 + 1 can be factored as

X 7 + 1 = (1 + X)(1 + X + X 3 )(1 + X 2 + X 3 ).

• The polynomial (1 + X) generates a (7,6) even-weight code.

• The polynomial (1 + X + X 3 ) generates the (7,4) Hamming code given in


EXAMPLE 1.6. Let u(X) = 1 + X 2 . The generated code polynomial is
v(X) = (1 + X 2 )(1 + X + X 3 ) = 1 + X + X 2 + X 5 , i.e., the code vector
(1110010).

• The polynomial (1 + X)(1 + X + X 3 ) generates the (7,3) code which is a


subcode of the (7,4) Hamming code in EXAMPLE 1.6 and contains only the
even-weight code polynomials.
• The polynomial 1 + X 2 + X 3 generates a (7,4) Hamming code which is the
reciprocal of the code in EXAMPLE 1.6.

7
⋆⋆ Procedure of systematic encoding:
Step 1. Multiply u(X) = u0 + u1 X + · · · + uk−1 X k−1 by X n−k to obtain
X n−k u(X) = u0 X n−k + u1 X n−k+1 + · · · + uk−1 X n−1 .

Step 2. Divide X n−k u(X) by g(X) such that X n−k u(X) = a(X)g(X)+b(X),
where deg(b(X)) < n − k.

Step 3. The systematic code polynomial is b(X) + X n−k u(X) = a(X)g(X) =


b0 + b1 X + · · · + bn−k−1 X n−k−1 + u0 X n−k + u1 X n−k+1 + · · · +
uk−1 X n−1 .

Exercise : Consider the (7,4) Hamming code with generator polynomial (1 + X +


X 3 ). Let u(X) = 1 + X 2 . Find the associated codeword in systematic form.

8
• Let C be an (n, k) cyclic code with generator polynomial g(X) = g0 + g1 X +
· · · + gn−k X n−k . Then,

 
g0 g1 g2 ... gn−k 0 ... 0
 0 g0 g1 ... gn−k−1 gn−k ... 0 
 
 .. 
G=
 0 0 g0 ... . 

 . .. 
 .. . 
0 0 0 ... g0 . . . gn−k

is a generator matrix of C. Note that g0 = gn−k = 1.

9
• Write X n + 1 = g(X)h(X), where h(X) = h0 + h1 X + · · · + hk X k ,
h0 = hk = 1. Let v(X) = a(X)g(X). Then,

v(X)h(X) = a(X)g(X)h(X) = a(X)(X n + 1) = a(X) + X n a(X).

Since deg(a(X)) < k, then X k , · · · , X n−1 are not in a(X) + X n a(X). This
implies
∑k
i=0 hi vn−i−j = 0 for 1 ≤ j ≤ n − k
∑k or
i=0 hi vm−i = 0 for m = k, k + 1, · · · , n − 1.

(v0 v1 v2 ... vk vk+1 . . . vn−1 )


(hk hk−1 hk−2 ... h0 0 ... 0)
(0 hk hk−1 ... h1 h0 ... 0)
.. ..
. .
(0 ... ... hk ... ... ... h0 )
.

10
Note that X k h(X −1 ) = hk +hk−1 X+· · ·+h0 X k is a factor of X n +1. Hence,
X k h(X −1 ) generates an (n, n − k) cyclic code Cd with generator matrix
 
hk hk−1 hk−2 . . . h0 0 . . . 0
 0 hk hk−1 . . . h1 h0 . . . 0 
 
H= .
 .. .. 
.

0 ... ... hk . . . . . . . . . h0

which is an (n − k) × n matrix .

Cd is the dual code of C.


H is the parity matrix of C.

THEOREM 5.7 Let C be an (n, k) cyclic code with generator polynomial g(X).
Let h(X) = (X n +1)/g(X). Then, Cd is also cyclic and is generated by X k h(X −1 ).

11
Circuits for Polynomials Multiplication
∑n i
∑m j
Let f (X) = i=0 fi X and g(X) = j=0 gj X .
Then,

n ∑
m
f (X)g(X) = fi gj X i+j
i=0 j=0
∑n ∑ m
= fk−j gj X k (where k = i + j)
i=0 j=0
 
∑ ∑
m+n k
=  fk−j gj  X k
k=0 j=0

12
Consider the multiplication of a(X) = ak X k + ak−1 X k−1 + · · · + a1 x + a0 and
b(X) = hr X r + · · · + h1 X + h0 .
For the following two circuits, using ak , ak−1 , · · · , a0 as input, the output will be the
result of multiplication.

13
Circuits for Dividing Polynomials
Let a(X) = an X n + · · · + a1 X + a0 and
g(X) = gr X r + · · · + g1 X + g0
be the dividend and divisor respectively.

We have the following circuit for division.

14
• The division can also be implemented by autoregressive form.Write
R(x) = a(x) − Q(x)g(x)
where Q(x) is the quotient and R(x) is the remainder.We have
deg(a(x)) ≤ n − 1, deg(Q(x)) ≤ k − 1,
deg(g(x)) = n − k, deg(R(x)) ≤ n − k − 1,
and

n−k
Rn−ℓ = an−ℓ − gi Qn−ℓ−i , 1 ≤ ℓ ≤ n
i=0

• For 1 ≤ ℓ ≤ k, we have Rn−ℓ = 0.


∑n−k−1
Hence , gn−k Qk−ℓ = an−ℓ − i=0 gi Qn−ℓ−i

• For ℓ > k , we have Qk−ℓ = 0.


∑n−k−1
Hence, Rn−ℓ = an−ℓ − i=0 gi · Qn−ℓ−i

15
Then, we have the following division circuit.

16
Systematic Encoding

The systematic encoding of a circuit code can be realized by either using g(X) or
using h(X).

• Encoder using g(X):

17
• Encoder using h(X):
In this chapter, we already have
∑k−1
vn−k−j = i=0 hi vn−i−j for 1 ≤ j ≤ n − k

18
Syndrome Decoding for Cyclic Codes
Let r(X) be the received vector in polynomial form. Divide r(X) by g(X), We have
r(X) = a(X)g(X) + s(X) , deg(s(X)) < n − k,
where s(X) is the syndrome polynomial.
• Note that all the polynomials in the same coset have the same syndrome, since
r(X) + v(X) = [a(X) + u(X)]g(X) + s(X).
• The Syndrome calculation can be realized by the following circuit.

19
Theorem 5.8 Let s(X) be the syndrome of the received polynomial r(X) = r0 +
r1 X+· · ·+rn−1 X n−1 . Then, the remainder s(1) (X) resulting from dividing Xs(X)
by the generator polynomial g(X) is the syndrome of r(1) (X), which is a cyclic shift
of r(X).
Proof.
– Write Xr(X) = rn−1 (X n + 1) + r(1) (X). Thus
r(1) (X) = rn−1 (X n + 1) + Xr(X)
Suppose that r(X) = a(X)g(X) + s(X) and r(1) (X) = c(X)g(X) + ρ(X).
Then, c(X)g(X) + ρ(X) = rn−1 g(X)h(X) + X[a(X)g(X) + s(X)]. Hence,
Xs(X) = [c(X)+rn−1 h(X)+Xa(X)]g(X)+ρ(X). Thus, ρ(X) = s(1) (X)

• The polynomial s(1) (x) is the syndrome of r(1) (x) and is not a cyclic shift of
s(x) .

20
Meggitt Decoder

For a large n − k value , the problem of syndrome decoding is that a look-up table of
size 2n−k is needed. Meggitt decoder employs the cyclic properties of cyclic code to
reduce the size of look-up table by sacrificing decoding time. The Meggitt decoder
consists of three major parts:
1. a syndrome register,
2. an error-pattern detector

3. a buffer register to hold the received vector.

21
22
EXAMPLE 5.9

Consider a (7, 4) cyclic code generated by g(X) = 1 + X + X 3 .

Error pattern Syndrome Syndrome vector


e(X) s(X) (s0 s1 s2 )
X6 1 + X2 (101)
X5 1 + X + X2 (111)
X4 X + X2 (011)
X3 1+X (110)
X2 X2 (001)
X1 X (010)
X0 1 (100)

• Consider the error pattern with an error at location X 6 . The associated syn-
drome is 1 + X 2 .

23
24
Cases for t = 2.
(0 0 0 ... 0 0 0)
(1 0 0 ... 0 0 0)
(0 1 0 ... 0 0 0)
(0 0 0 ... 0 0 1)
(1 1 0 ... 0 0 0)
(0 1 1 ... 0 0 0)
(0 0 0 ... 0 1 1)
(1 0 1 ... 0 0 0)
(0 1 0 ... 0 0 0)
(1 0 1 ... 0 0 0)
.. .. .. .. ... ..
(. . . ... . .)
.

25
Error-Trapping Decoding

• Suppose that the errors of the error pattern are confined within n − k con-
secutive positions. Then an efficient decoding algorithm called error-trapping
decoding can be employed.

• Let r(X) = v(X) + e(X) = a(X)g(X) + s(X), and e(X) = a′ (X)g(X) +


s(X)
Suppose that deg(e(X)) < n − k. Then, e(X) = s(X).

• Suppose errors are confined to the first n − k digits of a block codeword, i.e.,
e(X) = ek X k + · · · + en−1 X n−1 . Then, e(n−k) (X) = ek + ek+1 X + · · · +
en−1 X n−k−1 . Thus, s(n−k) (X) = e(n−k) (X) and X k s(n−k) (X) = e(X) =
ek X k + · · · + en−1 X n−1

26
THEOREM 5.9 Consider a t-error-correcting code. If the number of errors in
r(X) is t or less and if they are confined to n − k consecutive positions, the errors
are trapped in the syndrome register only when the weight of the syndrome in the
register becomes t or less.
Proof.
- Let s(X) be the syndrome of e(X), where w(s(X)) ≤ t, deg(e(X)) ≥ n − k
and w(e(X)) ≤ t. Let ê(X) = s(X). Clearly, deg(ê(X)) < n − k. The
syndrome of ê(X) is also s(X).
Both e(X) and ê(X) are in the same coset and have weight at most t. This
contradicts to the fact that this code is t-error-correcting.

27
EXAMPLE 5.11
Consider the (15,7) cyclic code generated by g(X) = 1 + X 4 + X 6 + X 7 + X 8 .
This code has minimum distance dmin = 5 and error-correcting capability t = 2. It
can be checked that every single error or double errors are confined to n − k = 8
consecutive positions. Here, the following error-trapping decoder can be used.

28
29

You might also like