0% found this document useful (0 votes)
68 views19 pages

Cyclic Codes

Cyclic codes are a subclass of linear codes characterized by their cyclic structure, allowing code vectors to be generated through cyclic shifts. Encoding involves multiplying the message polynomial by a generator polynomial and calculating the remainder, while decoding checks for errors by using the syndrome derived from the received codeword. The minimum distance of a code is crucial for determining its error detection and correction capabilities.

Uploaded by

LTM-ECE PSG CT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views19 pages

Cyclic Codes

Cyclic codes are a subclass of linear codes characterized by their cyclic structure, allowing code vectors to be generated through cyclic shifts. Encoding involves multiplying the message polynomial by a generator polynomial and calculating the remainder, while decoding checks for errors by using the syndrome derived from the received codeword. The minimum distance of a code is crucial for determining its error detection and correction capabilities.

Uploaded by

LTM-ECE PSG CT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Cyclic Codes

Dr [Link]
PSG CT
Cyclic Codes

A subclass of linear codes having a cyclic structure.

The code vector can be expressed in the form

c = ( cn-1 cn-2 ……c1 c0 )

A new code vector in the code can be produced by cyclic shifting of


another code vector.
For example, a cyclic shift of all n bits one position to the left gives

c’ = ( cn-2 cn-3 ……c1 c0 cn-1)


A second shift produces another code vector, c”

c” = ( cn-3 cn-4 ……c1 c0 cn-1 cn-2)


Cyclic Codes

The cyclic property can be treated mathematically by associating a code


vector, c with the code polynomial, c(X)

c(X) = c0 + c1X + c2X2+……cn-1Xn-1

The power of X denotes the positions of the codeword bits.

The coefficients are either 1s and 0s.


An (n,k) cyclic code is defined by a generator polynomial, g(X)

g(X) = Xn-k + gn-k-1Xn-k-1 + ……. + g1X + 1

The coefficient g are such that g(X) is a factor of Xn + 1


Cyclic Codes – Encoding Procedure

To encode an (n,k) cyclic code

1. Multiply the message polynomial , m(X) by Xn-k

2. Divide Xn-k.m(X) by the generator polynomial, g(X) to obtain the


remainder polynomial, b(X)

3. Add b(X) to Xn-k.m(X) to obtain the code polynomial


Cyclic Codes - Example

The (7,4) Hamming Code

For message sequence 1001

The message polynomial, m(X) = 1 + X3

1. Multiply by Xn-k (X3) gives X3 + X6

2. Divide by the generator polynomial, g(X) that is a factor of Xn + 1


For the (7,4) Hamming code is defined by its generator polynomials, g(X)
that are factors of X7 + 1

With n =7, we can factorize X7 + 1 into three irreducible polynomials

X7 + 1 = (1 + X)(1 + X2 + X3)(1 + X + X3)


Cyclic Codes - Example

For example we choose the generator polynomial, 1 + X + X3 and perform


the division we get the remainder, b(X) as X2 + X

3. Add b(X) to obtain the code polynomial, c(X)

c(X) = X + X2 + X3 + X6

So the codeword for message sequence 1001 is 0111001


Cyclic Codes – Exercise

Find the codeword for (7,4) cyclic Hamming Code using the generator
polynomial, 1 + X + X3 for the message sequence 0011
Circuit for encoding systematic cyclic codes
0

 We noticed earlier that cyclic codes can be generated by using shift registers
whose feedback coefficients are determined directly by the generating
polynomial
 For cyclic codes the generator polynomial is of the form
G ( p )  p q  p q 1 g q 1  p q 2 g q 2    pg1  1
 In the circuit, first the message flows to the shift register, and feedback switch
is set to ‘1’, where after check-bit-switch is turned on, and the feedback switch
to ‘0’, enabling the check bits to be outputted
Cyclic Codes – Implementation

The Cyclic code is implemented by the shift-register encoder with (n-k)


stages

