0% found this document useful (0 votes)
71 views16 pages

Cyclic Codes

A cyclic code is a linear block code where the cyclic shift of any codeword is also a codeword. Cyclic codes have advantages such as elegant algebraic descriptions using generator and parity-check polynomials. Nearly all commonly used block codes are cyclic or shortened cyclic codes. Cyclic codes can be described using polynomials, where the right cyclic shift of a codeword polynomial is equivalent to multiplication modulo the polynomial x^n - 1. The generator polynomial of a cyclic code uniquely defines the code by dividing the codeword polynomials.

Uploaded by

Aditya Gawali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views16 pages

Cyclic Codes

A cyclic code is a linear block code where the cyclic shift of any codeword is also a codeword. Cyclic codes have advantages such as elegant algebraic descriptions using generator and parity-check polynomials. Nearly all commonly used block codes are cyclic or shortened cyclic codes. Cyclic codes can be described using polynomials, where the right cyclic shift of a codeword polynomial is equivalent to multiplication modulo the polynomial x^n - 1. The generator polynomial of a cyclic code uniquely defines the code by dividing the codeword polynomials.

Uploaded by

Aditya Gawali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

EE 387, Notes 14, Handout #22

Cyclic codes: overview


A linear block code is cyclic if the cyclic shift of a codeword is a codeword.
Cyclic codes have many advantages.
◮ Elegant algebraic descriptions:
◮ c(x) = m(x)g(x), where g(x) is generator polynomial
◮ c(x)h(x) = 0 mod (xn − 1), where h(x) is parity-check polynomial
◮ c(β1 ) = 0, . . . , c(βt ) = 0, where β1 , . . . , βt ∈ GF(q m )
◮ Shift register encoders and syndrome units
◮ Simple burst error correction (error trapping )
◮ Random error correction by solving polynomial equations

Cyclic codes are (by definition) a very special case of linear codes.
But nearly all commonly used block codes are (shortened) cyclic codes.

EE 387, October 23, 2015 Notes 14, Page 1


Cyclic shifts of n-tuples and polynomials
The right cyclic shift of (v0 , v1 , . . . , vn−1 ) is (vn−1 , v0 , . . . , vn−2 ) .
Circuit diagrams:

D Q D Q D Q D Q D Q D Q D Q


CLK

The right cyclic shift of v is denoted by v(1) .


When n-tuples are polynomials of degree ≤ n − 1, the right cyclic shift of
v(x) = (v0 , v1 , . . . , vn−2 , vn−1 )
= v0 + v1 x + · · · + vn−2 xn−2 + vn−1 xn−1
is also a polynomial of degree ≤ n − 1:
v (1) (x) = (vn−1 , v0 , . . . , vn−2 ) = vn−1 + v0 x + · · · + vn−2 xn−1
The right cyclic shift of v = v(x) by i positions is denoted v(i) = v (i) (x) .
EE 387, October 23, 2015 Notes 14, Page 2
Properties of cyclic shifts
Some obvious facts about cyclic shifts of n-tuples:
◮ v(n) = v.
◮ Left cyclic shift i positions v(−i) is same as right cyclic shift v(n−i) .
◮ v(i) = v(i mod n) .
The first two statements are special cases of the third.
The right cyclic shift operation is a linear transformation v(1) = vS1 , where
S1 is a permutation matrix:
 
0 1 0 ··· 0
0 0 1 ··· 0
S1 =  ... ... ... ..  .
 
..
.

 .
0 0 0 ··· 1
1 0 0 ··· 0
Every linear feedback shift register corresponds to a matrix in rational
canonical form. The cyclic register is the simplest feedback shift register.
EE 387, October 23, 2015 Notes 14, Page 3
Numbers vs. polynomials
When binary n-tuples represent integers, bit shifts perform multiplication
and division by powers of 2.
◮ Logical left shift is multiplication by 2.
◮ Logical right shift is unsigned division by 2.
◮ Cyclic left/rights shifts are multiplication/division by 2 mod 2n − 1.
When n-tuples represent polynomials over a field, cyclic shifts correspond to
multiplication and division by powers of x mod (xn − 1).
We write polynomials with the most significant coefficients on the right.
(v0 , v1 , . . . , vn−1 ) ↔ v0 + v1 x + · · · + vn−1 xn−1
Cyclic right shifts are multiplication by x, except coefficient of xn becomes
coefficient of x0 = 1.
Thus right cyclic shift differs from product with x by a multiple of xn − 1.

EE 387, October 23, 2015 Notes 14, Page 4


Polynomial description of cyclic shifts
Lemma: The right cyclic shift of v(x) is
v (1) (x) = xv(x) − vn−1 (xn − 1)
= xv(x) mod (xn − 1) .

Proof : By the definition of right cyclic shift,


v (1) (x) = vn−1 + v0 x + · · · + vn−2 xn−1
= vn−1 + v0 x + · · · + vn−2 xn−1 + vn−1 xn − vn−1 xn
= xv(x) − vn−1 (xn − 1)
= xv(x) mod (xn − 1)
When vn−1 = 0, the right cyclic shift is same as the right logical shift:
vn−1 = 0 ⇐⇒ v (1) (x) = xv(x)

