Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
342 views

5CS3-01: Information Theory & Coding: Unit-4 Cyclic Code

This document discusses cyclic codes. It begins by explaining code algebra, Galois fields, and polynomial operations over Galois fields. It then discusses generating cyclic codes using a generating polynomial and a parity check polynomial. The document also explains how to encode and decode cyclic codes. It compares cyclic codes to linear block codes like Hamming codes, noting that cyclic codes can be implemented more simply using polynomial representations and operations. The document provides an example of a (7,4) cyclic code and discusses error detection using cyclic codes through polynomial division.

Uploaded by

Pratap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
342 views

5CS3-01: Information Theory & Coding: Unit-4 Cyclic Code

This document discusses cyclic codes. It begins by explaining code algebra, Galois fields, and polynomial operations over Galois fields. It then discusses generating cyclic codes using a generating polynomial and a parity check polynomial. The document also explains how to encode and decode cyclic codes. It compares cyclic codes to linear block codes like Hamming codes, noting that cyclic codes can be implemented more simply using polynomial representations and operations. The document provides an example of a (7,4) cyclic code and discusses error detection using cyclic codes through polynomial division.

Uploaded by

Pratap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

5CS3-01: Information

Theory & Coding

Unit- 4
Cyclic Code
Cyclic Code
Code Algebra
Basic properties of Galois fields (GF)
Golynomial operations over Galois fields
Generating cyclic code by generating
polynomial
Parity check polynomial
Encoder & decoder for cyclic codes
Linear Block Code
Hamming Code is a Linear Block Code. Linear
Block Code means that the codeword is
generated by multiplying the message vector
with the generator matrix.

Minimum weight as large as possible. If


minimum weight is 2t+1, capable of detecting
2t error bits and correcting t error bits.
Cyclic Codes
 Hamming code is useful but there exist codes that
offers same (if not larger) error control
capabilities while can be implemented much
simpler.

 Cyclic code is a linear code that any cyclic shift


of a codeword is still a codeword.

 Makes encoding/decoding much simpler, no need


of matrix multiplication.
Cyclic code
 Polynomial representation of cyclic codes.
C(x) = Cn-1xn-1 + Cn-2xn-2 + … + C1x1 + C0x0 ,
where, in this course, the coefficients belong to the
binary field {0,1}.
 That is, if the codeword is (1010011) (c6 first, c0 last),
we write it as x6 + x4 + x + 1.
 Addition and subtraction of polynomials – Done by
doing binary addition or subtraction on each bit
individually, no carry and no borrow.
 Division and multiplication of polynomials. Try divide
x3 + x2 + x + 1 by x + 1.
Cyclic Code
 A (n,k) cyclic code can be generated by a polynomial g(x)
which has
– degree n-k and
– is a factor of xn - 1.
Call it the generator polynomial.

 Given message bits, (mk-1…m1m0 ), the code is generated


simply as:

In other words, C(x) can be considered as the


product of m(x) and g(x).
Example
A (7,4) cyclic code with g(x) = x3 + x + 1.

If m(x) = x3 + 1, C(x) = x6 + x4 + x + 1.


Galois Field
 In mathematics, a finite field or Galois field (so-
named in honor of Évariste Galois) is a field that
contains a finite number of elements.
 As with any field, a finite field is a set on which
the operations of multiplication, addition,
subtraction and division are defined and satisfy
certain basic rules.
 The most common examples of finite fields are
given by the integers mod p when p is a prime
number.
Fields
A field is an algebraic structure in which the
operations of addition, subtraction,
multiplication, and division (except by zero)
can be performed, and satisfy the usual rules.
More precisely, a field is a set F with two
binary operations + (addition) and ·
(multiplication) are defined, in which the
following laws hold:
1. a+ (b+c) = (a+b) +c (associative law for addition)
2. a+b = b+a (commutative law for addition)
3. There is an element 0 (zero) such that a+0 = a for all a.
4. For any a, there is an element −a such that a+ (−a) = 0.
5. a ·(b · c) = (a · b)· c (associative law for
multiplication)
6. a · b = b · a (commutative law for multiplication)
7. There is an element 1 (not equal to 0) such that a · 1 =
a for all a.
8. For any a a≠ 0, there is an element a −1 such that
a · a −1 = 1.
1. a ·(b+c) = (a · b) + (a · c) (distributive law)
We can condense nine axioms into just three

Using the notion of a group, we can condense


