Cyclic Code

5
Cyclic code For cyclic code, the generator polynomial can be easily transformed to generator matrix, as follows - - - = . 1 ... ... ... ... 1 0 0 ... 0 0 0 ... 0 1 ... ... ... ... 1 0 0 0 ... 0 0 1 ... ... ... ... 1 0 gr gr g g gr gr g g gr gr g g G M O O O O O O O O O M M M O O O O O O O O O M M (1) The matrix G has n columns and k=n-r rows; so the first row g0 finishes with a string of 1’s of length k-1. Each successive row is the cyclic shift of the previous row: gi=gi-1 for i=1,…..,k-1. If C is a [7,4] binary cyclic code with generator polynomial 1+x+x 3 , the the cyclic generator matrix is = . 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 1 G (2) Given the cyclic generator matrix G, cyclic encoding is the process of encoding the message into the codeword c=mG. For systematic cyclic code, the first k positions of codeword are same with m message before added with CRC bits. To construct the systematic generator matrix, encode the messages of weight 1 corresponding to message polynomial. Proceeding in this way, the generator matrix is = . 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 0 0 1 G (3)

description

Cyclic_code.

Transcript of Cyclic Code

Page 1: Cyclic Code

Cyclic code

For cyclic code, the generator polynomial can be easily transformed to generator

matrix, as follows

= .

1............100...00

0...01............100

0...001............10

grgrgg

grgrgg

grgrgg

G

MOOOOOOOOOMM

MOOOOOOOOOMM (1)

The matrix G has n columns and k=n-r rows; so the first row g0 finishes with a string of 1’s

of length k-1. Each successive row is the cyclic shift of the previous row: gi=gi-1 for

i=1,…..,k-1. If C is a [7,4] binary cyclic code with generator polynomial 1+x+x3, the the

cyclic generator matrix is

= .

1011000

0101100

0010110

0001011

G (2)

Given the cyclic generator matrix G, cyclic encoding is the process of encoding the

message into the codeword c=mG. For systematic cyclic code, the first k positions of

codeword are same with m message before added with CRC bits. To construct the

systematic generator matrix, encode the messages of weight 1 corresponding to

message polynomial. Proceeding in this way, the generator matrix is

= .

1101000

0110100

1110010

1010001

G (3)

Page 2: Cyclic Code

The codeword for m message is

c=mG (4)

[ ] [ ]

•= .

1101000

0110100

1110010

1010001

01230123456 mmmmccccccc(5)

By using equation (5), the codewords for corresponding messages are

Table 1: Messages and Codewords

Messages Codewords

0000 0000000

1000 1000101

0100 0100111

1100 1100010

0010 0010110

1010 1010011

0110 0110001

1110 1110100

0001 0001011

1001 1001110

0101 0101100

1101 1101001

0011 0011101

1011 1011000

0111 0111010

1111 1111111

Page 3: Cyclic Code

At receiver end, the decoder computes the following (n-k) syndrome, s.

s=r.HT (6)

where r is a received vector that was transmitted over noisy channel and HT is parity

check matrix. For (7,4) linear code, the corresponding parity check matrix is

= .

1001011

0101110

0010111

H (7)

Usually, received vector r, is the vector sum of the transmitted codeword and the error

vector, that is

r=c +e (8)

[ ] [ ] [ ]012345601234560123456 eeeeeeecccccccrrrrrrr ⊕=

(9)

The syndrome, s will determine the error position and can be computed as follows

s=e.HT (10)

[ ] [ ]

•= .

100

010

001

110

011

111

101

0123456012 eeeeeeesss (11)

Page 4: Cyclic Code

From equation (11), the syndromes for corresponding error locations are

Table 2: Errors and syndromes

Errors Syndromes

1000000 101

0100000 111

0010000 110

0001000 011

0000100 100

0000010 010

0000001 001

0000000 000

Let c = [1010011] be the transmitted codeword and r=[1010011] be the received

vector. Since the received vector is same with the transmitted vector, it means there is

no error and the syndrome

s=e.HT = (000) (12)

Next, let say the error vector e=[1000000], the received vector is

r= c+e = [0010011] (13)

From the received vector, the syndrome is

s=e.HT = (101) (14)

and from Table 2, the error vector, e =[1000000].

The actual transmitted codeword

c* = r + e = 00100101 + 1000000 = 1010011 (15)

Page 5: Cyclic Code

After decoding, found that c*=c with message, m=[1010]. Hence the receiver has

performed a correct decoding.

Hamming Distance and Minimum Distance

Hamming Distance is a weight between 2 codewords for corresponding cyclic code.

For Hamming code, the Hamming distance between codewords, [1000110] and

[0100011] is

(16)

Hamming weight is 4

Hamming distance between each codewords might be different and the smallest

distance is called minimum distance. From the minimum distance, error correction

capability is determined as follows

d=2t+1 (17)

where t is error correction capability and d is minimum distance.

1010011

1100010

0110001