SlideShare a Scribd company logo
1 of 43
Download to read offline
Cyclic Codes
Yunghsiang S. Han
Graduate Institute of Communication Engineering,
National Taipei University
Taiwan
E-mail: yshan@mail.ntpu.edu.tw
Y. S. Han Cyclic codes 1
Description of Cyclic Codes
• If the components of an n-tuple v = (v0, v1, . . . , vn−1) are
cyclically shifted i places to the right, the resultant n-tuple
would be
v(i)
= (vn−i, vn−i+1, . . . , vn−1, v0, v1, . . . , vn−i−1).
• Cyclically shifting v i places to the right is equivalent to
cyclically shifting v n − i places to the left.
• 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 in C.
• Code polynomial v(x) of the code vector v is defined as
v(x) = v0 + v1x + · · · + vn−1xn−1
.
• v(i)
(x) = xi
v(x) mod xn
+ 1.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 2
Proof: Multiplying v(x) by xi
, we obtain
xi
v(x) = v0xi
+ v1xi+1
+ · · · + vn−i−1xn−1
+ · · · + vn−1xn+i−1
.
Then we manipulate the equation into the following form:
xi
v(x) = vn−i + vn−i+1x + · · · + vn−1xi−1
+ v0xi
+ · · ·
+vn−i−1xn−1
+ vn−i(xn
+ 1) + vn−i−1x(xn
+ 1)
+ · · · + vn−1xi−1
(xn
+ 1)
= q(x)(xn
+ 1) + v(i)
(x),
where q(x) = vn−i + vn−i+1x + · · · + vn−1xi−1
.
• The nonzero code polynomial of minimum degree in a cyclic code
C is unique.
• Let g(x) = g0 + g1x + · · · + gr−1xr−1
+ xr
be the nonzero code
polynomial of minimum degree in an (n, k) cyclic code C. Then
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 3
the constant term g0 must be equal to 1.
Proof: Suppose that g0 = 0. Then
g(x) = g1x + g2x2
+ · · · + gr−1xr−1
+ xr
= x(g1 + g2x + · · · + gr−1xr−2
+ xr−1
).
If we shift g(x) cyclically n − 1 places to the right (or one place
to the left), we obtain a nonzero code polynomial,
g1 + g2x + · · · + gr−1xr−2
+ xr−1
, which has a degree less than r.
Contradiction.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 4
A (7, 4) Cyclic Code Gnerated by g(x) = 1 + x + x3
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 5
• Consider the polynomial xg(x), x2
g(x), . . . , xn−r−1
g(x). Clearly,
they are cyclic shifts of g(x) and hence code polynomials in C.
Since C is linear, a linear combination of
g(x), xg(x), . . . , xn−r−1
g(x),
v(x) = u0g(x) + u1xg(x) + · · · + un−r−1xn−r−1
g(x)
= (u0 + u1x + · · · + un−r−1xn−r−1
)g(x),
is also a code polynomial where ui ∈ {0, 1}.
• Let g(x) = 1 + g1x + · · · + gr−1xr−1
+ xr
. be the nonzero code
polynomial of minimum degree in an (n, k) cyclic code C. A
binary polynomial of degree n − 1 or less is a code polynomial if
and only if it is a multiple of g(x).
Proof: Let v(x) be a binary polynomial of degree n − 1 or less.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 6
Suppose that v(x) is a multiple of g(x). Then
v(x) = (a0 + a1x + · · · + an−r−1xn−r−1
)g(x)
= a0g(x) + a1xg(x) + · · · + an−r−1xn−r−1
g(x).
Since v(x) ia a linear combination of the code polynomials,
g(x), xg(x), . . . , xn−r−1
g(x), it is a code polynomial in C.
Now let v(x) be a code polynomial in C. Dividing v(x) by g(x),
we obtain
v(x) = a(x)g(x) + b(x),
where the degree of b(x) is less than the degree of g(x). Since
v(x) and a(x)g(x) are code polynomials, b(x) is also a code
polynomial. Suppose b(x) = 0. Then b(x) is a code polynomial
with less degree than that of g(x). Contradiction.
• The number of binary polynomials of degree n − 1 or less that
are multiples of g(x) is 2n−r
.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 7
• There are total of 2k
code polynomials in C, 2n−r
= 2k
, i.e.,
r = n − k.
•
• The polynomial g(x) is called the generator polynomial of the
code.
• The degree of g(x) is equal toi the number of parity-check digits
of the code.
• The generator polynomial g(x) of an (n, k) cyclic code is a factor
of xn
+ 1.
Proof: We have
xk
g(x) = (xn
+ 1) + g(k)
(x).
Since g(k)
(x) is the code polynomial obtained by shifting g(x) to
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 8
the right cyclically k times, g(k)
(x) is a multiple of g(x). Hence,
xn
+ 1 = {xk
+ a(x)}g(x).
• If g(x) is a polynomial of degree n − k and is a factor of xn
+ 1,
then g(x) generates an (n, k) cyclic code.
Proof: A linear combination of g(x), xg(x), . . . , xk−1
g(x),
v(x) = a0g(x) + a1xg(x) + · · · + ak−1xk−1
g(x)
= (a0 + a1x + · · · + ak−1xk−1
)g(x),
is a polynomial of degree n − 1 or less and is a multiple of g(x).
There are a total of 2k
such polynomial and they form an (n, k)
linear code.
Let v(x) = v0 + v1x + · · · + vn−1xn−1
be a code polynomial in
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 9
this code. We have
xv(x) = v0x + v1x2
+ · · · + vn−1xn
= vn−1(xn
+ 1) + (vn−1 + v0x + · · · + vn−2xn−1
)
= vn−1 (xn
+ 1) + v(1)
(x).
Since both xv(x) and xn
+ 1 are divisible by g(x), v(1)
must be
divisible by g(x). Hence, v(1)
(x) is a code polynomial and the
code generated by g(x) is a cyclic code.
• Suppose that the message to be encoded is
u = (u0, u1, . . . , uk−1). Then
xn−k
u(x) = u0xn−k
+ u1xn−k+1
+ · · · + uk−1xn−1
.
Dividing xn−k
u(x) by g(x), we have
xn−k
u(x) = a(x)g(x) + b(x).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 10
Since the degree of g(x) is n − k, the degree of b(x) must be
n − k − 1 or less. Then
b(x) + xn−k
u(x) = a(x)g(x)
is a multiple of g(x) and therefore it is a code polynomial.
b(x) + xn−k
u(x) = b0 + b1x + · · · + bn−k−1xn−k−1
+u0xn−k
+ u1xn−k+1
+ · · · + uk−1xn−1
then corresponds to the code vector
(b0, b1, . . . , bn−k−1, u0, u1, . . . , uk−1).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 11
A (7, 4) Cyclic Code Gnerated by g(x) = 1 + x + x3
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 12
Generator and Parity-Check Matrices
• The generator matrix of an (n, k) code C is as follows:
G =















g0 g1 g2 · · · · · gn−k 0 0 0 · · 0
0 g0 g1 g2 · · · · · gn−k 0 0 · · 0
0 0 g0 g1 g2 · · · · · gn−k 0 · · 0
· ·
· ·
· ·
0 0 · · · 0 g0 g1 g2 · · · · · gn−k















