You are on page 1of 26

Cyclic Codes

Coding Theory and Its Applications


Ring of Polynomials
 Definition of Polynomial of Degree n:
A polynomial of degree n with coefficients in a
ring R is an element of Rn+1

 Example of polynomial with degree n:


r0  r1 X  r2 X 2    rn X n
Example 1
 The polynomials over the ring of integer and
their operations

 Addition:
Example 1 (Cont’d)
 Multiplication:
Example 2
 The polynomials over the binary field:

 Addition:

 Multiplication: by either 0 to get zero polynomial


or 1 to get the same polynomial
Ring of Polynomials
 If R is a field, then the operations make the
set of polynomials of degree over R into a
linear space
 B is a field, then the set of polynomials of
degree n over B is a linear space, the space of
Bn+1
 We identify the elements of the linear space
with polynomials by matching the leftmost bit
with the constant term
Example
 For n = 1
 00  0
 10  1
 01  X
 11  1+X
 For n = 2
 010  X
 011  X + X2
 111  1 + X + X2
Ring of Polynomials
 Definition of Multiplication modulo a
polynomial:
Let p, q, and r be polynomials with coefficients
in some ring R. The product of p and q modulo
r is the remainder when pq is divided by r
Example
 Let p  X   X 2  3 q ,X   X 2  5  X  X3  X2
,r and
, where the coefficients is real
 The product of p and q is

 Or in factorial form:

result remainder

 Therefore, the product of (X2 – 3) and (X2 + 5 )


modulo (X3 – X2) is (-X – 15)
Ring of Polynomials
 The operation of multiplication modulo the
polynomial Xn + 1 gives us products which are
polynomials of degree n – 1 or less
 The set of polynomials of degree less than n
forms a ring with respect to addition and
multiplication modulo
Xn + 1 Bn  X   X n  1
 The ring will be denoted
 The remainder that is obtained when a
polynomial in B[X] is divided by X n + 1 can be
calculated by replacing Xn with 1 in the
polynomial
Example 1
 The remainder of X3 + X2 + X when divided by
X3 + 1 is 1 + X2 + X = X2 + X + 1
 The remainder of X4 + X3 + X2 when divided
by X3 + 1 is 1X + 1 + X2 = X2 + X + 1
 The remainder of X7 + X6 + X5 when divided
by X4 + 1 is 1X3 + 1X2 + 1X = X3 + X2 + X
Example 2
 The elements of B2/(X2 + 1) are the
polynomials 0, 1, X, and 1 + X
 The multiplication by 0 and 1 is trivial
 (X)(X) modulo (X2 + 1) = 1
 (X) (1 + X) modulo (X2 + 1) = 1 + X
 (1 + X)(1 + X) modulo (X2 + 1) = 0
 The multiplication table is

OR
Ring of Polynomials
 Multiplication by X in Bn[X]/(Xn + 1) is
equivalent to shifting the components of the
corresponding vector in Bn cyclically one place
to the right
Cyclic Codes
 Definition of Cyclic Code:
A cyclic code is a linear code with the property
that any cyclic shift of a code word is also a
code word
Example
 Consider a generator matrix

 The linear code generated is {0000, 1010,


0101, 1111}
 Shifting 0000 cyclically gives 0000
 Shifting 1010 one place (to right) cyclically
gives 0101
 Shifting 0101 one place (to right) cyclically
gives 1010
 Shifting 1111 cyclically gives 1111
 So, the code is cyclic code
Example (Cont’d)
 In polynomial notation, the code is {0, 1, X 2, X
+ X3, 1 + X + X2 + X3}
 A cyclic shift to the right can be accomplished
by multiplying by X modulo (X 4 + 1)
 (0) (X modulo X4 + 1) = 0
 (1 + X2) (X modulo X4 + 1) = X + X3
 (X + X3) (X modulo X4 + 1) = 1 + X2
 (1 + X + X2 + X3) (X modulo X4 + 1) = 1 + X + X2
+ X3
Cyclic Codes
 Definition of Generator Polynomial:
The unique non-zero polynomial of minimal
degree in a cyclic code is the generator
polynomial of the code
g  Bn  X  X n
 1
 If is the generator polynomial
 X n  1
Bn  X  in
for some cyclic code, then every polynomial
the code can be generated by multiplying g
by some polynomial in
Cyclic Codes
 The generator of the cyclic code can be
written in the form:

 Notice that each row is obtained by shifting


the previous row one column to the right
Example
 Suppose a cyclic code as follows {0000000,
1011100, 0101110, 0010111, 1001011,
1100101, 1110010, 0111001}
 The code word 1011100 corresponds to 1 +
X2 + X3 + X4
 It is the polynomial of minimal degree and
hence the generator polynomial
 The generator matrix is
Cyclic Codes
 g is the generator polynomial of a cyclicBncode  X   X n  1
in if and only if Xitn is
1 a factor of

 X n
 1 always has at least two factors because

 The factorization of
X n  1 determine the
cyclic codes of length n
 There is a cyclic code for each factor
Example
 The factorization of (X9 + 1) is

 The cyclic code with generator polynomial (1


+ X) has basis:

 The cyclic code with generator polynomial (1


+ X + X2) has basis:

 The cyclic code with generator polynomial (1


+ X)(1 + X + X2) = (1 + X3) has basis:
Example (Cont’d)
 The cyclic code with generator polynomial (1
+ X3 + X6) has basis:

 The cyclic code with generator polynomial (1


+ X + X2) (1 + X3 + X6) = (1 + X + X2 + X3 +
X4 + X5 + X6 + X7 + X8) has basis:
Encoding and Decoding
 Cyclic codes are linear codes  the previous
techniques can be used to encode and decode
messages
 The additional structure of cyclic code allow
us to devise other encoding and decoding
techniques  efficient in hardware
 We know that if g is the generator of a cyclic
code if and only if it is a factor of (Xn + 1) or

where h is the parity check polynomial


Encoding and Decoding
 The encoding process produces a code
polynomial from a message polynomial by
multiplication by the generator polynomial

 If we multiply c by the parity check


polynomial:

 If the code polynomial is corrupted


Encoding and Decoding
 The syndrome polynomial is the product of the
result and the parity check polynomial

 If the code polynomial is not corrupted, the


error polynomial and its syndrome will be zero
Example
 The polynomial
is a cyclic code whose code words are 6 bits
long with generator polynomial
 The parity check polynomial is
 The generator matrix of this code is

You might also like