Cyclic Code
Cyclic Code
For cyclic code, the generator polynomial can be easily transformed to generator
matrix, as follows
g 0 g1 ...
0 g 0 g1
G= M
M O
M O
M
0
0 ...
g 0 g1
...
...
...
...
gr 1 gr
...
...
O
O
0
0
M
M
(1)
The matrix G has n columns and k=n-r rows; so the first row g0 finishes with a string of 1s
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
1
0
G=
0
1
1
0
0
0
1
1
0
1
0
1
1
0
1
0
1
0
0
1
0
0
0
.
0
(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
0
G=
0
0 0 0 1 0 1
1 0 0 1 1 1
.
0 1 0 1 1 0
0 0 1 0 1 1
(3)
(4)
1
0
[c6 c5 c 4 c3 c 2 c1 c0] = [m3 m2 m1 m0]
0
0 0 0 1 0 1
1 0 0 1 1 1 (5)
.
0 1 0 1 1 0
0 0 1 0 1 1
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
(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
1 1 1 0 1 0 0
H = 0 1 1 1 0 1 0 .
1 1 0 1 0 0 1
(7)
Usually, received vector r, is the vector sum of the transmitted codeword and the error
vector, that is
r=c +e
[r 6
(8)
(9)
The syndrome, s will determine the error position and can be computed as follows
s=e.HT
1
1
1
[s 2 s1 s0] = [e6 e5 e4 e3 e2 e1 e0] 0
1
0
0
(10)
0
1
1
1
0
1
0
1
1
0
1 .
0
0
1
(11)
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
(12)
Next, let say the error vector e=[1000000], the received vector is
r= c+e = [0010011]
(13)
(14)
(15)
After decoding, found that c*=c with message, m=[1010]. Hence the receiver has
performed a correct decoding.
1 0 0 0 1 1 0
0 1 0 0 0 1 1
(16)
1 1 0 0 1 0 1 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
where t is error correction capability and d is minimum distance.
(17)