You are on page 1of 35

BCH Codes

Yunghsiang S. Han

Graduate Institute of Communication Engineering,


National Taipei University
Taiwan
E-mail: yshan@mail.ntpu.edu.tw

Y. S. Han

BCH codes

Description of BCH Codes


The Bose, Chaudhuri, and Hocquenghem (BCH) codes form a
large class of powerful random error-correcting cyclic codes.
This class of codes is a remarkable generalization of the
Hamming code for multiple-error correction.
We only consider binary BCH codes in this lecture note.
Non-binary BCH codes such as Reed-Solomon codes will be
discussed in next lecture note.
For any positive integers m 3 and t < 2m1 , there exists a
binary BCH code with the following parameters:
Block length:
Number of parity-check digits:
Minimum distance:

n = 2m 1

n k mt

dmin 2t + 1.

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

We call this code a t-error-correcting BCH code.


Let be a primitive element in GF (2m ). The generator
polynomial g(x) of the t-error-correcting BCH code of length
2m 1 is the lowest-degree polynomial over GF (2) which has
, 2 , 3 , . . . , 2t
as its roots.
g(i ) = 0 for 1 i 2t and g(x) has , 2 , . . . , 2t and their
conjugates as all its roots.
Let i (x) be the minimal polynomial of i . Then g(x) must be
the least common multiple of 1 (x), 2 (x), . . . , 2t (x), i.e.,
g(x) = LCM{1 (x), 2 (x), . . . , (x)2t }.
If i is an even integer, it can be expressed as i = i" 2! , where i" is
Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

odd and " > 1. Then =


i (x) = i! (x).

"2!

i!

is a conjugate of . Hence,

g(x) = LCM{1 (x), 3 (x), . . . , 2t1 (x)}.


The degree of g(x) is at most mt. That is, the number of
parity-check digits, n k, of the code is at most equal to mt.
If t is small, n k is exactly equal to mt.
Since is a primitive element, the BCH codes defined are usually
called primitive (or narrow-sense) BCH codes.

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

Example
Let be a primitive element of GF (24 ) such that 1 + + 4 = 0.
The minimal polynomials of , 3 , and 5 are
1 (x)

1 + x + x4 ,

3 (x)

1 + x + x2 + x3 + x4 ,

5 (x)

1 + x + x2 ,

respectively. The double-error-correcting BCH code of length


n = 24 1 = 15 is generated by
g(x)

LCM{1 (x), 3 (x)}

(1 + x + x4 )(1 + x + x2 + x3 + x4 )

1 + x4 + x6 + x7 + x8 .

n k = 8 such that this is a (15, 7, 5) code. Since the weight of


Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

the generator polynomial is 5, it is a (15, 7, 5) code.


The triple-error-correcting BCH code of length 15 is generated by
g(x) =

LCM{1 (x), 3 (x), 5 (x)}

(1 + x + x4 )(1 + x + x2 + x3 + x4 )(1 + x + x2 )

1 + x + x2 + x4 + x5 + x8 + x10 .

n k = 10 such that this is a (15, 5, 7) code. Since the weight


of the generator polynomial is 7, it is a (15, 5, 7) code.
The single-error-correcting BCH code of length 2m 1 is a
Hamming code.

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes



Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

Examples of Finite Fields



Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

BCH Codes of Lengths Less than 210 1 (1)

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

BCH Codes of Lengths Less than 210 1 (2)

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

Graduate Institute of Communication Engineering, National Taipei University

10

Y. S. Han

BCH codes

Graduate Institute of Communication Engineering, National Taipei University

11

Y. S. Han

BCH codes

Minimal Polynomials of the Elements in GF (26 )

Graduate Institute of Communication Engineering, National Taipei University

12

Y. S. Han

BCH codes

Generator Polynomials of All BCH Codes of Length 63

Graduate Institute of Communication Engineering, National Taipei University

13

Y. S. Han

BCH codes

Parity-Check Matrix of a BCH Code


We can define a t-error-correcting BCH code of length
n = 2m 1 in the following manner: A binary n-tuple
v = (v0 , v1 , . . . , vn1 ) is a code word if and only if the polynomial
v(x) = v0 + v1 x + + vn1 xn1 has , 2 , . . . , 2t as roots.
Since i is a root of v(x) for 1 i 2t, then
v(i ) = v0 + v1 i + v2 2i + + vn1 (n1)i = 0.

Graduate Institute of Communication Engineering, National Taipei University

14

Y. S. Han

BCH codes

This equality can be written as a matrix product as follows:

2i

=0
(v0 , v1 , . . . , vn1 )

..

(n1)i
for 1 i 2t.

Graduate Institute of Communication Engineering, National Taipei University

15

(1)

Y. S. Han

BCH codes

Let

H=

( )

( )

( )

1
..
.

(3 )

(3 )2

(3 )3

(2t )

(2t )2

(2t )3

2 2

2 3

16

n1

2 n1

( )

(3 )n1
..
.