Encoding starts with the feedback switch closed, the output switch in the message
bit position, and the register initialised to the all-zero state.
The k message bits are shifted into the register and delivered to the transmitter.
After k shift cycles, the register contains the b check bits.
The feedback switch is now opened and the output switch is moved to the check
bits to deliver them to the transmitter.
Cyclic Codes – Implementation example

The shift-register encoder for the (7,4) Hamming Code has (7-4=3) stages

When the input message is 0011, after 4 shift cycles the redundancy bits are delivered
Cyclic Codes – Implementation Exercise

The shift-register encoder for the (7,4) Hamming Code has (7-4=3) stages

When the input message is 1001, after 4 shift cycles the redundancy bits are delivered

1 0 0 0 0 1 1
The check bits
0 0 1 1 1 1 0
is 011
0 1 1 0 1 1 1
1 1 1 1 1 1 0
Cyclic Codes – Implementation Exercise

The shift-register encoder for the (7,4) Hamming Code has (7-4=3) stages

When the input message is 1100?


Decoding cyclic codes
• Every valid, received code word R(x) must be a multiple of G(x), 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(x)/G(x) and considering the remainder as a syndrome can
reveal if an error has happed and sometimes also to reveal in which bit (depending
on code strength)
• Division is accomplished by a shift registers
• The error syndrome of S=n-k bits is therefore

S( p ) mod  R ( p ) / G ( p ) 
• This can be expressed also in terms of the error E(x) and the
code word C(x) while noting that the received word is in terms of error
R(x)=C(x) + E(x)
S(x)= mod{[R(x)=C(x) + E(x) ]/G(x)}
hence
S( p ) mod  X( p )  E( p)  / G ( p)
S( p ) mod  E( p) / G ( p) 
Decoding cyclic codes: syndrome
table

Using denotation of this example:

16.20 s ( x) mod  e( x) / g ( x) 
Table 16.6
Decoding cyclic codes: error correction

s ( x) mod  r ( x) / g ( x) 

g ( x)
Decoding circuit for (7,4) code
syndrome computation
x0 x1 xn-1
0
received code 1 syndrome

G ( p)  p 3  p  1
 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 ):

S( p ) mod  R ( p) / G ( p) 
that is then left to the register
 Then the switch is turned to the position “1” that drives the syndrome out
of the register
 Note the tap order for Galois-form shift register
Code parameters
• The Hamming distance
• The Hamming distance between a pair of code vectors, c1 and c2 that have the same number of elements is defined
as the number of locations in which their respective elements differ
• The Hamming weight
• The Hamming weight of a code vector c is defined as the number of nonzero elements in that code vector
• Equivalent to the distance between a code vector and an all-zero code vector
• The minimum distance
• The minimum distance of a linear block code is defined as the smallest Hamming distance between any pair of code
vectors in the code.
• Equivalent to the smallest Hamming weight of the difference between any pair of code vectors
• Equivalent to the smallest Hamming weight of the nonzero code vectors in the code
• Code rate
• The ratio between the number of original message bits and the number of bits of the codeword
• For (n,k) code , code rate = k/n.
Codewords for (7,4) Hamming
Code
Message Word Parity bits Code words Hamming weight
0000 000 0000000
0001 101 1010001
0010 111 1110010
0011 010 0100011
Min dist=?
0100 011 0110100
0101 110 1100101
0110 100 1000110
0111 001 0010111
1000 110 1101000
1001 011 0111001
1010 001 0011010
1011 100 1001011
1100 101 1011100
1101 000 0001101
1110 010 0101110
1111 111 1111111
Code parameters
The minimum distance of a code determines the error detecting and correcting
capability of the code
Error detection is always possible when the number of transmission errors in a
codeword is less than the minimum distance so that the erroneous word may not
be seen as another valid code vector
Various degrees of error control capability
• Detect up to l errors per word , dmin >= l + 1
• Correct up to t errors per word, dmin >= 2t + 1
• Correct up to t errors and detect l > t errors per word,
dmin >= t + l + 1
Code rate is a measure of the code efficiency

You might also like