Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
BCH Codes
Hsin-Lung Wu
NTPU
OUTLINE
[1] Finite fields
[2] Minimal polynomials
[3] Cyclic Hamming codes
[4] BCH codes
[5] Decoding 2 error-correcting BCH codes
p2.
BCH Codes
[1] Finite fields
1. Irreducible polynomial
f(x)K[x], f(x) has no proper divisors in K[x]
Eg.
f(x)=1+x+x2 is irreducible
f(x)=1+x+x2+x3=(1+x)(1+x2) is not irreducible
f(x)=1+x+x4 is irreducible
p3.
BCH Codes
2. Primitive polynomial
f(x) is irreducible of degree n > 1
f(x) is not a divisor of 1+xm for any m < 2n-1
Eg.
f(x)=1+x+x2 is not a factor of 1+xm for m < 3 so f(x) is a
primitive
polynomial
f(x)= 1+x+x2+x3+x4 is irreducible but
1+x5=(1+x)(1+x+x2+x3+x4) and m=5 < 24-1=15 so f(x)
is not a primitive polynomial
p4.
BCH Codes
3. Definition of Kn[x]
The set of all polynomials in K[x] having degree less than n
Each word in Kn corresponds to a polynomial in Kn[x]
Multiplication in Kn modulo h(x), with irreducible h(x)
of degree n
If we use multiplication modulo a reducible h(x), say, 1+x4
to define multiplication of words in K4, however:
(0101)(0101)(x+x3)(x+x3)
= x2+x6
= x2+x2 (mod 1+x4)
= 0 0000 (K4-{0000} is not closed under multiplication.)
p5.
BCH Codes
Furthermore each nonzero element in Kn can have
an inverse if we use irreducible h(x).
But if we use reducible h(x) then there exists nonzero
element, which has no inverse.
Why?
Let f(x) is nonzero element and h(x) is irreducible
then gcd(f(x),h(x))=1 and so exists
a(x)f(x)+b(x)h(x)=1 =>
a(x)f(x)=1 mod h(x)
and so a(x) is the inverse of f(x)
p6.
BCH Codes
4. Definition of Field (Kn,+,x)
(Kn,+) is an abelian group with identity denoted 0
The operation x is associative
a x ( b x c) = ( a x b ) x c
There is a multiplicative identity denoted 1, with 10
n
1 x a = a x 1 = a, a K
The operation x is distributive over +
a x ( b + c ) = ( a x b ) + ( a x c )
It is communicative
n
a x b = b x a, a,b K
All non-zero elements have multiplicative inverses
Galois Fields: GF(2r)
m
For every prime power order p , there is a unique finite field
of order pm
m
Denoted by GF(p )
p7.
BCH Codes
Example
Let us consider the construction of GF(23) using the
primitive polynomial h(x)=1+x+x3 to define multiplication.
We do this by computing xi mod h(x):
word
xi mod h(x)
100
1
010
x
001
x2
110
x3 1+x
011
x4 x+x2
111
x5 1+x+x2
101
x6 1+x2
p8.
BCH Codes
5. Use a primitive polynomial to construct GF(2n)
Let Kn represent the word corresponding
to x mod h(x)
i xi mod h(x)
m 1 for m<2n-1
since h(x) dose not divide 1+xm for m<2n-1
Since j = i for ji iff i = j-i i
j-i
Kn\{0}={i | i = 0,1,…,2n-2}
=1
p9.
BCH Codes
6. GF(2r) is primitive
is primitive if m 1 for 1 m <2r-1
In other words, every non-zero word in GF(2r) can be
expressed as a power of
Example
Construct GF(24) using the primitive polynomial
h(x)=1+x+x4. Write every vector as a power of
x mod h(x)(see Table 5.1 below)
Note that 15=1.
(0110)(1101)= 5.7= 12=1111
p10.
BCH Codes
Table 5.1 Construction of GF(24) using h(x)=1+x+x4
word
polynomial in x mod h(x)
power of
0000
0
-
1000
1
0=1
0100
x
0010
x2
2
0001
x3
3
1100
1+x=x4
4
0110
x+x2=x5
5
0011
x2+x3=x6
6
p11.
BCH Codes
Table 5.1(continue) Construction of GF(24)
using h(x)=1+x+x4
word
polynomial in x mod h(x)
power of
1101
1+x+x3=x7
7
1010
1+x2=x8
8
0101
x+x3=x9
9
1110
1+x+x2 =x10
10
0111
x+x2+x3 =x11
11
1111
1+x+x2+x3 =x12
12
1011
1+x2+x3 =x13
13
1001
1+x3 =x14
14
p12.
BCH Codes
[2] Minimal polynomials
1. Root of a polynomial
: an element of F=GF(2r), p(x)F[x]
is a root of a polynomial p(x) iff p()=0
2. Order of
The smallest positive integer m such that m=1
in GF(2r) is a primitive element if it has order 2r-1
p13.
BCH Codes
3. Minimal polynomial of
The polynomial in K[x] of smallest degree having as root
Denoted by m(x)
m(x) is irreducible over K
If f(x) is any polynomial over K such that f()=0,
then m(x) is a factor of f(x)
m(x) is unique
r
2
m(x) is a factor of 1 x 1
p14.
BCH Codes
Example
Let p(x)=1+x3+x4, and let be the primitive element
in GF(24) constructed using h(x)=1+x+x4(see Table 5.1):
p()=1+3+4=1000+0001+1100=0101=9
is not a root of p(x). However
p(7)=1+(7)3+(7)4=1+21+28=1+6+13
=1000+0011+1011=0000=0
7 is a root of p(x).
p15.
BCH Codes
4. Finding the minimal polynomial of
Reduce to find a linear combination of the vectors
{1, , 2,…, r}, which sums to 0
Any set of r+1 vectors in Kr is dependent, such a
solution exists
Represent m(x) by mi(x) where =I
eg.
Find the m(x), =3, GF(24) constructed using
h(x)=1+x+x4
p16.
BCH Codes
Useful facts: f(x)2=f(x2)
n
n
n
( ai x ) a ( x ) ai ( x 2 )i
i 2
i 0
i 0
2
i
i 2
i 0
If f()=0, then f(2)=(f())2=0
If is a root of f(x), so are , 2, 4,…, 2r 1
The degree of m(x) is |{, 2, 4,…, 2r 1 }|
p17.
BCH Codes
Example
Find the m(x), =3, GF(24) constructed using
h(x)=1+x+x4
Let m(x)= m3(x)=a0+a1x+a2x2+a3x3+a4x4 then we must
find the value for a0,a1,…,a4 {0,1}
m()=0=a01+a1+a22+a33+a44
=a00+a13+a26+a39+a412
0000=a0(1000)+a1(0001)+a2(0011)+a3(0101)+a4(1111)
a0=a1=a2=a3=a4=1 and
m(x)=1+x+x2+x3+x4
p18.
BCH Codes
Example
Let m5(x) be the minimal polynomials of =5, 5GF(24)
Since {, 2, 4, 8}={5 , 10}, the roots of m5(x) are 5
and 10 which means that degree (m5(x))=2. Thus
m5(x)=a0+a1x+a2x2:
0=a0+a1 5+a2 10
=a0(1000)+a1 (0110)+a2 (1110)
Thus a0=a1=a2=1 and m5(x)=1+x+x2
p19.
BCH Codes
Table 5.2: Minimal polynomials in GF(24)
constructed using 1+x+x4
Element of GF(24)
0
1
, 2, 4, 8
3, 6, 9, 12
5, 10
7, 11, 13, 14
Minimal polynomial
x
1+x
1+x+x4
1+x+x2+x3+x4
1+x+x2
1+x3+x4
p20.
BCH Codes
[3] Cyclic Hamming codes
1. Parity check matrix
The parity check matrix of a Hamming code of length
n=2r-1 has its rows all 2r-1 nonzero words of length r
is a primitive element of
GF(2r)
H is the parity check matrix of a Hamming code of
length n=2r-1
1
H 2
2r 2
p21.
BCH Codes
2. Generator polynomial
For any received word w=w0w1…wn-1
wH=w0+w1+…+wn-1n-1 w()
w is a codeword iff is a root of w(x)
m(x) is its generator polynomial
Theorem 5.3.1
A primitive polynomial of degree r is the generator
polynomial of a cyclic Hamming code of length 2r-1
p22.
BCH Codes
Example:
Let r=3, so n=23-1=7. Use p(x)=1+x+x3 to construct
GF(23), and 010 as the primitive element.
Recall that i xi mod p(x). Therefore a parity check
matrix for a Hamming code of length 7 is
1
100
010
2
001
3
110
H
4
011
5
111
6
101
p23.
BCH Codes
3. Decoding the cyclic Hamming code
w(x)=c(x)+e(x), where c(x) is a codeword,
e(x) is the error
w(β)=e(β)
e has weight 1, e(β)= βj, j is the position of the 1 in e
c(x)=w(x)+xj
p24.
BCH Codes
Example:
Suppose GF(23) was constructed using 1+x+x3.
m1(x)=1+x+x3 is the generator for a cyclic Hamming
code of length 7. Suppose
w(x)=1+x+x3+x6 is received. Then
w()=1+ 2+ 3+ 6
=100+001+110+101
=110
= 3
e(x)= x3 and c(x)=w(x)+x3=1+x2+x6
p25.
BCH Codes
[4] BCH codes
1. BCH: Bose-Chaudhuri-Hocquengham
Admit a relatively easy decoding scheme
The class of BCH codes is quite extensive
For any positive integers r and t with t 2r-1-1, there is a
BCH codes of length n=2r-1 which is t-error correcting and
has dimension k n-rt
p26.
BCH Codes
2. Parity check matrix for the 2 error-correcting BCH
The 2 error-correcting BCH codes of length 2r-1 is the
cyclic linear codes, generated by
g(x)= m ( x )m 3 ( x ) , r 4
0
0
3
H 2
6
2 r 2 3( 2 r 2 )
The generator polynomial:
g(x)=m1(x) m3(x)
Degree(g(x))=2r, the code has
dimension n-2r=2r-1-2r
p27.
BCH Codes
Example:
is a primitive element in GF(24) constructed with p(x)
= 1+x+x4. We have that m1(x)=1+x+x4 and m3(x) =
1+x+x2+x3+x4. Therefore
g(x)= m1(x) m3(x)= 1+x4+x6+x7+x8
is the generator for a 2 error-correcting BCH code of
length 15
p28.
BCH Codes
3. The parity check matrix of C15 (distance d=5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1 1000
3 0100
6
0010
9 0001
12 1100
1 0110
3 0011
6 1101
9 1010
12 0101
1 1110
3 0111
6 1111
9
1011
12 1001
1000
0001
0011
0101
1111
1000
0001
0011 H
0101
1111
1000
0001
0011
0101
1111
(Table 5.3)
p29.
BCH Codes
[5] Decoding 2 error-correcting BCH codes
1. Error locator polynomial
w(x): received word
syndrome wH=[w(),w(3)]=[s1,s3]
H is the parity check matrix for the (2r-1, 2r-2r-1, 5) 2
error-correcting BCH code with generator g(x)=m1(x)
m3(x)
wH=0 if no errors occurred
If one error occurred, the error polynomial e(x)=xi
wH=eH=[e(), e(3)]=[i, 3i]=[s1,s3], s 3 s
1
3
p30.
BCH Codes
If two errors occurred, say in positions i and j, ij,
e(x)=xi+xj, wH=eH=[e(), e(3)]
=[i+j, 3i+3j]=[s1,s3]
s3 3i 3 j ( i j )( 2i i j 2 j ) s1 ( s12 i j )
s3
i
j
s12 i j , let ( x )( x ) 0
s1
The error locator polynomial:
x 2 s1 x (
s3
s12 ) 0
s1
p31.
BCH Codes
Example:
Let ww(x) be a received word with syndromes
s1=0111=w() and s3=1010= w(3), where w was
encoded using C15. From Table 5.1 we have that
s1 11 and s3 8. Then
s3
s12 8 11 22 12 7 2
s1
We form the polynomial x2+11x+2 and find that it
has roots 4 and 13. Therefore we can decide that
the most likely errors occurred in positions 4 and 13,
e(x)= x4+x13, the most likely error pattern is
0000100000000010
p32.
BCH Codes
2. Decoding algorithm of BCH codes
Calculate the syndrome wH=[s1,s3]=[w(),w(3)]
If s1=s3=0, no errors occurred
If s1=0 and s30, ask for retransmission
If (s1)3=s3, a single error at position i, where s1=i
From the quadratic equation:
s3
x s1 x ( s12 ) 0
s1
2
(*)
If equation(*) has two distinct roots i and j,
correct errors at positions i and j
If equation(*) does not have two distinct roots in
GF(2r), conclude that at least three errors occurred
p33.
BCH Codes
Example:
Assume w is received and the syndrome is
wH=01111010 [11,8]. Now
s13 ( 11 )3 33 3 8 s3
In this case equation(*) is x2+11x+2=0 which has roots
4 and 13. Correct error in positions i=4 and j=13.
Example:
Assume the syndrome is wH=[w(),w(3)]=[3, 9]. Then
(s1)3= (3)3=s3. A single error at position i=3. e(x)=x3 is
the error polynomial.
p34.
BCH Codes
Example
Assume w=110111101011000 is received.
The syndrome is
wH=01110110 [11, 5]= [s1,s3].
Now
s13 ( 11 )3 33 3 s3 5
s3
s12 5 11 22 9 7 0101 1101 1000 0
s1
So in this case, (*) becomes x2+11x+0=0.
p35.
BCH Codes
So in this case, (*) becomes x2+11x+0=0.
Trying the elements of GF(24) in turn as possible roots,
we come to x= 7 and find
(7)2+117+0=14+3+0
1001+0001+1000=0000
Now 7j=1=15, so j=8, is the other root.
Correct error at positions i=7 and j=8;
u=000000011000000 is the most likely error pattern.
We decode v=w+u=110111110011000
as the word sent.
p36.
BCH Codes
Example: Assume a codeword in C15 is sent, and errors
occur in positions 2, 6 and 12. Then the syndrome wH is
the sum of rows 2, 6, and 12 of H, where w is the word
received. Thus
wH=00100011+00110001+11110011
= 11100001 [10, 3]= [s1,s3]
Now
s13 ( 10 )3 30 1 s3 3
s3
s12 3 10 20 8 5 1010 0110 1100 4
s1
(*) becomes x2+10x+4=0, no roots in GF(24). Therefore
IMLD for C15 concludes correctly, that at least three errors
occurred.
p37.