(2t )n1

(2)

From (1), if v = (v0 , v1 , . . . , vn1 ) is a code word in the


t-error-correcting BCH code, then
v H T = 0.
If an n-tuple v satisfies the above condition, i is a root of the
polynomial v(x). Therefore, v must be a code word in the
t-error-correcting BCH code.
Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

17

H is a parity-check matrix of the code.


If for some i and j, j is a conjugate of i , then v(j ) = 0 if and
only if v(i ) = 0.
The H matrix can be reduced to

2
3

1
(3 )
(3 )2
(3 )3

5
5 2
5 3
1
(
)
(
)
(
)
H=

.
..

1 (2t1 ) (2t1 )2 (2t1 )3

n1

3 n1

( )

(5 )n1
..
.

(2t1 )n1

If each entry of H is replaced by its corresponding m-tuple over


GF (2) arranged in column form, we obtain a binary parity-check
matrix for the code.
Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

18

BCH Bound
The t-error-correcting BCH code defined has minimum distance
at least 2t + 1.
Proof: We need to show that no 2t of fewer columns of H sum
to zero. Suppose that there exists a nonzero code vector v with
weight 2t. Let vj1 , vj2 , . . . , vj be the nonzero components of
v. Then
0

v HT

j1

j2

j
3
= (vj1 , vj2 , . . . , vj )

.
..

2 j1

( )

2 j2

( )

(2 )j3
..
.
(2 )j

2t j1

( )

2t j2

( )

(2t )j3
..
.

(2t )j

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

j1

j2

j
3
(1, 1, . . . , 1)

.
..

j1 2

( )

j2 2

( )

(j3 )2
..
.
(j )2

19

j1 2t

( )

j2 2t

( )

(j3 )2t
..
.

(j )2t

The equality above implies the following equality:

j1
j1 2
j1

( ) ( )

j2 (j2 )2 (j2 )

j
j3 2
j3
3

( ) ( ) = 0,
(1, 1, . . . , 1)

.
..
..

..
.
.

j (j )2 (j )

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

which the second matrix on the left is a square matrix. To


satisfy the above equality, the determinant of the matrix
must be zero. That is,
)
)
) j1 (j1 )2 (j1 ) )
)
)
)
)
j
j
2
j

) 2 ( 2 ) ( 2 ) )
)
)
) j
)
) 3 (j3 )2 (j3 ) ) = 0.
)
)
) .
)
..
..
) ..
)
.
.
)
)
)
)
) j (j )2 (j ) )

Graduate Institute of Communication Engineering, National Taipei University

20

Y. S. Han

BCH codes

Then

j1 +j2 ++j

)
)
)
)
)
)
)
))
)
)
)
)
)

j1

j2

1
..
.

j3
..
.

21

j1 (1)

j2 (1)

j3 (1)
..
.

j (1)

)
)
)
)
)
)
)
) = 0.
)
)
)
)
)
)

The determinant in the equality above is a Vandermonde


determinant which is nonzero. Contradiction!
The parameter 2t + 1 is usually called the designed distance of
the t-error-correcting BCH code.
The true minimum distance of the code might be larger than
2t + 1.

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

Syndrome Calculation
Let

r(x) = r0 + r1 x + r2 x2 + + rn1 xn1

be the received vector and e(x) the error pattern. Then


r(x) = v(x) + e(x).
The syndrome is a 2t-tuple,
S = (S1 , S2 , . . . , S2t ) = r H T ,
where H is given by (2).

Si = r(i ) = r0 + r1 i + r2 2i + + rn1 (n1)i


for 1 i 2t.
Graduate Institute of Communication Engineering, National Taipei University

22

Y. S. Han

BCH codes

Dividing r(x) by the minimal polynomial i (x) of i , we have


r(x) = ai (x)i (x) + bi (x),
where bi (x) is the remainder with degree less than that of i (x).
Since i (i ) = 0, we have
Si = r(i ) = bi (i ).
Since 1 , 2 , . . . , 2t are roots of each code polynomial, v(i ) = 0
for 1 i 2t.
Then Si = e(i ) for 1 i 2t.
We now consider a general case that is also good for non-binary
case.
Suppose that the error pattern e(x) has v errors at locations
Graduate Institute of Communication Engineering, National Taipei University

23

Y. S. Han

BCH codes

24

0 j1 < j2 < < jv n. That is,


e(x) = ej1 xj1 + ej2 xj2 + + ejv xjv .

S1

S2

S3
..
.

S2t

ej1 j1 + ej2 j2 + + ejv jv

ej1 (j1 )2 + ej2 (j2 )2 + + ejv (jv )2


ej1 (j1 )3 + ej2 (j2 )3 + + ejv (jv )3

ej1 (j1 )2t + ej2 (j2 )2t + + ejv (jv )2t ,

(3)

where ej1 , ej2 , . . . , ejv , and j1 , j2 , . . . , jv are unknown.


