Anda di halaman 1dari 20

CYCLIC CODES

By :Er. Amit Mahajan


CYCLIC CODES

Definition:
 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
 Codewords can be represented as polynomials of degree n. For a cyclic
code all codewords are multiple of some polynomial g(X) modulo Xn+1
such that g(X) divides Xn+1. g(X) is called the generator polynomial.
Examples:
 Hamming codes, Golay Codes, BCH codes, RS codes
 BCH codes were independently discovered by Hocquenghem (1959) and
by Bose and Chaudhuri (1960)
 Reed-Solomon codes (non-binary BCH codes) were independently
introduced by Reed-Solomon
Cyclic codes are of interest and importance because

• They posses rich algebraic structure that can be utilized in a


variety of ways.
• They have extremely concise specifications.

• They can be efficiently implemented using simple shift


registers.

• Many practically important codes are cyclic.


Notations

k = Number of binary digits in the message before


encoding
n = Number of binary digits in the encoded
message
n – k = r = number of check bits
n

k r
Basic properties of Cyclic codes:

 Let C be a binary (n,k) linear cyclic code


1. Within the set of code polynomials in C, there is a unique monic
polynomial g ( Xwith
) minimal degree r < n. gis( Xcalled
) the generator
polynomials.
g ( X ) = g 0 + g1X + ... + g r X
r

2. Every code polynomial U(in


X )C, can be expressed uniquely as
U ( X ) = m ( X )g ( X )
3. The generator polynomial is a factor of
g( X )
X n +1
4. The orthogonality of G and H in polynomial form is expressed as
. This means is also a factor of
g( X )h( X ) = X + 1
n h( X ) X +1
n
Polynomial Representation of Binary Information

It is convenient to think of binary digits as


coefficients of a polynomial in the dummy
variable X.
Polynomial is written low-order-to-high-
order.
Polynomials are treated according to the laws
of ordinary algebra with an exception addition
is to be done modulo two.
Types of Cyclic Codes

There are two types of Cyclic Codes on basis of


Encoding:
 Non-Systematic Encoding:
Information bits are not packed together in the
codeword. These are rarely used.
c(x)= i(x) g(x)
 Systematic Encoding:
Information bits are packed together in the codeword.
c(x)= i(x) xn-k + r(x)
Systematic Encoding
8

 Systematic encoding algorithm for an (n,k)


Cyclic code:
1. Multiply the message polynomial i ( X ) by X n − k

2. Divide the result of Step 1 by the generator


polynomial g( X ) . Let r ( X ) be the remainder.

3. Add r ( X ) to X n− k i (x) to form the codeword


C( X )
Implementation

The hardware to implement this algorithm is a shift


register and a collection of modulo two adders.

The number of shift register positions is equal to the


degree of the divisor, G(X), and the dividend is shifted
through high order first and left to right.
Circuit for encoding systematic cyclic codes

◆ We noticed earlier that cyclic codes can be generated by using shift registers
whose feedback coefficients are determined directly by the generating
polynomial
Example
Decoding cyclic codes

 Every valid, received code word R(p) must be a multiple of G(p), otherwise
an error has occurred. (Assume that the probability of noise to convert code
words to other code words is very small.)
 Therefore dividing the R(p)/G(p) and considering the remainder as a
syndrome can reveal if an error has happened and sometimes also to reveal in
which bit (depending on code strength)
 Division is accomplished by a shift registers
 The error syndrome of q=n-k bits is therefore
S( p ) = mod [ R ( p ) / G ( p ) ]
Decoding cyclic codes: error correction
Decoding circuit for (7,4) code
syndrome computation

S( p ) = mod [ R ( p ) / G ( p ) ]
◆ To start with, the switch is at “0” position
◆ Then shift register is stepped until all the received code bits have entered the
register
◆ This results is a 3-bit syndrome (n - k = 3 ):

that is then left to the register


◆ Then the switch is turned to the position “1” that drives the syndrome out of the
register
Decoding
Encoder and Decoder
Advantages of Cyclic codes

 Simplified encoding.
 Easy syndrome calculation S(p) = rem{Y(p)/G(p)}
 Ingenious error correcting decoding methods have been devised for
specific cyclic codes. They eliminate the storage needed for table
lookup.
 Cyclic Redundancy Codes (CRC), a class of cyclic codes, has ability to
detect burst errors of length ‘q’, all single bit errors, any odd number of
errors if (p+1) is a factor of G(p), Double errors if G(p) has at least
three 1’s.
 Cyclic codes for error detection provides high efficiency and the ease of
implementation.
 It provides standardization like CRC-8 and CRC-32
Some block codes that can be realized by cyclic codes

 (n,1) Repetition codes. High coding gain (minimum distance always n-


1), but very low rate: 1/n
 (n,k) Hamming codes. Minimum distance always 3. Thus can detect 2
errors and correct one error. n=2m-1, k = n - m,
 Maximum-length codes. For every integer there exists a maximum
length code (n,k) with n = 2k - 1,dmin = 2k-1 .
 BCH-codes. For every integer there exist a code with n = 2m-1,
and where t is the error correction capability
 (n,k) Reed-Solomon (RS) codes. Works with k symbols that consists of
m bits that are encoded to yield code words of n symbols.
 Nowadays BCH and RS are very popular due to large dmin , large number
of codes, and easy generation
 Code selection criteria: number of codes, correlation properties, code
gain, code rate, error correction/detection properties
Reference:

1. Communication Systems by R.P Singh , S.D Sapre


2. Information Theory , Coding and Cryptography by Ranjan Bose
3. http://www.cs.nmsu.edu/~pfeiffer/
4. http://web.syr.edu/~rrosenque/ecc/cyclic.htm
5. http://www.microconsultants.com/tips/crc/crc.txt

Anda mungkin juga menyukai