Handout Example Section 4

1
Handout Example Section 4.5: Correcting Errors in BCH Codes
Example: Suppose we have [15, 5] BCH code that will correct t = 3 errors whose generating polynomial
for constructing codewords is given by
g ( x)  x10  x 8  x 5  x 4  x 2  x  1 .
This code was constructed using a finite field of 2 4  16 elements using the primitive polynomial
p( x)  x 4  x  1 over Z 2 . Using the primitive element a, the nonzero elements of the finite field that p(x)
generates is given by
ai
Remainder
a
a
ai
Remainder
a9
a3  a
a 2  a 1
a2
a2
a 10
3
3
11
a
a
a4
a 1
a5
a2  a
6
a a
a
3
2
a3  a 1
a7
a
a
a3  a2  a
a 12
a3  a 2  a 1
a 13
a3  a 2 1
a
14
a3 1
a 15
1
a 1
8
2
Suppose now they we construct and send the codeword given by the binary string
1 0 0 0 1 0 1 0 0 0 0 1 1 1 0.
In polynomial form, this produces (recall that all codewords are of length n  2 4  1  15 , which is also the
number of non-zero finite field elements, thus giving a polynomial with coefficients of terms
x 0  1, x, x 2 ,  x14 ) the following codeword polynomial:
c( x)  (1)(1)  (0) x  (0) x 2  (0) x3  (1) x 4  (0) x5  (1) x 6  (0) x 7  (0) x8  (0) x9  (0) x10  (1) x11  (1) x12  (1) x13  (0) x14
 1  x  x 4  x 6  x11  x12  x13.
Suppose when this codeword is transmitted, we instead receive the binary string
111010110001100
which in polynomial form translates to the polynomial
r ( x)  1  x  x 2  x 4  x 6  x 7  x11  x12 .
Note when comparing c(x) and r(x), one can see that 3 errors have occurred in the coefficients of x 2 , x 7 ,
and x 13 . Since of course we would not have the luxury of knowing what codeword c(x) was sent when
r (x) is received, we must go through the process of error correction.
2
To do the error correction, we first must construct the syndromes, that is, compute
ri  r (a i ) , i  1,  2t  1 6 .
Using r (x) and the finite field table above to simplify, we obtain (noting the / marks represent cancellation
in mod 2 arithmetic)
r1  r (a)  1  a  a 2  a 4  a 6  a 7  a 11  a 12
3
2
3
3
3
2
 1  a  a 2  a

a
 a

 a 2
 a  a

a


  1  a

 a
 
 
1  a
a
1
a4
a6
a7
a11
a12
 a
r2  r (a 2 )  r (a) 2  a 2 .
r3  r (a 3 ) 

1  a 3  (a 3 ) 2  (a 3 ) 4  (a 3 ) 6  (a 3 ) 7  (a 3 )11  (a 3 )12
1  a 3  a 6  a 12  a 18  a 21  a 33  a 36
 1  a 3  a 6  a 12  a 15  a 3  a 15  a 6  (a 15 ) 2  a 3  (a 15 ) 2  a 6

1  a 3  a 6  a 12  1  a 3  1  a 6  (1) 2  a 3  (1) 2  a 6

1  a 3  a 6  a 12  a 3  a 6  a 3  a 6

1  a 3  a 6  a 12

3
2
2
1  a 3  a

a
 a3

a



a
1
a6
a12

aa

a9
3
r4  r (a 4 )  [r (a 2 )] 2  (a 2 ) 2  a 4
r5  r (a 5 ) 

1  a 5  (a 5 ) 2  (a 5 ) 4  (a 5 ) 6  (a 5 ) 7  (a 5 )11  (a 5 )12
1  a 5  a 10  a 20  a 30  a 35  a 55  a 60
 1  a 5  a 10  a 15  a 5  (a 15 ) 2  (a 15 ) 2  a 5  (a 15 ) 3  a 10  (a 15 ) 4


1  a 5  a 10  1  a 5  (1) 2  (1) 2  a 5  (1) 3  a 10  (1) 4
1  a 5  a 10  a 5  1  a 5  a 10  1

a5 1

a2a  1
a6
2

a  a 1

a 10
r6  r (a 6 )  [r (a 3 )] 2  (a 9 ) 2  a18  a15a 3  (1)a 3  a 3 .
Summarizing, the syndromes are r1  a, r2  a 2 , r3  a 9 , r4  a 4 , r5  a10 and r6  a 3 . For the
received polynomial to have been a codeword, the syndromes would have had to been all zero. Since at
least one is not, we must proceed in the correction process. Note the syndromes are expressed in terms of
the powers of the primitive element a and not reduced modulo the primitive polynomial p (x) . The reasons
for this will be seen later.
3
Since we must correct errors, our goal is to find the error polynomial e(x) where c( x)  r ( x)  e( x) , that is
the error polynomial that will correct r (x) . The polynomial e(x) will contain terms (the powers of x)
where r (x) and c(x) differ, that is, where the errors occur. Hence, e(x) will have the form
e( x)  x m1  x m2    x
mp
where p  t .
Since this code will correct a maximum of t  3 errors, will assume the worse case scenario, that is,
assume p  3 . Then e( x)  x m1  x m2  x m3 . We need the find m1, m2 , and m3 to find the error
positions. We translate this into a problem of finding the roots of the error locator polynomial, that is, the
powers of the primitive element a that are roots of
E ( z )  ( z  a m1 )( z  a m2 )  ( x  a
mp
)  z p   1z p 1   2 z p  2     p 1   p .
Since p  3 , this polynomial for this example would be
E ( z )  ( z  a m1 )( z  a m2 )( x  a m3 )  z 3  1z 2   2 z   3 .
To find E (z ) , we must find the coefficients 1,  2 , and  3 . Recall this is done through the use of the
syndromes found above by solving the system of equations
 r1
r
2


rp
r2
r3

rp 1
rp    p   rp 1 
 rp 1   p 1  rp  2 


.

      


 
 r2 p 1    1   r2 p 

Since p  3 , we want to solve the system:
 r1
r
2
 r3
r2
r3
r4
r3   3  r4 
r4   2    r5 
r5  1  r6 
Substituting the syndromes r1  a, r2  a 2 , r3  a 9 , r4  a 4 , r5  a10 and r6  a 3 found above
gives the system
a
 2
a
a 9

a2
a9
a4
a 9   3   a 4 

 
a 4   2   a10 
a10   1   a 3 

 
 a4 
 a a 2 a9 
 
 2
9
4
Using the coefficient matrix A  a
a
a  and right hand side vector b  a10  , we use Cramer’s
 a3 
a 9 a 4 a10 
 


rule to solve the system using the following equations:
4
3 
det( A3 )
det( A1 )
det(A2 )
, 2 
, and  1 
det(A)
det( A)
det( A)
where








 4
2
9
4
9
2
4
a
a 
a 
a 
a a
a a
a
A1  a10 a 9 a 4  , A2  a 2 a10 a 4  , and A3  a 2 a 9 a10  .
 9

 9

 3

4
a 3 a10 
a 4 a10 
a3 
a
a a
a

 



 b

b
b 





For the system to have a solution, det( A)  0 . We calculate the determinant, noting that subtraction is
treated as addition since all computations are being performed in mod 2 arithmetic, as follows:
det( A) 
a9
a 4
a
a4
a2
 a2 9
a
10
a
a4
10
a
a2
 a9 9
a
a9
a4
 a (a19  a 8 )  a 2 (a12  a13 )  a 9 (a 6  a18 )

a 20  a 9  a14  a 15  a 15  a 27

a15a 5  a 9  a14  a15a12

1  a 5  a 9  a14  1  a12

a 5  a 9  a14  a12
2
3
3
3
2
a
a  a
a  a

a 
a1
 

 1  a

a5
a9
a14
3

a a

a9
a12
One can show similarly that det( A1)  a , det(A2 )  a 7 , and det( A3 )  a10 . Before proceding, we mention
the following fact. If m  2 n  1 represents the number of non-zero field elements, then we know from
group theory that a m  1 . Hence, for negative exponents, we can rewrite a  j  (1)a  j  a m a  j  a m  j .
In this example, m  15 . This fact will allow us to write the coefficients of the error locator polynomial
E (z ) in terms of positive exponents. Hence, we have
3 
2 
1 
det( A1 )

det( A)
det( A2 )

det( A)
det( A3 )

det( A)
a
9
a
a7
a
9
 a 8 
a7
 a  2  a15 2  a13
a10
a9
a158 

a
Thus,
E( z)  z 3  1z 2   2 z   3  z 3  a z 2  a13z  a7 .
The powers of the error positions will correspond to the powers of the primitive element a that are the
roots of E (z ) . Since the primitive element a generates m  2 n  1  2 4  1  15 elements, we must
substitute the powers a, a 2 , a3 ,, a m  1 or a, a 2 , a3 , , a14, a15  1 into E (z ) until we have
generated its roots (in this example, since E (z ) is of degree 3, it will have 3 distinct roots). We obtain the
following results:
5
3
3
E (a)  a3  a(a) 2  a13(a)  a 7  a 3  a 3  a14  a 7  a

a
1

a
0
 1  a
 


a14
a7
3
2
2
3
E (a 2 )  (a 2 )3  a(a 2 ) 2  a13(a 2 )  a 7  a 6  a5  a15  a 7  a

a

a  
1  a
1  0 **

 a
 
 a



a6
a5
a15
a7
E (a )  (a )  a(a )  a a  a  a  0
3
3 3
3 2
13 3
7
3
E (a 4 )  a 3  a  0
E (a 5 )  a 3  a 2  0
E (a 6 )  a 3  a 2  1  0
E (a 7 )  0 **
E (a 8 )  a 3  1  0
E (a 9 )  a 3  a 2
E (a10 )  a  1  0
E (a11)  a 3  a 2  0
E (a12 )  a 2  a  1  0
E (a13)  0 ** (note we can stop here since all three roots have been found)
E (a14 )  a  0
E (a15 )  E (1)  a 2  1  0 .
Hence, a 2 , a 7 , and a13 are roots of the error locator polynomial E (z ) . These powers of a give the
powers of x in the error polynomial e(x) . Hence
e( x)  x 2  x 7  x13 .
To compute the codeword, we compute
c( x)  r ( x)  e( x)  (1  x  x 2  x 4  x 6  x 7  x11  x12 )  ( x 2  x 7  x13)
 1  x  x 4  x 6  x11  x12  x13