these nine axioms into just three:
1. The elements of F form an Abelian group
with the operation + (called the additive
group of F).
2. The non-zero elements of F form an Abelian
group under the operation · (called the
multiplicative group of F).
3. Multiplication by any non-zero element is an
automorphism of the additive group.
Additive group
 The additive group of GF(q)is an elementary Abelian
p-group. This is because
x+···+x = (1+···+1)x = 0x = 0,
where there are p terms in the sum. Thus, it is the
direct sum of r cyclic groups of order p.
 Another way of saying this is that F is a vector space
of dimension r over F1; that is, there is a basis
(a1,...,ar) such that every element x of F can be written
uniquely in the form
x = x1a1 +···+xrar
for some a1,...,xr F0 = {0,1,..., p−1}
Multiplicative group
The most important result is that the
multiplicative group of GF(q) is cyclic; that is,
there exists an element g called a primitive
root) such that every non-zero element of F
can be written uniquely in the form g i for
some i with 0 ≤ i ≤ q−2. Moreover, we have g
q−1 = g 0 = 1.
Squares
Suppose that q is odd. Then the cyclic group of
order q − 1 has the property that exactly half
its elements are squares (those which are even
posers of a primitive element).

The squares are sometimes called quadratic


residues, and the non-squares are quadratic
non-residues. (These terms are used especially
in the case where q is prime, so that GF(q) is
the field of integers mod q.
Automorphism Group
 An automorphism of F is a one-to-one mapping x →
xm from F onto F, such that
(x+y)m = xm+ym , (xy)m = xm ym for all x,y.

 The map σ : x → x p is an automorphism of F, known as


the Frobenius automorphism. The elements of F fixed
by the Frobenius automorphism are precisely those
lying in the prime subfield F0. Moreover, the group of
automorphisms of F is cyclic of order r, generated by σ.
(This means that every automorphism has the form x →
x p i for some value of i with 0 ≤ i ≤ r −1.
Special bases
 We saw that F has bases of size r as a vector space over
F0. These bases can be chosen to have various additional
properties.
 The easiest type of basis to find is one of the form {1,a,a 2
,...,a r−1}, where a is the root of an irreducible polynomial
of degree r over F0. The existence of such basis is
guaranteed by the construction.
 A basis of the form {a,a σ ,a σ 2 ,...,a σ r−1 }, where σ is the
Frobenius automorphism, is called a normal basis. Such a
basis always exists. Note that the automorphism group of
F has a particularly simple form relative to a normal
basis, since the basis elements are just permuted
cyclically by the automorphisms.
Subfields
 If the field GF(p r ) has a subfield GF(p s 1 ),
where p and p1 are primes, then p = p1 and s
divides r. Conversely, if s divides r then GF(pr )
has a unique subfield of order ps .
 The necessity of the condition is proved by
applying Lagrange’s Theorem to the additive and
multiplicative groups.
 The sufficiency is proved by observing that, if σ is
the Frobenius automorphism of GF(p r ), and s
divides r, then the fixed elements of the
automorphism σ s (that is, the elements a
satisfying a p s = a) form the unique subfield of
order p s .
Calculation in finite fields
Addition in GF(q) is easy if we have chosen a
basis: we have

(x1aa +···+xrar) + (y1a1 +···+yrar) = (x1 +y1)a1 +···+ (xr +yr)ar

in other words, we add “coordinate-wise”. On the


other hand, multiplication is easy if we have
chosen a primitive root g: we have
(g i )·(g j ) = g i+j ,
Calculation in finite fields Cont…
where the exponent is reduced mod q−1 if
necessary.

In order to be able to perform both operations,


we need a table telling us how to translate
between the two representations. This is
essentially a table of logarithms (for those who
remember such things), since if g i = x, we can
think of i as the “logarithm” of x.
For the field GF(9) which we constructed
earlier, using an element a satisfying a 2 = 2
(over the integers mod 3), we find that g = 1 +
a is a primitive element, and the table of
logarithms is as follows:
Polynomial Operation Over
Galois Field (GF)
1. Addition Operation

It can be done using one b-bit XOR operation.


The sum of two elements A.B € GF (2m) is
given by equation.

C(x) = A(x) Xor B (x) =


Polynomial Operation Over Galois
Field (GF) Cont….
2. Square Operation

The binary representation of element’s square


is done by inserting 0 bit between consecutive
bit of the binary representation. The square of
A€ GF (2m) is given by equation.
A2 (x) =
Polynomial Operation Over Galois
Field (GF) Cont….
3. Multiplication operation

Assume we have two elements A(x), B(x)


belongs to binary field GF (2m) with
irreducible polynomial P(x). Field
multiplication done by two steps:
Polynomials multiplication of A(x) and B(x).
C’(x) = A(x). B(x)
Error Detection with Cyclic
Code
A (7,4) cyclic code with g(x) = x3 + x + 1.

If the received polynomial is x6 + x5 + x2 + 1,


are there any errors? Or, is this a code
polynomial?
Error Detection with Cyclic
Code
A (7,4) cyclic code with g(x) = x3 + x + 1.

If the received polynomial is x6 + x5 + x2 + 1,


are there any errors?

We divide x6 + x5 + x2 + 1 by x3 + x + 1, and


the remainder is x3 + 1. The point is that the
remainder is not 0. So it is not a code
polynomial, so there are errors.
Division Circuit
 You probably would ask that we can also detect errors
with the Hamming code. However it needs matrix
multiplication. The division can actually be done very
efficiently, even with hardware.
 Division of polynomials can be done efficiently by the
division circuit. (just to know there exists such a thing,
no need to understand it)
Cyclic Code
One way of thinking it is to write it out as the
generator matrix

 So, clearly, it is a linear code. Each row of the


generator matrix is just a shifted version of the
first row. Unlike Hamming Code.
 Why is it a cyclic code?
Example

The cyclic shift of C(x) = x6 + x4 + x + 1 is


C1(x) = x5 + x2 + x + 1.

It is still a code polynomial, because the code


polynomial is m(x) = x2 +1.
Cyclic Code
Given a code polynomial

We have

Therefore, C1(x) is the cyclic shift of C(x) and


has a degree of no more than n-1
 divides g(x) (why?) hence is a code
polynomial.
Cyclic Code
To generate a cyclic code is to find a
polynomial that
– has degree n-k
– is a factor of xn -1.
Generating Systematic Cyclic
Code
A systematic code means that the first k bits
are the data bits and the rest n-k bits are parity
checking bits.
To generate it, we let

where
The claim is that C(x) must divide g(x) hence
is a code polynomial.
 33 mod 7 = 5. Hence 33-5=28 can be divided by 7.
Example
A (7,4) cyclic code with g(x) = x3 + x + 1.

If m(x) = x3 + 1, the non-systematic code is


C(x) = x6 + x4 + x + 1.

What is the systematic code?


Example
A (7,4) cyclic code with g(x) = x3 + x + 1.
If m(x) = x3 + 1, the non-systematic code is
C(x) = x6 + x4 + x + 1.
What is the systematic code?
r(x) = m(x) x3 mod g(x)
= (x6 + x3) mod x3 + x + 1
= x2 + x
Therefore, C(x) = x6 + x3 + x2 + x.
Cyclic Redundancy Check
(CRC)
 In communications, usually the data is followed by a
checksum.
 Checksum is calculated according to a cyclic code,
therefore it is called Cyclic Redundancy Check (CRC).
 To be more precise, it is done by calculating the
systematic code, with the data packet as the message
polynomial.
 The receiver, once received the data followed by the
checksum, will calculate the checksum again, if match,
assume no error, otherwise there is error, either in the data
or the checksum.
Generating Cyclic Code by
Generating Polynomial
Generating Cyclic Code by
Generating Polynomial Cont….
Generating Cyclic Code by
Generating Polynomial Cont….
Generating Cyclic Code by
Generating Polynomial Cont….
Generating Cyclic Code by
Generating Polynomial Cont….
Generating Cyclic Code by
Generating Polynomial Cont….
Parity Check Polynomial
Parity Check Polynomial Cont….
Parity Check Polynomial Cont….
Parity Check Polynomial Cont….
Parity Check Polynomial Cont….
Factorize the Polynomial X3 – 1
over GF(2) and GF(3).
The following polynomials f(x)
and g(x) are define over GF(3)
f(x) = 2 + x + x + 2x
2 4

g(x) = 1 + 2x2 + 2x4 + x5


Calculate addition and
multiplication of the above two
polynomials
*
Encoder for Cyclic Codes
Encoder for Cyclic Codes Cont…
Encoder for Cyclic Codes Cont…
Decoders for Cyclic Codes
Decoders for Cyclic Codes Cont…
Construct a symmetric (7,4) cyclic
code using the generating polynomial
g(x) = X3 + x2 + 1
The generator polynomial of a (7,4) cyclic
code is defined by
g(x) = 1+x+x3
Develop the encoder and syndrome
calculator for the above code, using a
systemic from for the code. Also shown the
contents of shift register in the encoding
and syndrome calculator for a set of input
Sequence
Unit-4 Completed

You might also like