27
Chapter 5 BCH Codes 1. Introduction BCH (Bose – Chaudhuri - Hocquenghem) Codes form a large class of multiple random error-correcting codes. They were first discovered by A. Hocquenghem in 1959 and independently by R. C. Bose and D. K. Ray-Chaudhuri in 1960. BCH codes are cyclic codes. Only the codes, not the decoding algorithms, were discovered by these early writers. The original applications of BCH codes were restricted to binary codes of length 1 2 m for some integer m. These were extended later by Gorenstein and Zieler (1961) to the nonbinary codes with symbols from Galois field GF(q).

Com- BCH Codes

Embed Size (px)

Citation preview

Page 1: Com- BCH Codes

Chapter 5

BCH Codes

1. Introduction

� BCH (Bose – Chaudhuri - Hocquenghem) Codes form a large

class of multiple random error-correcting codes.

They were first discovered by A. Hocquenghem in 1959 and

independently by R. C. Bose and D. K. Ray-Chaudhuri in 1960.

� BCH codes are cyclic codes. Only the codes, not the decoding

algorithms, were discovered by these early writers.

� The original applications of BCH codes were restricted to binary

codes of length 12 −−−−m for some integer m. These were extended

later by Gorenstein and Zieler (1961) to the nonbinary codes with

symbols from Galois field GF(q).

Page 2: Com- BCH Codes

� The first decoding algorithm for binary BCH codes was devised

by Peterson in 1960. Since then, Peterson’s algorithm has been

refined by Berlekamp, Massey, Chien, Forney, and many others.

2. Primitive BCH Codes

� For any integer 3≥≥≥≥m and 12 −−−−<<<< mt there exists a primitive

BCH code with the following parameters:

12

12

min ++++≥≥≥≥≤≤≤≤−−−−

−−−−====

tdmtkn

n m

(5- 1)

� This code can correct t or fewer random errors over a span of

12 −−−−m bit positions.

The code is a t-error-correcting BCH code.

� For example, for m=6, t=3

71321836

6312

min

6

====++++××××========××××====−−−−====−−−−====

dknn

This is a triple-error-correcting (63, 45) BCH code.

Page 3: Com- BCH Codes

3. Generator Polynomial of Binary BCH Codes

� Let αααα be a primitive element in GF( m2 ).