EE 387, October 23, 2015 Notes 14, Page 5


Cyclic codes: definition and basic properties
Definition: A cyclic code is a linear block code such that the right cyclic
shift of any codeword is a codeword.
By iteration, all cyclic shifts of codewords are codewords. The right cyclic
shift i positions of any codeword c(x) is a codeword:
c(i) (x) = xi c(x) mod (xn − 1)
Since cyclic codes are linear, sums of cyclic shifts are codewords.
For any polynomial a(x) = a0 + a1 x + · · · + am xm ,
m
X
a(x)c(x) mod (xn − 1) = ai xi c(x) mod (xn − 1)


i=0

is a codeword. Important special case: deg a(x) < n−deg c(x). Then
deg a(x)c(x) < n =⇒ a(x)c(x) mod (xn − 1) = a(x)c(x) .
Therefore a(x)c(x) is a codeword when deg a(x)c(x) < n.

EE 387, October 23, 2015 Notes 14, Page 6


Generator polynomial
Theorem: Let C be an (n, k) cyclic code over GF(q).
1. There exists a monic polynomial g(x) such that n-tuple c(x) is a
codeword if and only if g(x) is a divisor of c(x).
The polynomial g(x) is called the generator polynomial of C.
2. The generator polynomial is unique.
3. The degree of the generator polynomial is n − k.
4. The generator polynomial is a divisor of xn − 1.

Proof : When k = 0 we can take g(x) = xn − 1.


In this case all the statements are obviously true.
So assume k > 0 and therefore n − k < n.
The zero polynomial is the only polynomial of degree < n that is divisible by xn − 1. So xn − 1
generates the code consisting of only the zero vector.
xn − 1 is called the “cyclic” polynomial of degree n.
EE 387, October 23, 2015 Notes 14, Page 7
Generator polynomial proof (1)
1. Let g(x) be the monic greatest common divisor of {ci (x)}, the set of
nonzero codewords. Then there exist polynomials {ai (x)} such that
X
g(x) = ai (x)ci (x)
i
X 
= ai (x)ci (x) mod (xn − 1) since deg g(x) < n
i
X 
= ai (x)ci (x) mod (xn − 1)
i

The final expression shows that g(x) is a linear combination of


codewords. Therefore g(x) is a divisor of all other codewords.

2. If there were two generator polynomials, each would be a divisor of the


other. Since both are monic, the ratio is 1, so they are equal.

EE 387, October 23, 2015 Notes 14, Page 8


Generator polynomial proof (2)
3. Let r = deg g(x). If deg m(x) < n − r then deg m(x)g(x) < n,
so m(x)g(x) is a codeword.
Conversely, every codeword c(x) is a polynomial multiple of g(x), that
is, c(x) = m(x)g(x) where deg m(x) < n − r.
So there are q n−r codewords. But every (n, k) code over GF(q) has
q k codewords.
Therefore q n−r = q k =⇒ n − r = k =⇒ r = n − k .
4. (Cute trick.) The right cyclic shift of g(x) by k digits is a codeword:
g(k) (x) = (1, 0, . . . , 0, g0 , g1 , . . . , gn−k−1 )
= 1 + g0 xk + g1 xk+1 + · · · + gn−k−1 xn−1 + xn − xn
= xk g(x) − (xn − 1)
Therefore
xn − 1 = xk g(x) − g (k) (x)
is a sum of multiples of g(x) and so itself is a multiple of g(x).
EE 387, October 23, 2015 Notes 14, Page 9
Examples of binary cyclic codes
◮ The (n, 0) code consisting of the zero vector: gn (x) = xn − 1.
◮ The (n, n) code of all n-tuples is another trivial cyclic code: g0 (x) = 1.
The (n, 0) and (n, n) codes are duals. Note: g0 (x)gn (x) = xn − 1.
◮ Even-parity simple parity-check codes are cyclic: g1 (x) = x − 1 = x + 1.
Nonsystematic generator matrix:
 
1 1 0 ··· 0 0 0
0 1 1 ··· 0 0 0
G =  ... ... ... . . . .. .. .. 
 

 . . .
0 0 0 ··· 1 1 0
0 0 0 ··· 0 1 1
◮ Repetition codes have generator polynomial gn−1 = 1 + x + · · · + xn−1 .
 
G = 1 1 1 ··· 1 1 1
Odd parity-check codes are not linear and therefore not cyclic by definition. They are cosets of
cyclic codes and have the same error protection ability in most situations.
EE 387, October 23, 2015 Notes 14, Page 10
Examples of binary cyclic codes (cont.)
◮ Systematic generator matrix for (4, 3) simple parity-check code:
 
1 1 0 0
j
g(x) = x + 1 =⇒ x mod g(x) = 1 =⇒ G = 1  0 1 0
1 0 0 1

◮ Over GF(2), x7 − 1 = (x + 1)(x3 + x + 1)(x3 + x2 + 1).