• In general, G is not in systematic form. However, it can be put
into systematic form with row operation.
• Let
xn
+ 1 = g(x)h(x),
where the polynomial h(x) has the degree k and is of the
following form:
h(x) = h0 + h1x + · · · + hkxk
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 13
with h0 = hk = 1.
• A parity-check matrix of C may be obtained from h(x).
• Let v be a code vector in C and v(x) = a(x)g(x). Then
v(x)h(x) = a(x)g(x)h(x)
= a(x)(xn
+ 1)
= a(x) + xn
a(x).
Since the degree of a(x) is k − 1 or less, the powers
xk
, xk+1
, . . . , xn−1
do not appear in a(x) + xn
a(x). Therefore,
k

i=0
hivn−i−j = 0 for 1 ≤ j ≤ n − k.
We take the reciprocal of h(x),
xk
h(x−1
) = hk + hk−1x + hk−2x2
+ · · · + h0xk
,
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 14
and can see that xk
h(x−1
) is also a factor of xn
+ 1. xk
h(x−1
)
then generates an (n, n − k) cyclic code with the following
(n − k) × n matrix as a generator matrix:
H =















hk hk−1 hk−2 · · · · h0 0 0 · · 0
0 hk hk−1 hk−2 · · · · h0 0 · · 0
0 0 hk hk−1 · · · · · h0 · · 0
· ·
· ·
· ·
0 0 · · 0 hk hk−1 hk−2 · · · · h0















Then H is a parity-check matrix of the cyclic code C. We call
h(x) the parity polynomial of C.
• Let C be an (n, k) cyclic code with generator polynomial g(x).
The dual code of C is also cyclic and is generated by the
polynomial xk
h(x−1
), where h(x) = (xn
+ 1)/g(x).
• Let
xn−k−1
= ai(x)g(x) + bi(x) for 0 ≤ i ≤ k − 1,
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 15
where bi(x) = bi0 + bi1 + · · · + bi(n−k−1). Since bi(x) + xn−k+i
are
multiples of g(x), they are code polynomials. Then
G =













b00 b01 b02 · · · b0(n−k−1) 1 0 0 · · · 0
b10 b11 b12 · · · b1(n−k−1) 0 1 0 · · · 0
b20 b21 b22 · · · b2(n−k−1) 0 1 · · · 0
.
.
.
.
.
.
.
.
.
b(k−1)0 b(k−1)1 b(k−1)2 · · · b(k−1)(n−k−1) 0 0 0 · · · 1













.
• The corresponding parity-check matrix for C is
H =













1 0 0 · · · 0 b00 b10 b20 · · · b(k−1)0
0 1 0 · · · 0 b01 b11 b21 · · · b(k−1)1
0 0 1 · · · 0 b02 b12 b22 · · · b(k−1)2
.
.
.
.
.
.
.
.
.
0 0 0 · · · 1 b0(n−k−1) b1(n−k−1) b2(n−k−1) · · · b(k−1)(n−k−1)













.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 16
Encoding of Cyclic Codes
• Encoding process: (1) Multiply u(x) by xn−k
; (2) divide
xn−k
u(x) by g(x); (3) form the code word b(x) + xn−k
u(x).
( ) ( ) ( )
n-k stage
…
Message Xn-ku(X) Code word
Parity-check
digits
g1 g2 gn-k-1
Gate
bn-k-1
b2
b1
b0
•
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 17
Example
• Consider the (7, 4) cyclic code generated by g(x) = 1 + x + x3
.
Suppose that the message u = (1 0 1 1) is to be encoded. The
contentents in the register are as follows:
Input Register contents
0 0 0 (initial state)
1 1 1 0 (first shift)
1 1 0 1 (second shift)
0 1 0 0 (third shift)
1 1 0 0 (fourth shift)
After four shifts, the contents of the register are (1 0 0). Thus
the complete code vector is (1 0 0 1 0 1 1).
(1 0 1 1)
Message Xn-ku(X)
Code word
Gate
Parity digits
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 18
Encoding by Parity Polynomial
• Since hk = 1, we have
vn−k−j =
k−1

i=0
hivn−i−j for 1 ≤ j ≤ n − k,
which is known as a difference equation.
vn−k−1 = h0vn−1+h1vn−2+· · ·+hk−1vn−k = uk−1+h1uk−2+· · ·+hk−1u0
vn−k−2 = uk−2 + h1uk−3 + · · · + hk−1vn−k−1
• Encoding circuit:
Gate2
Gate1 u0 u1 Uk-2 Uk-1
• • • • • •
h1
h2
hk-2
hk-1
+
+
+
+
k stage
° Output to channel
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 19
Example
• The parity polynomial of the (7, 4) cyclic code generated by
g(x) = 1 + x + x3
is
h(x) =
x7
+ 1
1 + x + x3
= 1 + x + x2
+ x4
.
The encoding circuit:
h0 = 1
Gate 2
Gate 1 p
Output
Input
Suppose that the message to be encoded is (1 0 1 1). Then
v3 = 1, v4 = 0, v5 = 1, v6 = 1. The parity-check digits are
v2 = v6 + v3 + v4 = 1 + 1 + 0 = 0
v1 = v5 + v4 + v3 = 1 + 0 + 1 = 0
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 20
v0 = v4 + v3 + v2 = 0 + 1 + 0 = 1.
The code vector that corresponds to the message (1 0 1 1) is
(1 0 0 1 0 1 1).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 21
Syndrome Computation
• Let r = (r0, r1, . . . , rn−1) be the received vector. The syndrome is
calculated as s = r · HT
, where H is the parity-check matrix.
• If syndrome is not identical to zero, r is not a code vector and
the presence of errors has been detected.
• Dividing r(x) by the generator polynomial g(x), we obtain
r(x) = a(x)g(x) + s(x).
• The n − k coefficients of s(x) form the syndrome s. We call s(x)
the syndrome.
r(x)/g(x)  g1
s0 s1
…
Gate
g2 gn-k-1
sn-k-1
r(X)
Received
vector
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 22
• If C is a systematic code, then the syndrome is simply the vector
sum of the received parity digits and the parity-check digits
recomputed from the received information digits.
• Let s(x) be the syndrome of a received polynomial r(x). Then
the remainder s(1)
(x) resulting from dividing xs(x) by the
generator polynomial g(x) is the syndrome of r(1)
(x), which is a
cyclic shift of r(x).
Proof: We have
xr(x) = rn−1(xn
+ 1) + r(1)
(x).
Then
c(x)g(x) + ρ(x) = rn−1g(x)h(x) + x[a(x)g(x) + s(x)],
where ρ(x) is the remainder resulting from dividing r(1)
(x) by
g(x). Then ρ(x) is the syndrome of r(1)
(x). Rearranging the
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 23
above equation, we have
xs(x) = [c(x) + rn−1h(x) + xa(x)]g(x) + ρ(x).
It is clearly that ρ(x) is also the remainder resulting from
dividing xs(x) by g(x). Therefore, ρ(x) = s(1)
(x).
• The remainder s(i)
(x) resulting from dividing xi
s(x) be the
generator polynomial g(x) is the syndrome of r(i)
(x), which is
the ith cyclic shift of r(x).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 24
Example
Consider the (7, 4) cyclic code generated by g(x) = 1 + x + x3
.
Suppose that the received vector is r = (0 0 1 0 1 1 0). The
syndrome of r is s = (1 0 1). As the received vector is shifted into
the circuit, the contents in the register are as follows:
1 0
Gate
1
Gate
input
If the register is shifted once more with the input gate disabled, the
new contents will be s(1)
= (1 0 0), which is the syndrome of
r(1)
= (0 0 0 1 0 1 1).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 25
• We may shift the received vector r(x) into the syndrome register
from the right end. However, after the entire r(x) has been
shifted into the register, the contents in the register do not form
the sybdrome of r(x); rather, they form the syndrome s(n−k)
(x)
of r(n−k)
(x).
g1
s0 s1
…
Gate
g2 gn-k-1
sn-k-1
r(X)
Received vector
xn-kr(x)/g(x) 
Proof: We have
xn−k
r(x) = a(x)g(x) + ρ(x).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 26
It is known that
xn−k
r(x) = b(x)(xn
+ 1) + r(n−k)
(x).
Hence,
r(n−k)
(x) = [b(x)h(x) + a(x)]g(x) + ρ(x).
When r(n−k)
(x) is divided by g(x), ρ(x) is also the remainder.
Therefore, ρ(x) is indeed the syndrome of r(n−k)
(x).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 27
Error Detection
• Let v(x) be the transmitted code word and
e(x) = e0 + e1x + · · · + en−1xn−1
be the error pattern. Then
r(x) = v(x) + e(x) = b(x)g(x) + e(x).
• Following the definition of syndrome, we have
e(x) = [a(x) + b(x)]g(x) + s(x).
This shows that the syndrome is actually equal to the remainder
resulting from dividing the error pattern by the generator
polynomial.
• The decoder has to estimate e(x) based on the syndrome s(x).
• If e(x) is identical to a code vector, e(x) is an undetectable error
pattern.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 28
• The error-detection circuit is simply a syndrome circuit with an
OR gate with the syndrome digits as inputs.
• For a cyclic code, an error pattern with errors confined to i
high-order positions and  − i low-order positions is also regarded
as a burst of length  or less. such a burst is called end-around
burst.
• An (n, k) cyclic code is capable of detecting any error burst of
length n − k or less, including the end-around bursts.
Proof: Suppose that the error pattern is a burst of length of
n − k or less. Then
e(x) = xj
B(x),
where 0 ≤ j ≤ n − 1 and B(x) is a polynomial of degree
n − k − 1 or less. Since the degree of B(x) is less than that of
g(x), B(x) is not divisible by g(x). Since g(x) is a factor of
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 29
xn
+ 1 and x is not a factor of g(x), g(x) and xj
must be
relatively prime. Therefore, e(x) is not divisible by g(x). The
last part of the above statement is left as an exercise.
• The fraction of undetectable bursts of length n − k + 1 is
2−(n−k−1)
.
Proof: Consider the bursts of length n − k + 1 starting from the
ith digit position and ending at the (i + n − k)th digit position.
There are 2n−k−1
such burst. Among these bursts, the only one
that cannot be detected is
e(x) = xi
g(x).
Therefore, the fraction of undetectable bursts of length n − k + 1
starting from the ith digit position is 2−(n−k−1)
.
• For   n − k + 1, the fraction of undetectable error bursts of
length  is 2−(n−k)
. The proof is left as an exercise.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 30
Decoding of Cyclic Codes
• Decoding of linear codes consists of three steps: (1) syndrome
computation; (2) association of the syndrome to an error pattern;
(3) error correction.
• The cyclic structure structure of a cyclic code allows us to
decode a received vector r(x) in serial manner.
• The received digits are decoded one at a time and each digit is
decoded with the same circuitry.
• The decoding circuit checks whether the syndrome ß(x)
corresponds to a correctable error pattern e(x) with an error at
the highest-order position xn−1
(i.e., en−1 = 1).
• If ß(x) does not correspond to an error pattern with en−1 = 1,
the received polynomial and the syndrome register are cyclically
shifted once simultaneously. By doing this, we have r(1)
(x) and
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 31
s(1)
(x).
• The second digit rn−2 of r(x) becomes the first digit of r(1)
(x).
The same decoding processes.
• If the syndrome s(x) of r(x) does correspond to an error pattern
with an error at the location xn−1
, the first received digit rn−1 is
an erroneous digit and it must be corrected by taking the sum
rn−1 ⊕ en−1.
• This correction results in a modified received polynomial, denoted
by r1(x) = r0 + r1x + · · · + rn−2xn−2
+ (rn−1 ⊕ en−1)xn−1
.
• The effect of the error digit en−1 on the syndrome can be
achieved by adding the syndrome of e
(x) = xn−1
to s(x).
• The syndrome s
(1)
1 of r
(1)
1 (x) is the remainder resulting from
dividing x[s(x) + xn−1
] by the generator polynomial g(x).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 32
• Since the remainders resulting from dividing xs(x) and xn
by
g(x) are s(1)
(x) and 1, respectively, we have
s
(1)
1 (x) = s(1)(x) + 1.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 33
Meggitt Decoder I
Gate
Gate
Gate
Gate
Gate
Buffer registers
Syndrome register
Error pattern detection circuit
Syndrome modification
r(X)
Received
vector
Corrected
vector
Feedback connection
ri
ei
s(x) --- r(x)
s(1)(x) --- r(1)(x)
(r0, r1, … , rn-1)
=
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 34
Example
Consider the decoding of the (7, 4) cyclic code generated by
g(x) = 1 + x + x3
. This code has minimum distance 3 and is capable
of correcting any single error. The seven single-error patterns and
their corresponding syndromes are as follows:
(1 0 1)
(1 1 1)
(0 1 1)
(1 1 0)
(0 0 1)
(0 1 0)
(1 0 0)
s(X) = 1 + X2
s(X) = 1 + X + X2
s(X) = X + X2
s(X) = 1 + X
s(X) = X2
s(X) = X
s(X) = 1
e6(X) = X6
e5(X) = X5
e4(X) = X4
e3(X) = X3
e2(X) = X2
e1(X) = X1
e0(X) = X0
Syndrome vector
(s0, s1, s2)
Syndrome
s(X)
Error pattern
e(X)
Suppose that the code vector v = (1 0 1 1 0 1 1) is transmitted and
r = (1 0 1 1 0 1 1).
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 35
Gate
Gate
Gate
Multiplexer
0 1
0
r(X)
Input
Buffer register
r’(X)
Output
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 36
1 0 1
1 0 1
1
0
1 1 1
0 1 1
0
0
1 1 0
1 1 0
1
0
0 1 1
1 0 1
1
0
0 0 1
0 1 1
1 1 0
1 1 1
Initial
1st shift
2st shift
3rd shift
Syndrome
register
Buffer register
Pointer
Correction
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 37
0 0 0
1 1 1
1
0
1 0 1
1 1 1
0
1
0 1 1
0 1 0
1
0
Error corrected
1 0 1
0 0 1
1
0
Corrected word
1 0 1
0 0 0
0 0 0
0 0 0
4th shift
5th shift
6th shift
7th shift
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 38
Meggitt Decoder II
• To decode a cyclic code, the received polynomial r(x) may be
shifted into the syndrome register from the right end for
computing the syndrome.
• When r(x) has been shifted into the syndrome register, the
register contains s(n−k)
(x), which is the syndrome of r(n−k)
(x).
If s(n−k)
(x) corresponds to an error pattern e(x) with en−1 = 1,
the highest-order digit rn−1 of r(x) is erroneous and must be
corrected.
• In r(n−k)
(x), the digit rn−1 is at the location xn−k−1
. When rn−1
is corrected, the error effect must be removed from s(n−k)
(x).
• The new syndrome s
(n−k)
1 (x) is the sum of s(n−k)
(x) and the
remainder ρ(x) resulting from dividing xn−k−1
by g(x). Since
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 39
the degree of xn−k−1
is less than the degree of g(x),
s
(n−k)
1 (x) = s(n−k)
(x) + xn−k−1
.
Error-pattern detection circuit
Syndrome register
Buffer register r(X)
Gate
Gate
Gate
Gate
Gate
r(X)
Corrected
vector
Received
vector
Feedback connection
ri
ei
(Syndrome
modification)
(r0, r1, … ,rn-1)
=
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 40
Example
Again, we consider the decoding of the (7, 4) cyclic code generated by
g(X) = 1 + X + X3
. Suppose that the received polynomial r(X) is
shifted into the syndrome register from the right end. The seven
single-error patterns and their corresponding syndromes are as
follows:
(0 0 1)
(0 1 0)
(1 0 0)
(1 0 1)
(1 1 1)
(0 1 1)
(1 1 0)
s(3)(X) = X2
s(3)(X) = X
s(3)(X) = 1
s(3)(X) = 1 + X2
s(3)(X) = 1 + X + X2
s(3)(X) = X + X2
s(3)(X) = 1 + X
e(X) = X6
e(X) = X5
e(X) = X4
e(X) = X3
e(X) = X2
e(X) = X1
e(X) = X0
Syndrome vector
(s0, s1, s2)
Syndrome
s(3)(X)
Error pattern
e(X)
We see that only when e(X) = X6
occurs, the syndrome is (0 0 1)
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 41
after the entire received polynomial r(X) has been shifted into the
syndrome register. If the single error occurs at the location Xi
with
i = 6, the syndrome in the register will not be (0 0 1) after the entire
received polynomial r(X) has been shifted into the syndrome
register. However, another 6i shifts, the syndrome register will
contain (0 0 1). Based on this fact, we obtain another decoding
circuit for the (7, 4) cyclic code generated by g(X) = 1 + X + X3
.
Graduate Institute of Communication Engineering, National Taipei University
Y. S. Han Cyclic codes 42
Gate
Gate
Gate
Multiplexer
r(X)
Input
Buffer register
r’(X)
Output
Graduate Institute of Communication Engineering, National Taipei University

More Related Content

What's hot (20)

THREE DIMENSIONAL GEOMETRY
THREE DIMENSIONAL GEOMETRYTHREE DIMENSIONAL GEOMETRY
THREE DIMENSIONAL GEOMETRY
 
Engr 213 midterm 2a sol 2010
Engr 213 midterm 2a sol 2010Engr 213 midterm 2a sol 2010
Engr 213 midterm 2a sol 2010
 
Complement in DLD
Complement in DLDComplement in DLD
Complement in DLD
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Tangent and normal
Tangent and normalTangent and normal
Tangent and normal
 
Areas related to Circles - class 10 maths
Areas related to Circles - class 10 maths Areas related to Circles - class 10 maths
Areas related to Circles - class 10 maths
 
Surface area and volume...
Surface area and volume...Surface area and volume...
Surface area and volume...
 
Metric dimesion of circulsnt graphs
Metric dimesion of circulsnt graphsMetric dimesion of circulsnt graphs
Metric dimesion of circulsnt graphs
 
Chapter 4 Integration
Chapter 4  IntegrationChapter 4  Integration
Chapter 4 Integration
 
Basics of Coding Theory
Basics of Coding TheoryBasics of Coding Theory
Basics of Coding Theory
 
Error Detection N Correction
Error Detection N CorrectionError Detection N Correction
Error Detection N Correction
 
Complex integration its uses and types
Complex integration its uses and typesComplex integration its uses and types
Complex integration its uses and types
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 
Complex Number I - Presentation
Complex Number I - PresentationComplex Number I - Presentation
Complex Number I - Presentation
 
Number system
Number systemNumber system
Number system
 
Application of linear algebra in cse
Application of linear algebra in cseApplication of linear algebra in cse
Application of linear algebra in cse
 
BFS
BFSBFS
BFS
 
Inner product spaces
Inner product spacesInner product spaces
Inner product spaces
 
2's complement
2's complement2's complement
2's complement
 
Divrgence theorem with example
Divrgence theorem with exampleDivrgence theorem with example
Divrgence theorem with example
 

Similar to cyclic_code.pdf

DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE ShivangiSingh241
 
Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...
Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...
Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...Leo Asselborn
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerJoshuaAgcopra
 
Kolmogorov complexity and topological arguments
Kolmogorov complexity and topological argumentsKolmogorov complexity and topological arguments
Kolmogorov complexity and topological argumentsshenmontpellier
 
Cyclic code non systematic
Cyclic code non systematicCyclic code non systematic
Cyclic code non systematicNihal Gupta
 
SPDE presentation 2012
SPDE presentation 2012SPDE presentation 2012
SPDE presentation 2012Zheng Mengdi
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)CrackDSE
 
Density theorems for anisotropic point configurations
Density theorems for anisotropic point configurationsDensity theorems for anisotropic point configurations
Density theorems for anisotropic point configurationsVjekoslavKovac1
 
Probabilistic Control of Switched Linear Systems with Chance Constraints
Probabilistic Control of Switched Linear Systems with Chance ConstraintsProbabilistic Control of Switched Linear Systems with Chance Constraints
Probabilistic Control of Switched Linear Systems with Chance ConstraintsLeo Asselborn
 
Efficient end-to-end learning for quantizable representations
Efficient end-to-end learning for quantizable representationsEfficient end-to-end learning for quantizable representations
Efficient end-to-end learning for quantizable representationsNAVER Engineering
 
Integration techniques
Integration techniquesIntegration techniques
Integration techniquesKrishna Gali
 
Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential slides
 
Control of Uncertain Nonlinear Systems Using Ellipsoidal Reachability Calculus
Control of Uncertain Nonlinear Systems Using Ellipsoidal Reachability CalculusControl of Uncertain Nonlinear Systems Using Ellipsoidal Reachability Calculus
Control of Uncertain Nonlinear Systems Using Ellipsoidal Reachability CalculusLeo Asselborn
 
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...Leo Asselborn
 

Similar to cyclic_code.pdf (20)

DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
 
Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...
Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...
Robust Control of Uncertain Switched Linear Systems based on Stochastic Reach...
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewer
 
Kolmogorov complexity and topological arguments
Kolmogorov complexity and topological argumentsKolmogorov complexity and topological arguments
Kolmogorov complexity and topological arguments
 
QMC: Operator Splitting Workshop, A Splitting Method for Nonsmooth Nonconvex ...
QMC: Operator Splitting Workshop, A Splitting Method for Nonsmooth Nonconvex ...QMC: Operator Splitting Workshop, A Splitting Method for Nonsmooth Nonconvex ...
QMC: Operator Splitting Workshop, A Splitting Method for Nonsmooth Nonconvex ...
 
Taylor problem
Taylor problemTaylor problem
Taylor problem
 
Cyclic code non systematic
Cyclic code non systematicCyclic code non systematic
Cyclic code non systematic
 
kactl.pdf
kactl.pdfkactl.pdf
kactl.pdf
 
SPDE presentation 2012
SPDE presentation 2012SPDE presentation 2012
SPDE presentation 2012
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)
 
Density theorems for anisotropic point configurations
Density theorems for anisotropic point configurationsDensity theorems for anisotropic point configurations
Density theorems for anisotropic point configurations
 
Probabilistic Control of Switched Linear Systems with Chance Constraints
Probabilistic Control of Switched Linear Systems with Chance ConstraintsProbabilistic Control of Switched Linear Systems with Chance Constraints
Probabilistic Control of Switched Linear Systems with Chance Constraints
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
 
Efficient end-to-end learning for quantizable representations
Efficient end-to-end learning for quantizable representationsEfficient end-to-end learning for quantizable representations
Efficient end-to-end learning for quantizable representations
 
Integration techniques
Integration techniquesIntegration techniques
Integration techniques
 
Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential
 
Control of Uncertain Nonlinear Systems Using Ellipsoidal Reachability Calculus
Control of Uncertain Nonlinear Systems Using Ellipsoidal Reachability CalculusControl of Uncertain Nonlinear Systems Using Ellipsoidal Reachability Calculus
Control of Uncertain Nonlinear Systems Using Ellipsoidal Reachability Calculus
 
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...
Control of Discrete-Time Piecewise Affine Probabilistic Systems using Reachab...
 
cswiercz-general-presentation
cswiercz-general-presentationcswiercz-general-presentation
cswiercz-general-presentation
 
Assignment6
Assignment6Assignment6
Assignment6
 

Recently uploaded

Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

cyclic_code.pdf

  • 1. Cyclic Codes Yunghsiang S. Han Graduate Institute of Communication Engineering, National Taipei University Taiwan E-mail: yshan@mail.ntpu.edu.tw
  • 2. Y. S. Han Cyclic codes 1 Description of Cyclic Codes • If the components of an n-tuple v = (v0, v1, . . . , vn−1) are cyclically shifted i places to the right, the resultant n-tuple would be v(i) = (vn−i, vn−i+1, . . . , vn−1, v0, v1, . . . , vn−i−1). • Cyclically shifting v i places to the right is equivalent to cyclically shifting v n − i places to the left. • 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 in C. • Code polynomial v(x) of the code vector v is defined as v(x) = v0 + v1x + · · · + vn−1xn−1 . • v(i) (x) = xi v(x) mod xn + 1. Graduate Institute of Communication Engineering, National Taipei University
  • 3. Y. S. Han Cyclic codes 2 Proof: Multiplying v(x) by xi , we obtain xi v(x) = v0xi + v1xi+1 + · · · + vn−i−1xn−1 + · · · + vn−1xn+i−1 . Then we manipulate the equation into the following form: xi v(x) = vn−i + vn−i+1x + · · · + vn−1xi−1 + v0xi + · · · +vn−i−1xn−1 + vn−i(xn + 1) + vn−i−1x(xn + 1) + · · · + vn−1xi−1 (xn + 1) = q(x)(xn + 1) + v(i) (x), where q(x) = vn−i + vn−i+1x + · · · + vn−1xi−1 . • The nonzero code polynomial of minimum degree in a cyclic code C is unique. • Let g(x) = g0 + g1x + · · · + gr−1xr−1 + xr be the nonzero code polynomial of minimum degree in an (n, k) cyclic code C. Then Graduate Institute of Communication Engineering, National Taipei University
  • 4. Y. S. Han Cyclic codes 3 the constant term g0 must be equal to 1. Proof: Suppose that g0 = 0. Then g(x) = g1x + g2x2 + · · · + gr−1xr−1 + xr = x(g1 + g2x + · · · + gr−1xr−2 + xr−1 ). If we shift g(x) cyclically n − 1 places to the right (or one place to the left), we obtain a nonzero code polynomial, g1 + g2x + · · · + gr−1xr−2 + xr−1 , which has a degree less than r. Contradiction. Graduate Institute of Communication Engineering, National Taipei University
  • 5. Y. S. Han Cyclic codes 4 A (7, 4) Cyclic Code Gnerated by g(x) = 1 + x + x3 Graduate Institute of Communication Engineering, National Taipei University
  • 6. Y. S. Han Cyclic codes 5 • Consider the polynomial xg(x), x2 g(x), . . . , xn−r−1 g(x). Clearly, they are cyclic shifts of g(x) and hence code polynomials in C. Since C is linear, a linear combination of g(x), xg(x), . . . , xn−r−1 g(x), v(x) = u0g(x) + u1xg(x) + · · · + un−r−1xn−r−1 g(x) = (u0 + u1x + · · · + un−r−1xn−r−1 )g(x), is also a code polynomial where ui ∈ {0, 1}. • Let g(x) = 1 + g1x + · · · + gr−1xr−1 + xr . be the nonzero code polynomial of minimum degree in an (n, k) cyclic code C. A binary polynomial of degree n − 1 or less is a code polynomial if and only if it is a multiple of g(x). Proof: Let v(x) be a binary polynomial of degree n − 1 or less. Graduate Institute of Communication Engineering, National Taipei University
  • 7. Y. S. Han Cyclic codes 6 Suppose that v(x) is a multiple of g(x). Then v(x) = (a0 + a1x + · · · + an−r−1xn−r−1 )g(x) = a0g(x) + a1xg(x) + · · · + an−r−1xn−r−1 g(x). Since v(x) ia a linear combination of the code polynomials, g(x), xg(x), . . . , xn−r−1 g(x), it is a code polynomial in C. Now let v(x) be a code polynomial in C. Dividing v(x) by g(x), we obtain v(x) = a(x)g(x) + b(x), where the degree of b(x) is less than the degree of g(x). Since v(x) and a(x)g(x) are code polynomials, b(x) is also a code polynomial. Suppose b(x) = 0. Then b(x) is a code polynomial with less degree than that of g(x). Contradiction. • The number of binary polynomials of degree n − 1 or less that are multiples of g(x) is 2n−r . Graduate Institute of Communication Engineering, National Taipei University
  • 8. Y. S. Han Cyclic codes 7 • There are total of 2k code polynomials in C, 2n−r = 2k , i.e., r = n − k. • • The polynomial g(x) is called the generator polynomial of the code. • The degree of g(x) is equal toi the number of parity-check digits of the code. • The generator polynomial g(x) of an (n, k) cyclic code is a factor of xn + 1. Proof: We have xk g(x) = (xn + 1) + g(k) (x). Since g(k) (x) is the code polynomial obtained by shifting g(x) to Graduate Institute of Communication Engineering, National Taipei University
  • 9. Y. S. Han Cyclic codes 8 the right cyclically k times, g(k) (x) is a multiple of g(x). Hence, xn + 1 = {xk + a(x)}g(x). • If g(x) is a polynomial of degree n − k and is a factor of xn + 1, then g(x) generates an (n, k) cyclic code. Proof: A linear combination of g(x), xg(x), . . . , xk−1 g(x), v(x) = a0g(x) + a1xg(x) + · · · + ak−1xk−1 g(x) = (a0 + a1x + · · · + ak−1xk−1 )g(x), is a polynomial of degree n − 1 or less and is a multiple of g(x). There are a total of 2k such polynomial and they form an (n, k) linear code. Let v(x) = v0 + v1x + · · · + vn−1xn−1 be a code polynomial in Graduate Institute of Communication Engineering, National Taipei University
  • 10. Y. S. Han Cyclic codes 9 this code. We have xv(x) = v0x + v1x2 + · · · + vn−1xn = vn−1(xn + 1) + (vn−1 + v0x + · · · + vn−2xn−1 ) = vn−1 (xn + 1) + v(1) (x). Since both xv(x) and xn + 1 are divisible by g(x), v(1) must be divisible by g(x). Hence, v(1) (x) is a code polynomial and the code generated by g(x) is a cyclic code. • Suppose that the message to be encoded is u = (u0, u1, . . . , uk−1). Then xn−k u(x) = u0xn−k + u1xn−k+1 + · · · + uk−1xn−1 . Dividing xn−k u(x) by g(x), we have xn−k u(x) = a(x)g(x) + b(x). Graduate Institute of Communication Engineering, National Taipei University
  • 11. Y. S. Han Cyclic codes 10 Since the degree of g(x) is n − k, the degree of b(x) must be n − k − 1 or less. Then b(x) + xn−k u(x) = a(x)g(x) is a multiple of g(x) and therefore it is a code polynomial. b(x) + xn−k u(x) = b0 + b1x + · · · + bn−k−1xn−k−1 +u0xn−k + u1xn−k+1 + · · · + uk−1xn−1 then corresponds to the code vector (b0, b1, . . . , bn−k−1, u0, u1, . . . , uk−1). Graduate Institute of Communication Engineering, National Taipei University
  • 12. Y. S. Han Cyclic codes 11 A (7, 4) Cyclic Code Gnerated by g(x) = 1 + x + x3 Graduate Institute of Communication Engineering, National Taipei University
  • 13. Y. S. Han Cyclic codes 12 Generator and Parity-Check Matrices • The generator matrix of an (n, k) code C is as follows: G =                g0 g1 g2 · · · · · gn−k 0 0 0 · · 0 0 g0 g1 g2 · · · · · gn−k 0 0 · · 0 0 0 g0 g1 g2 · · · · · gn−k 0 · · 0 · · · · · · 0 0 · · · 0 g0 g1 g2 · · · · · gn−k                • In general, G is not in systematic form. However, it can be put into systematic form with row operation. • Let xn + 1 = g(x)h(x), where the polynomial h(x) has the degree k and is of the following form: h(x) = h0 + h1x + · · · + hkxk Graduate Institute of Communication Engineering, National Taipei University
  • 14. Y. S. Han Cyclic codes 13 with h0 = hk = 1. • A parity-check matrix of C may be obtained from h(x). • Let v be a code vector in C and v(x) = a(x)g(x). Then v(x)h(x) = a(x)g(x)h(x) = a(x)(xn + 1) = a(x) + xn a(x). Since the degree of a(x) is k − 1 or less, the powers xk , xk+1 , . . . , xn−1 do not appear in a(x) + xn a(x). Therefore, k i=0 hivn−i−j = 0 for 1 ≤ j ≤ n − k. We take the reciprocal of h(x), xk h(x−1 ) = hk + hk−1x + hk−2x2 + · · · + h0xk , Graduate Institute of Communication Engineering, National Taipei University
  • 15. Y. S. Han Cyclic codes 14 and can see that xk h(x−1 ) is also a factor of xn + 1. xk h(x−1 ) then generates an (n, n − k) cyclic code with the following (n − k) × n matrix as a generator matrix: H =                hk hk−1 hk−2 · · · · h0 0 0 · · 0 0 hk hk−1 hk−2 · · · · h0 0 · · 0 0 0 hk hk−1 · · · · · h0 · · 0 · · · · · · 0 0 · · 0 hk hk−1 hk−2 · · · · h0                Then H is a parity-check matrix of the cyclic code C. We call h(x) the parity polynomial of C. • Let C be an (n, k) cyclic code with generator polynomial g(x). The dual code of C is also cyclic and is generated by the polynomial xk h(x−1 ), where h(x) = (xn + 1)/g(x). • Let xn−k−1 = ai(x)g(x) + bi(x) for 0 ≤ i ≤ k − 1, Graduate Institute of Communication Engineering, National Taipei University
  • 16. Y. S. Han Cyclic codes 15 where bi(x) = bi0 + bi1 + · · · + bi(n−k−1). Since bi(x) + xn−k+i are multiples of g(x), they are code polynomials. Then G =              b00 b01 b02 · · · b0(n−k−1) 1 0 0 · · · 0 b10 b11 b12 · · · b1(n−k−1) 0 1 0 · · · 0 b20 b21 b22 · · · b2(n−k−1) 0 1 · · · 0 . . . . . . . . . b(k−1)0 b(k−1)1 b(k−1)2 · · · b(k−1)(n−k−1) 0 0 0 · · · 1              . • The corresponding parity-check matrix for C is H =              1 0 0 · · · 0 b00 b10 b20 · · · b(k−1)0 0 1 0 · · · 0 b01 b11 b21 · · · b(k−1)1 0 0 1 · · · 0 b02 b12 b22 · · · b(k−1)2 . . . . . . . . . 0 0 0 · · · 1 b0(n−k−1) b1(n−k−1) b2(n−k−1) · · · b(k−1)(n−k−1)              . Graduate Institute of Communication Engineering, National Taipei University
  • 17. Y. S. Han Cyclic codes 16 Encoding of Cyclic Codes • Encoding process: (1) Multiply u(x) by xn−k ; (2) divide xn−k u(x) by g(x); (3) form the code word b(x) + xn−k u(x). ( ) ( ) ( ) n-k stage … Message Xn-ku(X) Code word Parity-check digits g1 g2 gn-k-1 Gate bn-k-1 b2 b1 b0 • Graduate Institute of Communication Engineering, National Taipei University
  • 18. Y. S. Han Cyclic codes 17 Example • Consider the (7, 4) cyclic code generated by g(x) = 1 + x + x3 . Suppose that the message u = (1 0 1 1) is to be encoded. The contentents in the register are as follows: Input Register contents 0 0 0 (initial state) 1 1 1 0 (first shift) 1 1 0 1 (second shift) 0 1 0 0 (third shift) 1 1 0 0 (fourth shift) After four shifts, the contents of the register are (1 0 0). Thus the complete code vector is (1 0 0 1 0 1 1). (1 0 1 1) Message Xn-ku(X) Code word Gate Parity digits Graduate Institute of Communication Engineering, National Taipei University
  • 19. Y. S. Han Cyclic codes 18 Encoding by Parity Polynomial • Since hk = 1, we have vn−k−j = k−1 i=0 hivn−i−j for 1 ≤ j ≤ n − k, which is known as a difference equation. vn−k−1 = h0vn−1+h1vn−2+· · ·+hk−1vn−k = uk−1+h1uk−2+· · ·+hk−1u0 vn−k−2 = uk−2 + h1uk−3 + · · · + hk−1vn−k−1 • Encoding circuit: Gate2 Gate1 u0 u1 Uk-2 Uk-1 • • • • • • h1 h2 hk-2 hk-1 + + + + k stage ° Output to channel Graduate Institute of Communication Engineering, National Taipei University
  • 20. Y. S. Han Cyclic codes 19 Example • The parity polynomial of the (7, 4) cyclic code generated by g(x) = 1 + x + x3 is h(x) = x7 + 1 1 + x + x3 = 1 + x + x2 + x4 . The encoding circuit: h0 = 1 Gate 2 Gate 1 p Output Input Suppose that the message to be encoded is (1 0 1 1). Then v3 = 1, v4 = 0, v5 = 1, v6 = 1. The parity-check digits are v2 = v6 + v3 + v4 = 1 + 1 + 0 = 0 v1 = v5 + v4 + v3 = 1 + 0 + 1 = 0 Graduate Institute of Communication Engineering, National Taipei University
  • 21. Y. S. Han Cyclic codes 20 v0 = v4 + v3 + v2 = 0 + 1 + 0 = 1. The code vector that corresponds to the message (1 0 1 1) is (1 0 0 1 0 1 1). Graduate Institute of Communication Engineering, National Taipei University
  • 22. Y. S. Han Cyclic codes 21 Syndrome Computation • Let r = (r0, r1, . . . , rn−1) be the received vector. The syndrome is calculated as s = r · HT , where H is the parity-check matrix. • If syndrome is not identical to zero, r is not a code vector and the presence of errors has been detected. • Dividing r(x) by the generator polynomial g(x), we obtain r(x) = a(x)g(x) + s(x). • The n − k coefficients of s(x) form the syndrome s. We call s(x) the syndrome. r(x)/g(x) g1 s0 s1 … Gate g2 gn-k-1 sn-k-1 r(X) Received vector Graduate Institute of Communication Engineering, National Taipei University
  • 23. Y. S. Han Cyclic codes 22 • If C is a systematic code, then the syndrome is simply the vector sum of the received parity digits and the parity-check digits recomputed from the received information digits. • Let s(x) be the syndrome of a received polynomial r(x). Then the remainder s(1) (x) resulting from dividing xs(x) by the generator polynomial g(x) is the syndrome of r(1) (x), which is a cyclic shift of r(x). Proof: We have xr(x) = rn−1(xn + 1) + r(1) (x). Then c(x)g(x) + ρ(x) = rn−1g(x)h(x) + x[a(x)g(x) + s(x)], where ρ(x) is the remainder resulting from dividing r(1) (x) by g(x). Then ρ(x) is the syndrome of r(1) (x). Rearranging the Graduate Institute of Communication Engineering, National Taipei University
  • 24. Y. S. Han Cyclic codes 23 above equation, we have xs(x) = [c(x) + rn−1h(x) + xa(x)]g(x) + ρ(x). It is clearly that ρ(x) is also the remainder resulting from dividing xs(x) by g(x). Therefore, ρ(x) = s(1) (x). • The remainder s(i) (x) resulting from dividing xi s(x) be the generator polynomial g(x) is the syndrome of r(i) (x), which is the ith cyclic shift of r(x). Graduate Institute of Communication Engineering, National Taipei University
  • 25. Y. S. Han Cyclic codes 24 Example Consider the (7, 4) cyclic code generated by g(x) = 1 + x + x3 . Suppose that the received vector is r = (0 0 1 0 1 1 0). The syndrome of r is s = (1 0 1). As the received vector is shifted into the circuit, the contents in the register are as follows: 1 0 Gate 1 Gate input If the register is shifted once more with the input gate disabled, the new contents will be s(1) = (1 0 0), which is the syndrome of r(1) = (0 0 0 1 0 1 1). Graduate Institute of Communication Engineering, National Taipei University
  • 26. Y. S. Han Cyclic codes 25 • We may shift the received vector r(x) into the syndrome register from the right end. However, after the entire r(x) has been shifted into the register, the contents in the register do not form the sybdrome of r(x); rather, they form the syndrome s(n−k) (x) of r(n−k) (x). g1 s0 s1 … Gate g2 gn-k-1 sn-k-1 r(X) Received vector xn-kr(x)/g(x) Proof: We have xn−k r(x) = a(x)g(x) + ρ(x). Graduate Institute of Communication Engineering, National Taipei University
  • 27. Y. S. Han Cyclic codes 26 It is known that xn−k r(x) = b(x)(xn + 1) + r(n−k) (x). Hence, r(n−k) (x) = [b(x)h(x) + a(x)]g(x) + ρ(x). When r(n−k) (x) is divided by g(x), ρ(x) is also the remainder. Therefore, ρ(x) is indeed the syndrome of r(n−k) (x). Graduate Institute of Communication Engineering, National Taipei University
  • 28. Y. S. Han Cyclic codes 27 Error Detection • Let v(x) be the transmitted code word and e(x) = e0 + e1x + · · · + en−1xn−1 be the error pattern. Then r(x) = v(x) + e(x) = b(x)g(x) + e(x). • Following the definition of syndrome, we have e(x) = [a(x) + b(x)]g(x) + s(x). This shows that the syndrome is actually equal to the remainder resulting from dividing the error pattern by the generator polynomial. • The decoder has to estimate e(x) based on the syndrome s(x). • If e(x) is identical to a code vector, e(x) is an undetectable error pattern. Graduate Institute of Communication Engineering, National Taipei University
  • 29. Y. S. Han Cyclic codes 28 • The error-detection circuit is simply a syndrome circuit with an OR gate with the syndrome digits as inputs. • For a cyclic code, an error pattern with errors confined to i high-order positions and − i low-order positions is also regarded as a burst of length or less. such a burst is called end-around burst. • An (n, k) cyclic code is capable of detecting any error burst of length n − k or less, including the end-around bursts. Proof: Suppose that the error pattern is a burst of length of n − k or less. Then e(x) = xj B(x), where 0 ≤ j ≤ n − 1 and B(x) is a polynomial of degree n − k − 1 or less. Since the degree of B(x) is less than that of g(x), B(x) is not divisible by g(x). Since g(x) is a factor of Graduate Institute of Communication Engineering, National Taipei University
  • 30. Y. S. Han Cyclic codes 29 xn + 1 and x is not a factor of g(x), g(x) and xj must be relatively prime. Therefore, e(x) is not divisible by g(x). The last part of the above statement is left as an exercise. • The fraction of undetectable bursts of length n − k + 1 is 2−(n−k−1) . Proof: Consider the bursts of length n − k + 1 starting from the ith digit position and ending at the (i + n − k)th digit position. There are 2n−k−1 such burst. Among these bursts, the only one that cannot be detected is e(x) = xi g(x). Therefore, the fraction of undetectable bursts of length n − k + 1 starting from the ith digit position is 2−(n−k−1) . • For n − k + 1, the fraction of undetectable error bursts of length is 2−(n−k) . The proof is left as an exercise. Graduate Institute of Communication Engineering, National Taipei University
  • 31. Y. S. Han Cyclic codes 30 Decoding of Cyclic Codes • Decoding of linear codes consists of three steps: (1) syndrome computation; (2) association of the syndrome to an error pattern; (3) error correction. • The cyclic structure structure of a cyclic code allows us to decode a received vector r(x) in serial manner. • The received digits are decoded one at a time and each digit is decoded with the same circuitry. • The decoding circuit checks whether the syndrome ß(x) corresponds to a correctable error pattern e(x) with an error at the highest-order position xn−1 (i.e., en−1 = 1). • If ß(x) does not correspond to an error pattern with en−1 = 1, the received polynomial and the syndrome register are cyclically shifted once simultaneously. By doing this, we have r(1) (x) and Graduate Institute of Communication Engineering, National Taipei University
  • 32. Y. S. Han Cyclic codes 31 s(1) (x). • The second digit rn−2 of r(x) becomes the first digit of r(1) (x). The same decoding processes. • If the syndrome s(x) of r(x) does correspond to an error pattern with an error at the location xn−1 , the first received digit rn−1 is an erroneous digit and it must be corrected by taking the sum rn−1 ⊕ en−1. • This correction results in a modified received polynomial, denoted by r1(x) = r0 + r1x + · · · + rn−2xn−2 + (rn−1 ⊕ en−1)xn−1 . • The effect of the error digit en−1 on the syndrome can be achieved by adding the syndrome of e (x) = xn−1 to s(x). • The syndrome s (1) 1 of r (1) 1 (x) is the remainder resulting from dividing x[s(x) + xn−1 ] by the generator polynomial g(x). Graduate Institute of Communication Engineering, National Taipei University
  • 33. Y. S. Han Cyclic codes 32 • Since the remainders resulting from dividing xs(x) and xn by g(x) are s(1) (x) and 1, respectively, we have s (1) 1 (x) = s(1)(x) + 1. Graduate Institute of Communication Engineering, National Taipei University
  • 34. Y. S. Han Cyclic codes 33 Meggitt Decoder I Gate Gate Gate Gate Gate Buffer registers Syndrome register Error pattern detection circuit Syndrome modification r(X) Received vector Corrected vector Feedback connection ri ei s(x) --- r(x) s(1)(x) --- r(1)(x) (r0, r1, … , rn-1) = Graduate Institute of Communication Engineering, National Taipei University
  • 35. Y. S. Han Cyclic codes 34 Example Consider the decoding of the (7, 4) cyclic code generated by g(x) = 1 + x + x3 . This code has minimum distance 3 and is capable of correcting any single error. The seven single-error patterns and their corresponding syndromes are as follows: (1 0 1) (1 1 1) (0 1 1) (1 1 0) (0 0 1) (0 1 0) (1 0 0) s(X) = 1 + X2 s(X) = 1 + X + X2 s(X) = X + X2 s(X) = 1 + X s(X) = X2 s(X) = X s(X) = 1 e6(X) = X6 e5(X) = X5 e4(X) = X4 e3(X) = X3 e2(X) = X2 e1(X) = X1 e0(X) = X0 Syndrome vector (s0, s1, s2) Syndrome s(X) Error pattern e(X) Suppose that the code vector v = (1 0 1 1 0 1 1) is transmitted and r = (1 0 1 1 0 1 1). Graduate Institute of Communication Engineering, National Taipei University
  • 36. Y. S. Han Cyclic codes 35 Gate Gate Gate Multiplexer 0 1 0 r(X) Input Buffer register r’(X) Output Graduate Institute of Communication Engineering, National Taipei University
  • 37. Y. S. Han Cyclic codes 36 1 0 1 1 0 1 1 0 1 1 1 0 1 1 0 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 Initial 1st shift 2st shift 3rd shift Syndrome register Buffer register Pointer Correction Graduate Institute of Communication Engineering, National Taipei University
  • 38. Y. S. Han Cyclic codes 37 0 0 0 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 0 1 0 1 0 Error corrected 1 0 1 0 0 1 1 0 Corrected word 1 0 1 0 0 0 0 0 0 0 0 0 4th shift 5th shift 6th shift 7th shift Graduate Institute of Communication Engineering, National Taipei University
  • 39. Y. S. Han Cyclic codes 38 Meggitt Decoder II • To decode a cyclic code, the received polynomial r(x) may be shifted into the syndrome register from the right end for computing the syndrome. • When r(x) has been shifted into the syndrome register, the register contains s(n−k) (x), which is the syndrome of r(n−k) (x). If s(n−k) (x) corresponds to an error pattern e(x) with en−1 = 1, the highest-order digit rn−1 of r(x) is erroneous and must be corrected. • In r(n−k) (x), the digit rn−1 is at the location xn−k−1 . When rn−1 is corrected, the error effect must be removed from s(n−k) (x). • The new syndrome s (n−k) 1 (x) is the sum of s(n−k) (x) and the remainder ρ(x) resulting from dividing xn−k−1 by g(x). Since Graduate Institute of Communication Engineering, National Taipei University
  • 40. Y. S. Han Cyclic codes 39 the degree of xn−k−1 is less than the degree of g(x), s (n−k) 1 (x) = s(n−k) (x) + xn−k−1 . Error-pattern detection circuit Syndrome register Buffer register r(X) Gate Gate Gate Gate Gate r(X) Corrected vector Received vector Feedback connection ri ei (Syndrome modification) (r0, r1, … ,rn-1) = Graduate Institute of Communication Engineering, National Taipei University
  • 41. Y. S. Han Cyclic codes 40 Example Again, we consider the decoding of the (7, 4) cyclic code generated by g(X) = 1 + X + X3 . Suppose that the received polynomial r(X) is shifted into the syndrome register from the right end. The seven single-error patterns and their corresponding syndromes are as follows: (0 0 1) (0 1 0) (1 0 0) (1 0 1) (1 1 1) (0 1 1) (1 1 0) s(3)(X) = X2 s(3)(X) = X s(3)(X) = 1 s(3)(X) = 1 + X2 s(3)(X) = 1 + X + X2 s(3)(X) = X + X2 s(3)(X) = 1 + X e(X) = X6 e(X) = X5 e(X) = X4 e(X) = X3 e(X) = X2 e(X) = X1 e(X) = X0 Syndrome vector (s0, s1, s2) Syndrome s(3)(X) Error pattern e(X) We see that only when e(X) = X6 occurs, the syndrome is (0 0 1) Graduate Institute of Communication Engineering, National Taipei University
  • 42. Y. S. Han Cyclic codes 41 after the entire received polynomial r(X) has been shifted into the syndrome register. If the single error occurs at the location Xi with i = 6, the syndrome in the register will not be (0 0 1) after the entire received polynomial r(X) has been shifted into the syndrome register. However, another 6i shifts, the syndrome register will contain (0 0 1). Based on this fact, we obtain another decoding circuit for the (7, 4) cyclic code generated by g(X) = 1 + X + X3 . Graduate Institute of Communication Engineering, National Taipei University
  • 43. Y. S. Han Cyclic codes 42 Gate Gate Gate Multiplexer r(X) Input Buffer register r’(X) Output Graduate Institute of Communication Engineering, National Taipei University