For ti ≤≤≤≤≤≤≤≤1 , let )(12 xi−−−−φφφφ be the minimum polynomial of the

field element 12 −−−−iαααα .

The degree of )(12 xi−−−−φφφφ is m or a factor of m.

� The generator polynomial g(x) of a t-error-correcting primitive

BCH codes of length 12 −−−−m is given by

{{{{ }}}})(,),(),()( 1231 xxxLCMxg t −−−−==== φφφφφφφφφφφφ L (5- 2)

� Note that the degree of g(x) is mt or less.

Hence the number of parity-check bits; n-k, of the code is at

most mt.

� Example 5.1, 5.2, 5.3, 5.4. (pp. 191-196)

(m = 4, m = 5)

Page 4: Com- BCH Codes

Note that the generator polynomial of the binary BCH code is

originally found to be the least common multiple of the minimum

polynomials t221 ,,, φφφφφφφφφφφφ L

i.e. {{{{ }}}})(),(,),(),(),()( 212321 xxxxxLCMxg tt φφφφφφφφφφφφφφφφφφφφ −−−−==== L

However, generally, every even power of αααα in GF( m2 ) has the same

minimal polynomial as some preceding odd power of αααα in GF( m22 ).

As a consequence, the generator polynomial of the t-error-correcting

binary BCH code can be reduced to

{{{{ }}}})(,),(),()( 1231 xxxLCMxg t −−−−==== φφφφφφφφφφφφ L .

Page 5: Com- BCH Codes

Example: m = 4, t = 3

Let αααα be a primitive element in GF( 42 ) which is constructed

based on the primitive polynomial 41)( xxxp ++++++++====

41 1)( xxx ++++++++====φφφφ corresponding to αααα

4323 1)( xxxxx ++++++++++++++++====φφφφ corresponding to 3αααα

25 1)( xxx ++++++++====φφφφ corresponding to 5αααα

{{{{ }}}}108542

531

531

1)()()(

)(),(),()(

xxxxxxxxx

xxxLCMxg

++++++++++++++++++++++++============

φφφφφφφφφφφφφφφφφφφφφφφφ

The code is a (15, 5) cyclic code.

Page 6: Com- BCH Codes

4. Properties of Binary BCH Codes

� Consider a t-error-correcting BCH code of length 12 −−−−==== mn

with generator polynomial g(x).

� g(x) has as t232 ,,,, αααααααααααααααα L roots, i.e.

tig i 21for0)( ≤≤≤≤≤≤≤≤====αααα (5-

3)

� Since a code polynomial c(x) is a multiple of g(x), c(x) also has

t22 ,,, αααααααααααα L as roots, i.e. tic i 21for0)( ≤≤≤≤≤≤≤≤====αααα .

� A polynomial c(x) of degree less than 12 −−−−m is a code polynomial

if and only if it has t22 ,,, αααααααααααα L as roots.

Page 7: Com- BCH Codes

5. Decoding of BCH Codes

� Consider a BCH code with 12 −−−−==== mn and generator polynomial

g(x).

� Suppose a code polynomial 1110)( −−−−

−−−−++++++++++++==== nn xcxccxc L is

transmitted.

Let 1110)( −−−−

−−−−++++++++++++==== nn xrxrrxr L be the received polynomial.

� Then r(x)=c(x)+e(x), where e(x) is the error polynomial.

� To check whether r(x) is a code polynomial or not, we simply test

whether 0)()()( 22 ================ trrr αααααααααααα L .

If yes, then r(x) is a code polynomial, otherwise r(x) is not a code

polynomial and the presence of errors is detected.

� Decoding procedure

(1) syndrome computation.

(2) determination of the error pattern.

(3) error correction.

Page 8: Com- BCH Codes

6. Syndrome computation

� The syndrome consists of 2t components in GF( m2 )

)( 221 tSSSS L==== (5-

4)

and )( ii rS αααα==== for ti 21 ≤≤≤≤≤≤≤≤ .

� Computation:

Let )(xiφφφφ be the minimum polynomial of iαααα .

Dividing r(x) by )(xiφφφφ , we obtain

)()()()( xbxxaxr i ++++==== φφφφ

Then )( ii bS αααα==== (5- 5)

� )( ii bS αααα==== can be obtained by linear feedback shift-register with

connection based on )(xiφφφφ .

Page 9: Com- BCH Codes

7. Syndrome and Error Pattern

� Since r(x)=c(x)+e(x)

then )()()()( iiiii eecrs αααααααααααααααα ====++++======== (5-

6)

for ti 21 ≤≤≤≤≤≤≤≤ .

This gives a relationship between the syndrome and the error

pattern.

� Suppose e(x) has νννν errors )( t≤≤≤≤νννν at the locations specified by

ννννjjj xxx ,,, 21L .

i.e. ννννjjj xxxxe ++++++++++++==== L21)( (5- 7)

where 10 21 −−−−≤≤≤≤<<<<<<<<<<<<≤≤≤≤ njjj ννννL .

� From equations (5-6) & (5-7), we have the following relation

between syndrome components and error location:

tjtjtjtt

jjj

jjj

eS

eSeS

22222

22222

1

)()()()(

)()()()()(

21

21

21

νννν

νννν

νννν

αααααααααααααααα

αααααααααααααααααααααααααααααααα

++++++++++++========

++++++++++++========++++++++++++========

L

M

L

L

(5- 8)

Page 10: Com- BCH Codes

� It we can solve the 2t equations, we can determine

νννναααααααααααα jjj ,,, 21L .

� The unknown parameter uj Zu ====αααα for νννν,,2,1 L====u are called

the “error location number”.

When ujαααα , νννν<<<<≤≤≤≤ u1 are found, the powers uj , νννν,,2,1 L====u

give us the error locations in e(x). these 2t equation of eq. (5-8)

Are known as power-sum symmetric function.

Page 11: Com- BCH Codes

8. Error-Location Polynomial

(Error-Locator Polynomial)

� suppose that t≤≤≤≤νννν errors actually occur.

Define error-locator polynomial L(z) as

νννννννν

νννννννν

σσσσσσσσσσσσσσσσ zzz

zZ

zZzZzZzL

ii

++++++++++++++++====

++++====

++++++++++++====

∏∏∏∏====

L

L

2210

1

21

)1(

)1()1)(1()(

(5- 9)

where 10 ====σσσσ .

� L(z) has 112

11 ,,, −−−−−−−−−−−−

ννννZZZ L as roots.

Note that ujuZ αααα==== .

� If we can determine L(z) from the syndrome ),,,( 221 tSSSS L==== ,

then the roots of L(z) give us the error-location numbers.

Page 12: Com- BCH Codes

9. Relationship between S and L(z)

� From eq. (5-9), we find the following relationship between the

coefficients of L(z) and the error-locator numbers:

νννννννν

νννννννν

νννν

σσσσ

σσσσσσσσσσσσ

ZZZ

ZZZZZZZZZ

L

M

L

L

21

132212

211

0 1

====

++++++++++++====++++++++++++====

====

−−−− (5- 10)

eq. (5-10) is called “elementary symmetric functions”.

� From eq. (5-8) and eq. (5-10), we have the following relationship

between the syndrome and the coefficients of L(z):

0

03020

112211

312213

2112

11

====++++++++++++++++++++

====++++++++++++====++++++++====++++

−−−−−−−−−−−− νννννννννννννννννννν νσνσνσνσσσσσσσσσσσσσ

σσσσσσσσσσσσσσσσσσσσσσσσ

SSSS

SSSSS

S

L

M(5- 11)

Here for binary case iii σσσσσσσσ ==== when i is odd,

and 0====iiσσσσ otherwise.

� The equations of (5-11) are called the Newton’s identities.

Page 13: Com- BCH Codes

� If we can determine ννννσσσσσσσσσσσσ ,,, 21 L from the Newton’s identities,

then we can determine the error-location numbers ννννZZZ ,,, 21 L ,

by finding the roots of L(z).

� Note that the Newton’s identities in (5-11) can be expressed also in

the following single-equation form:

ννννσσσσσσσσσσσσσσσσ ,,2,1for0112211 LL ========++++++++++++++++++++ −−−−−−−−−−−− iiSSSS iiiii

(5- 12)

Page 14: Com- BCH Codes

10.Peterson’s Direct-Solution (W. W. Peterson, 1960)

� Consider the case for νννν>>>>i

First multiply L(z) in eq. (5-9) By iz −−−− , we have

iiiiii zzzzzzLz −−−−−−−−−−−−−−−−

−−−−−−−−−−−−−−−− ++++++++++++++++++++==== νννννννν

νννννννν σσσσσσσσσσσσσσσσ 1

12

21

1)( L (5- 13)

� Next substituting the roots of L(z) (i.e. 112

11 ,,, −−−−−−−−−−−−

ννννZZZ L ) into eq.

(5-13) produces the following set of equations:

0

00

11

22

11

21

212

221

212

11

112

121

111

====++++++++++++++++++++

====++++++++++++++++++++====++++++++++++++++++++

−−−−++++−−−−−−−−

−−−−−−−−

−−−−++++−−−−−−−−

−−−−−−−−

−−−−++++−−−−−−−−

−−−−−−−−

νννννννννννν

νννννννννννννννννννννννν

νννννννν

νννννννν

νννννννν

νννννννν

σσσσσσσσσσσσσσσσ

σσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσσ

iiiii

iiiii

iiiii

ZZZZZ

ZZZZZZZZZZ

L

M

L

L

(5- 14)

Adding these νννν equation term by term yield

0),,,()()(

21

112

11121

====++++++++++++++++++++++++++++++++++++

−−−−−−−−−−−−

−−−−−−−−−−−−

νννννννν

νννννννννννν

νννννννν

σσσσσσσσ

iii

iiiiii

ZZZZZZZZZ

L

LLL

(5- 15)

� Now express eq. (5-15) in terms of syndrome components, then

ννννσσσσσσσσσσσσ νννννννννννννννν >>>>====++++++++++++++++ −−−−++++−−−−−−−−−−−− iSSSS iiii for01111 L (5- 16)

In particular, for 1++++====ννννi , we obtain

012111 ====++++++++++++++++ −−−−++++ SSSS νννννννννννννννν σσσσσσσσσσσσ L (5- 17)

Thus, the Newton’s identities can be extended to the unknown

syndrome iS for νννν>>>>i .

Page 15: Com- BCH Codes

� From eq. (5-16) & eq. (5-17), we can see that the jσσσσ for

νννν≤≤≤≤≤≤≤≤ j0 are closely related to the syndrome components iS ,

11 ++++≤≤≤≤≤≤≤≤ ννννi .

� Thus, jσσσσ can be determined by solving the set of syndrome

equations eq. (5-16) & eq. (5-17). Then the error-locations for can

be found by solving uj Zu ====αααα for νννν≤≤≤≤≤≤≤≤ u1 the root of L(z). This

L(z) produces an error-pattern e(x) with the minimum number of

errors. Hence if t≤≤≤≤νννν errors occur, L(z) will give the actual error

pattern e(x).

� Finally, the error-correcting procedure for the binary BCH codes

can be outlined as follows:

(1) Compute the syndrome components jS , tj 21 ≤≤≤≤≤≤≤≤ , from the

received polynomial r(x). [eq. (5-5)]

(2) Set each 0====jσσσσ for tj ≤≤≤≤≤≤≤≤++++ 1νννν

and solve the first νννν equations of eq. (5-11) for the jσσσσ ,

νννν≤≤≤≤≤≤≤≤ j1 in terms of jS .

(3) Determine the error-locator polynomial L(z) from these jσσσσ

Page 16: Com- BCH Codes

in terms of syndrome component jS for tj 20 ≤≤≤≤≤≤≤≤ .

(4) Find the error-location numbers ννννZZZ ,,, 21 L by solving

for the roots of L(z). Use these roots to correct the errors in

r(x).

Page 17: Com- BCH Codes

11.Direct Solutions of Some Simple Cases.

(1) Single-error correction:

313

1111 01)(SS

SzSzLS====≠≠≠≠++++========σσσσ

(2) Double-error correction:

2

1

331

1313

112

313111

1)()(

,0

zS

SSzSzLSSS

SSSS

++++++++++++====++++====

≠≠≠≠≠≠≠≠====

−−−−σσσσ

σσσσ

(3) Triple-error correction:

213313

313

331

5321

2

111

)(

0

σσσσσσσσ

σσσσ

σσσσ

SSS

SSSS

SSSSS

++++++++====

≠≠≠≠++++

++++====

≠≠≠≠====

Example: m = 4, t = 3 BCH code over GF( 42 ).

The primitive polynomial for m = 4 is 41)( xxx ++++++++====φφφφ

The minimum polynomials of αααα , 3αααα and 5αααα are

25

4323

41

1)(1)(1)(

xxxxxxxx

xxx

++++++++====++++++++++++++++====

++++++++====

φφφφφφφφφφφφ

15124 ====−−−−====n

108542531

531

1

)}(),(),({)(

xxxxxx

xxxLCMxg

++++++++++++++++++++++++============

φφφφφφφφφφφφφφφφφφφφφφφφ

Page 18: Com- BCH Codes

The code is a (15, 5) cyclic code.

The generator polynomial g(x) has 65432 ,,,,, αααααααααααααααααααααααα as

roots. The roots αααα ,2αααα and 4αααα have the same polynomial

4421 1)()()( xxxxx ++++++++============ φφφφφφφφφφφφ

The root 3αααα and 6αααα have the same minimum polynomial

43263 1)()( xxxxxx ++++++++++++++++======== φφφφφφφφ

The minimum polynomial of 5αααα is

25 1)( xxx ++++++++====φφφφ

Suppose all-zero code word )0000( L====c is transmitted

and 1252)( xxxxr ++++++++==== is received.

Dividing r(x) by )(1 xφφφφ , )(3 xφφφφ and )(5 xφφφφ , respectively,

we obtain the remainders:

25

33

1

)(1)(1)(

xxbxxxb

xb

====++++++++====

====

The syndrome components are

10535

51812636

1096333

414

212

11

)(1)(1)(1)(1)(

1)(

αααααααααααααααααααααααα

αααααααααααααααααααααααααααα

============++++++++========

====++++++++========================

========

bsbsbsbsbsbs

Hence ),,1,,1,1( 51010 αααααααααααα====S .

Page 19: Com- BCH Codes

Example: (p. 209) consider t = 2, m = 5, (32, 21) BCH code

The primitive polynomial for m = 5 is

521)( xxx ++++++++====φφφφ

842 ,,, αααααααααααααααα and 16αααα have the same minimum polynomial

241263 ,,, αααααααααααααααα and 17αααα have the same minimum polynomial

54323 1)( xxxxx ++++++++++++++++====φφφφ

920105 ,,, αααααααααααααααα and 8αααα have the same minimum polynomial

5425 1)( xxxxx ++++++++++++++++====φφφφ

2528147 ,,, αααααααααααααααα and 19αααα have the same minimum polynomial

5327 1)( xxxxx ++++++++++++++++====φφφφ

26132211 ,,, αααααααααααααααα and 21αααα have the same minimum polynomial

54311 1)( xxxxx ++++++++++++++++====φφφφ

The generator polynomial of (32, 21) code is

109865331 1)()()( xxxxxxxxxg ++++++++++++++++++++++++======== φφφφφφφφ

The roots of the generator polynomial include 32 ,, αααααααααααα and

4αααα

Since 1211872)( xxxxxxr ++++++++++++++++====

Page 20: Com- BCH Codes

We obtain

2844

833

1422

71

)()()(

)(

αααααααααααααααααααααααα

αααααααα

========================

========

rSrSrSrS

Note here that 41

224 )()( SSS ========

Then the error-locator polynomial is obtained by the equation

2131102

263151

1052157

157

378

2

71

)1)(1(1)(

)(

−−−−

−−−−

================∴∴∴∴

++++++++====++++++++====∴∴∴∴

====++++====

====

αααααααααααααααα

αααααααααααααααα

αααααααα

αααααααασσσσ

αααασσσσ

ZZ

zzzzzL

Thereby indicating errors at 26th and 21st coordinates of r

1211108752)( xxxxxxxxc ++++++++++++++++++++++++====∴∴∴∴

(Note iriZ αααα==== )

Page 21: Com- BCH Codes

12.Computation of Error-Location Numbers

– Chien Search. (R.T. Chien, 1964)

� A Chien-search circuit is shown in Fig. 5.2.

∏∏∏∏====

++++====++++++++++++++++====νννν

ννννννννσσσσσσσσσσσσσσσσ

1

2210 )1()(

ii zZzzzzL L

where 10 ====σσσσ

The roots of L(z) in GF( m2 ) can be determined by substituting

the elements of GF( m2 ) in L(z).

If 0)( ====iL αααα , then iαααα is the root of L(z) and ini −−−−−−−− ==== αααααααα is an

error-location number.

� To decode the first received digit 1−−−−nr , we check whether αααα is a

root of L(z). If 0)( ====ααααL , then 1−−−−nr is erroneous and must be

corrected.

If 0)( ≠≠≠≠ααααL , then 1−−−−nr is error-free.

� To decode inr −−−− , we test whether 0)( ====iL αααα . if 0)( ====iL αααα , inr −−−− is

erroneous and must be corrected, otherwise inr −−−− is error free.

Page 22: Com- BCH Codes

����������

������

1σσσσ

αααα 2αααα tαααα

2σσσσ tσσσσ

L

1LD it

1j

ijji −==∑

=

)(αααααααασσσσ

=

=otherwise0,

1Dif1,e i

i

)( 1-n10 r,,r,rr L='c'c

'c

���

���������� ���

ie

��

Figure 5.2 Chien search and error-correction for binary code.

Page 23: Com- BCH Codes

13.Peterson-Gorenstein-Zierler Decoding Algorithm

� From equation (5-16) [Chen / Reed eq. (5-38)]

ννννσσσσσσσσσσσσ νννννννννννννννν >>>>−−−−====++++++++++++ −−−−++++−−−−−−−−−−−− jSSSS jjjj for1111 L

Assuming that t====νννν , then

tjSSSS jjtjttjt >>>>−−−−====++++++++++++ −−−−++++−−−−−−−−−−−− for1111 σσσσσσσσσσσσ L (5- 18)

e.g. 1++++==== tj , we have

11211 ++++−−−− −−−−====++++++++++++ tttt SSSS σσσσσσσσσσσσ L

The following matrix equation is obtained for the symmetric

function jσσσσ as follows:

−−−−

−−−−−−−−

====

====ΛΛΛΛ ++++

++++

−−−−

−−−−−−−−++++

++++

−−−−

t

t

t

t

t

tttt

tt

tt

S

S

S

SSSS

SSSS

SSSS

S

2

2

1

1

1

12221

132

121

'MMMMMM

L

L

σσσσ

σσσσσσσσ

(5- 19)

� It can be shown that 'S is nonsingular if the received word

contains exactly t errors. It also can be shown that 'S is singular

if fewer than t errors occur. If 'S is singular, then the rightmost

column and bottom rows can be removed and the determinant of

the resulting matrix computed.

Page 24: Com- BCH Codes

This process is repeated until one reaches a non-singular matrix.

The coefficients of the error-locator polynomial are then founded

by the use of standard algebraic technique.

� Once the νννν error locations are known, hen we can use the

relation between syndrome components and error locations.

[eq. (5-8)]

The syndrome components can be computed by

∑∑====

−−−−

====

⋅⋅⋅⋅====⋅⋅⋅⋅========νννν

αααααααα1

1

0

)()(l

jli

n

k

kjk

jj ZeeeS

l

where ∑−−−−

====

−−−−−−−− ====++++++++++++++++====

1

0

11

2210)(

n

k

kk

nn xexexexeexe L

Thus we have

ti

ti

tit

iii

iii

ZeZeZeS

ZeZeZeS

ZeZeZeS

222

212

222

212

211

21

21

21

νννν

νννν

νννν

νννν

νννν

νννν

++++++++++++====

++++++++++++====++++++++++++====

L

M

L

L

Page 25: Com- BCH Codes

The system equations can be reduced to the following matrix

form:

====

====⋅⋅⋅⋅

νννννννννννν

νννννννν

νννν

νννν

ννννS

S

S

e

e

e

ZZZ

ZZZ

ZZZ

eD

i

i

i

MM

L

MMM

L

L

2

1

21

222

21

21

2

1

(5- 20)

Decoding is completed by solving for the }{li

e

This is a general case of nonbinary BCH codes.

Example (5.9)

Consider a nonbinary BCH code (7, 3) of length 7 (symbols) this

code is constructed over GF(8) with generator polynomial

32334

432 ))()()(()(αααααααα

αααααααααααααααα++++++++++++====

−−−−−−−−−−−−−−−−====xxx

xxxxxg

Let the received polynomial be

2534262)( xxxxxr αααααααααααα ++++++++++++====

Then the syndrome components are

34

43

32

61 ,,, αααααααααααααααα ================ SSSS

Page 26: Com- BCH Codes

Eq. (5-19) gives

αααασσσσαααασσσσ

αααααααα

σσσσσσσσ

αααααααααααααααα

========⇒

====

====ΛΛΛΛ

22

1

3

4

1

2

43

36

,

'S

Thus 1)( 22 ++++++++==== xxxL αααααααα

The error locations are founded to be

55

33

2752

4731

)(

,

xexexe

ZZ

++++====⇒

================ −−−−−−−− αααααααααααααααα

Eq. (5-20) gives

====

====⋅⋅⋅⋅

3

6

5

3

36

53

αααααααα

αααααααααααααααα

e

eeD

The error magnitudes are found to be

553

553

)(

,

xxxe

ee

αααααααα

αααααααα

++++====⇒

========

Finally

2533425562)()()( xxxxxxrxexc αααααααααααααααααααα ++++++++++++++++====++++====

Note that m = 3, the primitive polynomial is

31)( xxxp ++++++++====

Page 27: Com- BCH Codes

14.BCH Codes as Industry Standards

(a) (511, 493) BCH code in ITU-T. Rec. H.261 “video codec for

audiovisual service at kbit/s” a video coding a standard used for

video conferencing and video phone.

2

18493

9511

========−−−−====

========

t

knk

mn

(b) (40, 32) BCH code in ATM (Asynchronous Transfer Mode) pp.

223-227.

This is shortened cyclic code that can correct 1-bit error and

detect 2-bit errors.