There are 23 = 8 divisors of x7 − 1 hence 8 cyclic codes of blocklength 7.
For primitive polynomial g(x) = x3 + x + 1 we obtain cyclic Hamming
code.
 
1 1 0 1 0 0 0  
0 1 1 0 1 0 0 1 0 0 1 0 1 1
G= 1 1 1 0 0 1 0 =⇒ H = 0 1 0 1 1 1 0
  
0 0 1 0 1 1 1
1 0 1 0 0 0 1
“Dual” code has generator matrix H, the (7, 3) maximum-length code.
All nonzero maximum-length codewords have same weight, 2m−1 = 4.
EE 387, October 23, 2015 Notes 14, Page 11
Nonsystematic generator matrix
Let C be the (n, k) cyclic code generated by g(x) of degree r = n − k.
Every codeword
m(x)g(x) = m0 g(x) + m1 xg(x) + · · · + mk−1 xk−1 g(x)
is a linear combination of xi g(x).
Therefore {xi g(x): i = 0, 1, . . . , k − 1} is a basis for C.
The matrix with rows xi g(x) is a nonsystematic generator matrix for C.
   
g(x) g0 g1 · · · gr 0 0 ··· 0
 xg(x)   0 g g · · · gr 0 · · · 0 
   0 1 
 .
..  =  .. .. . . . .
 
. . .

G1 =    . . . . · · · . . . . .. 
 k−2
x g(x)
  
   0 0 0 g0 g1 · · · gr 0 
xk−1 g(x) 0 0 0 0 g0 g1 · · · gr
Every row of G1 is a right (cyclic) shift of the first row.

EE 387, October 23, 2015 Notes 14, Page 12


Systematic generator matrix
A systematic encoder copies message digits to consecutive positions in
codeword.
Convention: most significant digits transmitted first: cn−1 , cn−2 , . . . , cn−n
In order for k message digits to appear at beginning of a codeword, they
must be shifted right by n − k positions:
m(x) 7→ (0, 0, . . . , 0, m0 , m1 , . . . , mk−1 ) = xn−k m(x) .
To generate a valid codeword, low order n − k coefficients must be chosen
so that the complete n-tuple is a multiple of g(x).
Suppose that xn−k m(x) has nonzero remainder when divided by g(x).
xn−k m(x) mod g(x) = Rg(x) (xn−k m(x))
We can create a codeword by subtracting the remainder from xn−k m(x) .
Integer example: 31 mod 7 = 3 hence 31 − 3 = 28 is a multiple of 7.

EE 387, October 23, 2015 Notes 14, Page 13


Systematic generator matrix (cont.)
The systematic encoder for cyclic code with generator polynomial g(x):
m(x) 7→ xn−k m(x) − (xn−k m(x) mod g(x))
 
= xn−k m(x) − Rg(x) xn−k m(x)
= (0, . . . , 0, m0 , . . . , mk−1 ) − (p0 , . . . , pn−k−1 , 0, . . . , 0)
The two polynomials in the above sum have no nonzero coefficients of
powers of x in common. This polynomial subtraction is multiplexing.

m(x)
c(x)
× xn−k mod g(x) −1

This encoder creates a codeword by appending to the message digits the


negative of the remainder modulo g(x) of the shifted message polynomial.

EE 387, October 23, 2015 Notes 14, Page 14


Systematic generator matrix (cont.)
Systematic encoder uses division to produce multiple of generator
polynomial.
The remainder of division by a fixed polynomial is a linear function.
The systematic encoder is a linear transformation, so its output is
determined by the output values for any basis.
The standard basis consists of the k unit vectors {1, x, . . . , xk−1 }.
Check symbols for message xi are
−(xn−k · xi ) mod g(x) = −xn−k+i mod g(x) .
The rows of the systematic generator matrix for i = 0, 1, . . . , k − 1 are
gi (x) = −xn−k+i mod g(x) + xn−k+i
= −s[n−k+i](x) + xn−k+i ,
where s[j](x) = xj mod g(x).

We will see that s[j] (x) is the j-th feedback shift of s[0] (x).
EE 387, October 23, 2015 Notes 14, Page 15
Systematic generator matrix (cont.)
Coefficients of s[j] (x) form check portion of systematic generator matrix.
 [n−k] [n−k]

−s0 · · · −sn−k−1 1 0 ··· 0
 
 [n−k+1] [n−k+1]
−s0 · · · −sn−k−1 0 1 ··· 0 

G2 = 
.. .. .. .. .. . . .
. . . . . . .. 
 

[n−1] [n−1]
−s0 · · · −sn−k−1 0 0 ··· 1
First row of G2 is simply g(x), same as first row of nonsystematic G1 .
G2 has k(n − k + 1) nonzero elements, same as G1 .
Both G1 and G2 are determined by n − k values (coefficients of g(x)).
The parity-check portion of each row of G2 comes from the first row by
using a linear feedback shift register whose scalers the coefficients of g(x).
For example, this shift register multiplies by x modulo x16 + x12 + x5 + 1.

EE 387, October 23, 2015 Notes 14, Page 16

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy