Professional Documents
Culture Documents
Cyclic Codes
Targets today
Taxonomy of coding
How cyclic codes are defined?
Systematic and nonsystematic codes
Why cyclic codes are used?
How their performance is defined?
How practical encoding and decoding circuits are realized?
How to construct cyclic codes?
Taxonomy of Coding
Error
Correction
Coding
= FEC
- no feedback
channel
- quality paid
by redundant
bits
Cryptography
(Ciphering)
- Secrecy/ Security
- Encryption (DES)
Source
Coding
- Makes bits
equal
probable
Compression
Coding
Error
Detection
Coding
- used
in ARQ
as in TCP/IP
- feedback channel
- retransmissions
- quality paid by delay
Error Control
Coding
- Strives to
utilize
channel
capacity by
adding
extra bits
- Redundancy removal:
- Destructive (jpeg, mpeg)
- Non-destructive (zip)
Line Coding
- for baseband
communications
- RX synchronization
- Spectral shaping
for BW requirements
- error detection
Background
Block and
convolutional coding
k bits
(n,k)
(n,k)
encoder
encoder
n bits
t n
1
1 RC log 2 i=1 note: q = n k = n(1 RC )
n
i
Example
Consider a relatively high SNR channel such that only 1 or 2 bit errors
are likely to happen. Consider the ration
t n
1
1 Rc log 2
n
i=1 i
k-bits
n-bits
(n,k)
(n,k)
block
blockcoder
coder
RC = k / n
nk
Number of check-bits
( n, k )
= Number of 2-bit error patterns
n n
log 2 +
1 2
This demonstrates that long codes are more advantages when a high
code rate and high error correction capability is required
(n,1) Repetition codes. High coding gain (minimum distance always n1), 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, m 3
Maximum-length codes. For every integer k 3 there exists a
maximum length code (n,k) with n = 2k - 1,dmin = 2k-1.
BCH-codes. For every integer m 3 there exist a code with n = 2m-1,
k n mt and d min 2t + 1 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. For these
codes n = 2 m 1, number of check symbols n k = 2t and d min = 2t + 1
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
An (n,k) linear code X is called a cyclic code when every cyclic shift of
a code X, as for instance X, is also a code, e.g.
Each (n,k) cyclic code has the associated code vector with the n-bit code
polynomial
n 1
n2
X( p ) = xn1 p
+ xn2 p
+ " + x1 p + x0
Note that the (n,k) code vector has the polynomial of degree of n-1 or
less. Mapping between code vector and code polynomial is one-to-one,
e.g. they specify each other uniquely
Manipulation of the associated polynomial is done in a Galois field (for
instance GF(2)) having elements {0,1}, where operations are performed
mod-2. Thus results are always {0,1} -> binary logic circuits applicable
For each cyclic code, there exists only one generator polynomial whose
degree equals the number of check bits q=n-k in the encoded word
10
p3 + 1 p3 + p
X ( i ) ( p ) = p ( i ) X( p ) mod( p n + 1)
p3 + 1
Example:
101 X( p ) p 2 + 1
3
Shift left by 1 bit: pX( p ) p + p
p +1
not a three-bit code (1010),
divide by the common factor
pX( p )
p +1
=
1
+
011 n-1 bit rotated code word
3
3
p +1
p +1
Important point of implementation is is that the division by pn+1 can be
realized by a tapped shift register.
11
Prove that
(1)
(2)
xn1
p n + 1 ) xn1 p n + xn2 p n1 + " + x1 p 2 + x0 p
xn1 p n + xn1
xn2 p n1 + " + x1 p 2 + x0 p + xn1 X '( p )
X ( i ) ( p ) = p ( i ) X( p ) mod( p n + 1)
12
M ( p ) = mk 1 p k 1 + mk 2 p k 2 + " + m1 p + x0
and the n-1 degree code is
13
must be a multiple of G
14
21x + 7 y = 4 21, 3 7 = 21 = 1 + p 2 , M = 7
x = 1 y = 33
x = 2 y = 3 2
x = 3 y = 3 1
15
p 7 + 1 = ( p + 1)( p 3 + p + 1)( p 3 + p 2 + 1)
( p 2 + 1)( p 3 + p + 1) = p 5 + p 2 + p + 1
n = 7 k = 4
k-bits
n-bits
(n,k)
(n,k)
cyclicencoder
encoder 0100111
0101 cyclic
16
17
xn-1
x1
x0
Encoded bits
Fibonacci-form
Galois-form
XOR-circuit
Delay
element
18
x1
x3
word to be
encoded
x0
generator polynomial
determines connection
of taps
( p + 1)( p 3 + p + 1)
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
out
0
0
0
1
1
1
0
1
0
= p 4 + p 2 + p + p3 + p + 1
= p 4 + p 3 + p 2 + 1 11101
Encoded word
19
x0
xn-1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
X
0
1
0
1
0
0
101 X( p ) = p 2 + 1
Determines tap
connections
pX( p )
p +1
=
1
+
011
3
3
p +1
p +1
B
0
0
1
1
0
1
C
0
0
0
1
1
0
D
0
1
1
1
0
1
Word to be rotated
(divided by the common factor)
pX ( p ) = p 3 + p
A
0
1
1
0
1
0
load / read
Alternate way to
realize rotation
Maple script:
Remainder
Timo O. Korhonen, HUT Communication Laboratory
20
G ( p ) = p q + p q1 g q1 " + pg1 + 1, q = n k
and G(p) is a factor of pn+1, as noted earlier. Any factor of pn+1 that has
the degree q (the number of check bits) may serve as the generator
polynomial. We noticed earlier that a cyclic code is generated by the
multiplication
X( p ) = M ( p )G ( p )
G ( p) = p 3 + 0 + p + 1
Some cyclic codes:
21
Define the length q=n-k check vector C and the length-k message
vector M by M ( p ) = m p k 1 + " + m p + m
k 1
C( p ) = cq1 p q1 + " + c1 p + c0
X( p ) = p nk (mk 1 p k 1 + " + m1 p + m0 )
+ cq1 p q1 + " + c1 p + c0
= p q M ( p ) + C( p )
message bits
check bits
n-bits
(n,k)
(n,k)
cyclic
cyclicencoder
encoder
22
Determining check-bits
X( p ) = M ( p )G ( p ) = p q M ( p ) + C( p )
C( p )
p nk M ( p )
= M ( p) +
G ( p)
G ( p)
7
7 5 1
= 1+
5
5
Definition of systematic cyclic code
G ( p) = p 3 + p 2 + 1
M ( p) = p 3 + p
p M( p) = p p
74
p nk M ( p ) / G ( p ) = p 3 + p 2 + 1 + 1N
C ( p )
Q( p)
p nk M ( p ) + C( p ) = p 3 ( p 3 + p ) + 1 = p 6 + p 4 + 1
23
p M( p) = p p
74
p nk M ( p ) / G ( p ) = p 3 + p 2 + 1 + 1N
C ( p )
Q( p)
p nk M ( p ) + C( p ) = p 3 ( p 3 + p ) + 1 = p 6 + p 4 + 1
p3 + p 2 + 1
p3 + p 2 + 1 p6 + p4 + 1
p6 + p5 + p3
p5 + p 4 + p3 + 1
p5 + p 4 + p 2
p3 + p2 + 1
p3 + p2 + 1
24
25
S( p ) = mod [ R ( p ) / G ( p ) ]
This can be expressed also in terms of the error E(p) and the
code word X(p) while noting that the received word is in terms of error
R ( p ) = X ( p ) + E( p )
hence
S( p ) = mod {[ X( p ) + E( p )] / G ( p )}
S( p ) = mod [ E( p ) / G ( p ) ]
Timo O. Korhonen, HUT Communication Laboratory
26
16.20 s ( x) = mod [ e( x ) / g ( x )]
27
Table 16.6
s ( x) = mod [ r ( x) / g ( x) ]
g ( x)
28
x1
xn-1
0
received code
syndrome
G ( p) = p 3 + p + 1
S( p ) = mod [ R ( p ) / G ( p ) ]
29
Lessons learned
You can construct cyclic codes starting from a given factored pn+1
polynomial by doing simple calculations in GF(2)
You can estimate strength of designed codes
You understand how to apply shift registers with cyclic codes
You can design encoder circuits for your cyclic codes
You understand how syndrome decoding works with cyclic codes and
you can construct the respect decoder circuit
30