Any method for solving these equations is a decoding algorithm
for the BCH codes.
Let Yi = eji , Xi = ji , 1 i v.
Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

25

(3) can be rewritten as follows:


S1

S2

S3
..
.

S2t

Y 1 X1 + Y 2 X 2 + + Y v Xv

Y1 X12 + Y2 X22 + + Yv Xv2


Y1 X13 + Y2 X23 + + Yv Xv3
Y1 X12t + Y2 X22t + + Yv Xv2t .

(4)

We need to transfer the above set of non-linear equations into a


set of linear equations.
Consider the error-locator polynomial
(x)

=
=

(1 X1 x)(1 X2 x) (1 Xv x)
1 + 1 x + 2 x2 + + v xv .

Multiplying (5) by Yi Xij+v , where 1 j v, and set x = Xi1


Graduate Institute of Communication Engineering, National Taipei University

(5)

Y. S. Han

BCH codes

26

we have
0=

Yi Xij+v

for 1 i v.

*
+
1
2
v
1 + 1 Xi + 2 X i + + v X i
.

Summing all above v equations, we have


v
!
"
,
j+v
j+v1
j
0 =
Y i X i + 1 X i
+ + v X i
=

i=1
v
,
i=1

Yi Xij+v + 1

v
,
i=1

Yi Xij+v1 + + v

v
,

Yi Xij

i=1

Sj+v + 1 Sj+v1 + 2 Sj+v2 + + v Sj .

We have
1 Sj+v1 + 2 Sj+v2 + + v Sj = Sj+v
for 1 j v.
Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

Putting the above equations into

S
S2
Sv1
Sv
1

S3

Sv
Sv+1
S2

..
.

Sv

Sv+1

S2v2

S2v1

27

matrix form we have


v
Sv+1


v1 Sv+2


..
.. =
.
.

S2v

. (6)

Since v t, S1 , S2 , . . . , S2v are all known. Then we can solve for


1 , 2 , . . . , v .

We still need to find the smallest v such that the above system of
equations has a unique solution.

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

28

Let the matrix of syndromes, M , be defined as

S
S2

Su
1

S3
Su+1
S2

M = .
..
..
..
.
.

Su

Su+1

S2u1

follows:

M is nonsingular if u is equal to v, the number of errors that


actually occurred. M is singular if u > v.
Proof: Let

A=

X1
..
.

X2
..
.

X1u1

X2u1

Xu
..
.

Xuu1

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

with Aij = Xji1 and

B=

Y1 X 1

0
..
.

Y2 X 2
..
.

29

0
..
.

Y u Xu

with Bij = Yi Xi ij , where

1
ij =
0

We have
*

+
T
ABA ij

u
,
!=1

i=j
i %= j

X!i1

u
,

Y! X! !k Xkj1

k=1

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

=
=

u
,
!=1
u
,

X!i1 Y! X! X!j1
Y! X!i+j1 = Mij .

!=1

Hence, M = ABAT . If u > v, then det(B) = 0 and then


det(M ) = det(A) det(B) det(AT ) = 0. If u = v, then det(B) %= 0.
Since A is a Vandermonde matrix with Xi %= Xj , i %= j,
det(A) %= 0. Hence, det(M ) %= 0.

Graduate Institute of Communication Engineering, National Taipei University

30

Y. S. Han

BCH codes

The Peterson-Gorenstein-Zierler Algorithm

Graduate Institute of Communication Engineering, National Taipei University

31

Y. S. Han

BCH codes

Example
Consider the triple-error-correcting (15, 5) BCH code with
g(x) = 1 + x + x2 + x4 + x5 + x8 + x10 . Assume that the received
vector is r(x) = x2 + x7 . The operating finite field is GF (24 ). Then
the syndromes can be calculated as follows:
S1

7 + 2 = 12

S2

14 + 4 = 9

S3

21 + 6 = 0

S4

28 + 8 = 3

S5

35 + 10 = 0 = 1

S6

42 + 12 = 0.

Graduate Institute of Communication Engineering, National Taipei University

32

Y. S. Han

BCH codes

33

Set v = 3, we have

det(M )

Set v = 2, we have
)
)
) S1
det(M ) = ))
) S2

)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)

S1

S2

S2

S3

S3

S4

12

)
S3 ))
)
S4 ))
)
S5 )

)
0 ))
)
3 ) = 0.
)
)
1 )

) )
) )
S2 ) ) 12
)=)
) )
S3 ) ) 9

)
)
9 )
) %= 0.
)
0 )

Graduate Institute of Communication Engineering, National Taipei University

Y. S. Han

BCH codes

We then calculate

Hence,

and

M 1 =
1

34

2
= M 1
=
1
3
12

(x)

=
=
=

1 + 12 x + 9 x2
*
+*
+
2
7
1+ x 1+ x
*
+*
+
9
8
13
x
x .

Since 1/8 = 7 and 1/13 = 2 , we found the error locations.

Graduate Institute of Communication Engineering, National Taipei University

You might also like