BCH Codes (Bose, Chaudhuri and Hocquenghem)

Introduction

How do we modify a Hamming code to correct two errors? In other words, how can we increase its minimum distance from 3 to 5? We will either have to lengthen the code words or eliminate some of them from our code. Correcting two errors in a long word may not be much better than correcting one error in a short one. So we will try to produce a double error correcting subcode of the Hamming code by removing some code words to make a new code. BCH codes is a generalization of Hamming codes for multiple error correction. Binary BCH codes were first discovered by A. Hocquenghem in 1959 and independently by R.C. Bose and D.K. Ray-Chaudhuri in 1960.

1 BCH Codes as Subcodes of Hamming Codes

Recall that an encoder E for a linear binary (n, m)- C is a linear map from Bm to Bn.

Definition 1.1 Let C be a linear (n, m)-code with encoder E. Let the n × m matrix G be chosen so that E(x) = GxT for any word x of length m. Then G is called a generator matrix of the code C.

Definition 1.2 A check matrix for a C over a field F is a k × n matrix H with the property that for any word v in F n, HvT = 0 if and only if v ∈ C. The number k is arbitrary here, but the smallest possible value for k is n − m.In terms of linear algebra, C is the null space of H.

The most natural way of reducing the set of words of a Hamming code is by introducing further checks, i.e. adding new rows to the Hamming check matrix Hk. The additional checks may be a linear combination of the ones that we have. In that case, the set of code words will not be changed. Although the set of code words may be reduced, the minimum distance may not be increased.

Finding additional checks is not easy at all, because we have to find a nonlinear extension rows for the check matrix Hk. On the other hand, if we form the extra rows in an unstructured way, it will be difficult to prove that the minimum distance increases. So, new rows must be defined in a systematic way. Since B = {0, 1} has only two elements, it is not easy to define nonlinear functions for binary vectors. For this, we follow this trick: we gather bits together in groups of k and consider the groups to represent the elements of the field GF (2k). For this larger field there are many nonlinear functions, for example f(x) = x3.

4 Example 1.3 Consider the columns of the Hamming check matrix H4 as representing the nonzero elements of GF (2 ) = 4 3 B[x]/(x + x + 1). Choosing the columns of H4 in a decreasing powers of the primitive element 2 gives the check matrix H4 in the following form.

(12 6 3 13 10 5 14 7 15 11 9 8 4 2 1) In binary digits, this matrix is,   100110101111000    110101111000100   011010111100010  001101011110001

Now we add further rows of elements of GF (24) to extend the matrix as simple as possible. the simplest way of extending the rows is to choose each entry as a function of the original entry at the head of its column, i.e.   2i  i   f1(2 )        i fr(2 ) where fi is some function for i = 1, ..., r. Good choice of f1, ..., fr will enable us to correct an additional error per block. Vandermonde Matrices

Theorem 1.4 Let C be a linear code with check matrix H. Then C has minimum distance greater than d if and only if no set of d columns of H is linearly independent.

There are families of matrices for which the condition can be verified. The simplest of these families is the class of of Vandermonde matrices.

Definition 1.5 An n × n Vandermonde matrix V is defined as follows: The first row of V can be chosen arbitrarily λ1, λ2, ..., λn, then the whole matrix is   λ1 λ2 ... λn  2 2 2   λ1 λ2 ... λn    V = V (λ1, λ2, ..., λn) =     n n n λ1 λ2 λn

Theorem 1.6 If λ1, λ2, ..., λn are distinct, then the columns of V = V (λ1, λ2, ..., λn) are linearly independent over F .

Extending a Hamming Check Matrix

We have the following proposition from linear codes:

Proposition 1.7 A code can correct all errors of weight ≤ t if and only if it has minimum distance ≥ 2t + 1.

Definition 1.8 We define the double error correcting BCH code BCH(k,2) to have the check matrix Vk,2 with columns   αi  2i   α   α3i  α4i

Here α is the primitive element of the field.

Example 1.9 V4,2 has the following form.   12 6 3 13 10 5 14 7 15 11 9 8 4 2 1    6 13 5 7 11 8 2 12 3 10 14 15 9 4 1   3 5 15 8 1 3 5 15 8 1 3 5 15 8 1  13 7 8 12 10 15 4 6 5 11 2 3 14 9 1

Verification To verify that the code has minimum distance 5 and thus can correct 2 errors, we have to prove that no four columns of V4,2 are linearly dependent.

Proposition 1.10 No four columns of V4,2 are linearly dependent. proof. Suppose that Vi,Vj,Vk,Vl are four different columns of V4,2. They form a Vandermonde matrix   αi αj αk αl  2i 2j 2k 2l   α α α α   α3i α3j α3k α3l  α4i α4j α4k α4l

i j k l Moreover, α , α , α and α are distinct and nonzero, so it follows from the Theorem 2 that the columns Vi,Vj,Vk,Vl are linearly independent.

Further Extension

Definition 1.11 The t error-correcting BCH code BCH(k, t) over the field of order 2k based on the primitive element k α, has as its check matrix an n × 2t matrix Vk,t, where n = 2 − 1. We number the columns Vi of Vk,t from 0 to n − 1, counting from the right. Then for i = 0, 1, ..., n − 1, Vi is defined by the formula   αi  2i   α    α2ti The block length of the code is the number of the columns of its check matrix. In this case n=2k − 1. For a code to have minimum distance greater than 2t we must have 2t < n. Hence this definition makes sense for t < 2k−1.

Example 1.12 The chcek matrix of BCH(4,3) is V = V4,3. The columns are   2i  2i   2   3i   2   4i   2   25i  26i where i = 14, 13, ..., 0 and the complete matrix is   12 6 3 13 10 5 14 7 15 11 9 8 4 2 1    6 13 5 7 11 8 2 12 3 10 14 15 9 4 1     3 5 15 8 1 3 5 15 8 1 3 5 15 8 1     13 7 8 12 10 15 4 6 5 11 2 3 14 9 1   10 11 1 10 11 1 10 11 1 10 11 1 10 11 1  5 8 3 15 1 5 8 3 15 1 5 8 3 15 1

This matrix can also be written in binary form as a 24 × 15 matrix, in which each column consists of the binary repre- sentations of the elements of GF (24) in the matrix above.

The Reduced Check Matrix

The matrix Vk,t contains many redundant rows for it to be a practical check. In fields of characteristic 2, squaring is a linear function and we know that any row of a check matrix that is a linear function of the other rows is redundant. So we will introduce a reduced check matrix Hk,t that contains only the odd-numbered rows of Vk,t.

Definition 1.13 The matrix Hk,t obtained from Vk,t by deleting the even-numbered rows is called the reduced check matrix of BCH(k, t). The rows of Hk,t will be numbered with the same indices as in Vk,t.

Example 1.14 The reduced check matrix of BCH(4,3) is   12 6 3 13 10 5 14 7 15 11 9 8 4 2 1 H4,3 =  3 5 15 8 1 3 5 15 8 1 3 5 15 8 1  10 11 1 10 11 1 10 11 1 10 11 1 10 11 1

k−1 Proposition 1.15 For any k and t < 2 the matrices Hk,t and Vk,t are check matrices for the same code BCH(k, t).

T proof. Let (w14, w13, ..., w0) be a code word of the code C defined by Hk,t, then Hk,tw = 0. This product can be expressed as the equations X14 ik wiα = 0 i=0 2 which hold for all odd k < 2t. Since wi is either 0 or 1 for all i, wi = wi. By squaring the previous equation, we find that X14 2ik wiα = 0 i=0

T for all k. But this states that Vk,tw = 0. Hence w is a code word of BCH(k, t). Since the rows of Hk,t are a subset of Vk,t, any code word of BCH(k, t) must be a code word of C. Thus two codes are equal.

Theorem 1.16 BCH(k, t) has a block length n = 2k − 1 and rank at least n − kt Theorem 1.17 It has minimum distance at least 2t + 1, so it can correct all error patterns of weight at most t. proof. We apply the criterion of the Vandermonde Theorem to the check matrix Vk,t. We must show that no 2t columns of Vk,t are linearly independent. Choose 2t columns Vi(1),Vi(2), ..., Vi(2t), and consider the matrix formed by these columns. i(k) Denoting the power α by αk, we have the following matrix,   α1 α2 ... α2t  2 2 2   α1 α2 ... α2t    2t 2t 2t α1 α2 ... α2t

This is a Vandermonde matrix and α1, α2, ..., α2t are distinct and non-zero, so the columns are linearly independent. Hence, it follows from Theorem 1 that BCH(k, t) has a minimum distance greater than 2t.

The Check Matrix and Error Patterns

Definition 1.18 Given a linear (n, m)-code C and check matrix H, the syndrome of a word u of length n is (HuT )T , so syndrome of a word is a row vector.

Proposition 1.19 Let u be a code word of BCH(k, t) and let v be obtained from u by adding an error pattern e of weight at most t, i.e. v = u + e. Then e is uniquely determined by the syndrome

T Vk,tv proof. Assume that an error pattern f 6= e of weight at most t produces the same syndrome as v, then

T Vk,t(v − f) = 0 so, v − f is a code word. But the from u to v − f = u + e − f is the weight of e − f which is at most 2t contradicting the fact that the minimum distance of the code is greater than 2t.

2 BCH Codes as Codes

Checking a binary word (c1, c2, ..., cn) is a code word of BCH(k,t) is equivalent to verifying the equations

nX−1 ik ciα = 0 i=0 for powers αk of a primitive element α, k = 1, 2, ..., 2t. So, it is natural to identify code words c with binary c(x) of degree less than n. Hence the equations can be rewritten

c(αk) = 0

n Convention: Let V be a vector space B of binary n-tuples. We write an element u ∈ V as (un−1, un−2, ..., u1, u0) and identify it with the polynomial nX−1 i u(x) = uix i=0 The polynomial corresponding to a word u be will be denoted by u(x). The set of all binary polynomials of degree less than n will be denoted by Pn.

Example 2.1 The code word 000011101100101 corresponds to the polynomial x10 + x9 + x8 + x6 + x5 + x2 + 1 k Proposition 2.2 [Definition of BCH(k,t)] Let n = 2 − 1 and let the columns of the check matrix Vk,t be ordered so that

i(n−j) Vk,t = (α )

If c(x) ∈ Pn, then c(x) is a code polynomial of BCH(k, t, α) if and only if

c(αj) = 0 for all powers j ≤ 2t of α.

Proposition 2.3 Let g(x) be the product of all the distinct minimal polynomials of α, α2, ..., α2t over B (each polynomial is taken only once even if it occurs as a minimal polynomial several times). Then a polynomial c(x) of degree less than n = 2k − 1 is a code polynomial of BCH(k, t, α) if and only if g(x) divides c(x). proof. If g(x) divides c(x), then c(αj) = 0 for j = 1, 2, ..., 2t, because g(αj) = 0. Hence by Proposition 2.2 c(x) is a code polynomial.

Conversely, if c(αj) = 0 for j = 1, 2, ..., 2t, the minimal polynomial of αj over B divides c(x) for all j. g(x) is the product of these polynomials and each of them are taken only once. Since they are distinct and irreducible, they are relatively prime., so g(x) divides c(x)

Definition 2.4 The polynomial g(x) is called the generator polynomial of BCH(k, t).

Rank and the generator polynomial of BCH codes

Corollary 2.5 a. The generator polynomial of BCH(k, t) is the unique non-zero polynomial of lowest degree in BCH(k, t). b. The rank of BCH(k, t) is 2k − deg(g(x)) − 1

Example 2.6 [BCH(4, 3)] the generator polynomial is

4 3 4 3 2 2 10 9 8 6 5 2 m2(x)m8(x)m11(x) = (x + x + 1)(x + x + x + x + 1)(x + x + 1) = x + x + x + x + x + x + 1 The corresponding code word is

000011101100101 This is the only non-zero code word that starts with four zeros. proof. a. The degree of a non-zero multiple b(x)g(x) of g(x) is equal to at least deg(g(x)), and the equality holds only if b(x) is a constant. 1 is the only non-zero constant of B. Hence all non-zero code polynomials have degree at least equal to deg(g(x)), and the only code polynomial with deg(g(x)) is g(x). b. All code polynomials can be obtained by multiplying g(x) with b(x) of degree less than m = 2k − deg(g(x)) − 1. Moreover, multiplying g(x) by distinct polynomials a(x) and b(x) of degree ≤ gives different code polynomials. So the number of the code polynomials is 2m, and therefore the rank is m.

Multiplicative encoding

The corollary above gives a simple encoding algorithm for BHC(k, t). The message space consists of Pm. Encode b(x) ∈ Pn by multiplying it by g(x).

Example 2.7 [BCH(4,3)] Suppose that we want to encode the message word b = (1 0 1 1 1). The corresponding polynomial is b(x) = x4 + x2 + x + 1, then the corresponding code word c(x) is obtained by multiplying b(x) with the generator polynomial g(x) = x10 + x9 + x8 + x6 + x5 + x2 + 1, so

c(x) = b(x)g(x) = x14 + x13 + x9 + x6 + x5 + x3 + x + 1 and the corresponding code word is 110001001101011

A Generator Matrix for BCH(k, t)

We will use the generator polynomial g(x) to construct a generator matrix for BCH(k, t), i.e. represent polynomial mul- tiplication by the generator matrix g(x) by a suitable matrix. The columns of the generator matrix of a code C are the all code words of C. We choose as the columns of the code words corresponding to xig(x) for i = m − 1, m − 2, ..., 1, 0. Example 2.8 [BCH(4,3)] A generator matrix G for BCH(4,3) is   1 0 0 0 0    1 1 0 0 0     1 1 1 0 0     0 1 1 1 0     1 0 1 1 1     1 1 0 1 1     0 1 1 0 1     0 0 1 1 0     1 0 0 1 1     0 1 0 0 1     1 0 1 0 0     0 1 0 1 0     0 0 1 0 1   0 0 0 1 0  0 0 0 0 1

This matrix is obtained by writing down as successive columns of the coefficients of xig(x) for i = 4, 3, 2, 1, 0 where g(x) = x10 + x9 + x8 + x6 + x5 + x2 + 1. Suppose that our message contains a block b = (1 0 1 1 1). The corresponding code word c is GbT = 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1.

For linear codes, we have the following proposition

Proposition 2.9 Let C be an (n, m) linear code and let G be an n × n matrix. Then G is a generator matrix for C if and only if it has rank m and its columns are code words.

Proposition 2.10 Let g(x) be a generator polynomial of BCH(k, t) and let G be the n × n matrix constructed by taking as its columns the coefficients of xig(x) for i = m − 1, ..., 1, 0. then G is a generator matrix for BCH(k, t)

The Check Polynomial

Let q = 2k and let n = q − 1. xn − 1 is the product of distinct minimal polynomials of the non-zero elements of GF (q). The generator polynomial g(x) of BCH(k, t) is the product of a certain subset of these minimal polynomials. So we can write xn − 1 = g(x)h(x) for some h(x). Consider the code polynomial c(x) = b(x)g(x) for some polynomial b(x) of degree less than m. If we multiply c(x) by h(x) we get that

c(x)h(x) = b(x)g(x)h(x) = b(x)(xn − 1)

It is easy to recognize multiples of xn − 1 by low-degree polynomials and that gives us an easily checkable necessary and sufficient condition for c(x) to be a code polynomial.

Definition 2.11 The polynomial h(x) is called the check polynomial of BCH(k, t).

Proposition 2.12 Let c(x) be a polynomial of degree less that n. Then c(x) is a code polynomial of BCH(k, t) if and only if xn − 1 divides c(x)h(x). proof. We have already seen that if c(x) is a code word, then c(x)h(x) is a multiple of xn − 1.

Example 2.13 [BCH(4,3)] The check polynomial of BCH(4,3) is

x5 + x4 + x2 + 1

Multiplicative Decoding for BCH(k, t)

We can use the check polynomial to provide a multiplicative decoder for our code. It incorporates a check for the correct- ness of the received word, but it does no error processing. It is based on a simple observation. If b(x) has degree less than n, then b(x)(xn − 1) = b(x)xn − b(x) so if we multiply a code polynomial c(x) = b(x)g(x) by h(x), the first m coefficients will be the coefficients of b(x). Example 2.14 If the code word c is 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 then

c(x)h(x)=10111000000000010111 so, the message word b is 1 0 1 1 1

3 BCH Error Correction

Determining the error word

Assume that we are using a code BCH(k, t) of block length n = 2k − 1 which is designed to correct errors at most t. Suppose that a code word c is sent and the word d is received. By using the check matrix, if

T Vk,tb 6= 0 we can say that d is not a code word. We have the following proposition for the linear codes:

Proposition 3.1 Let C be a linear code with a check matrix H. Suppose that a code word c is transmitted and the word d = c + e is received, then the syndromes of e and d are equal, i,e. HdT = HeT proof. HdT = HcT + HeT = HeT (Since HcT = 0)

Let the error word be e = d − c, then we have that

T T Vk,td = Vk,te

If s ≤ t errors occurred then from Proposition 1.19 there is exactly one possible error word e of weight at most t which satisfies T T Vk,td = Vk,te T The error word e determines a set of columns of Vk,t whose sum is Vk,te . If there is only one error, we have a Hamming T code and the search is easy since we just check the n columns of Vk,t to find which one gives the syndrome (Vk,td ). However, if t > 1, we have to consider n n n ( ) + ( ) + ... + ( ) 1 2 t If k = 8 and t = 3, this number is 2763775, so we need to find an efficient procedure.

Let c = (cn−1, ..., c1, c0) be the code word that is sent, d = (dn−1, ..., d1, d0) be the received word, e = (en−1, ..., e1, e0) be the error where ei − di = ci.

Definition 3.2 If the component ei of the error word e is not 0, i is called error location of d. Let M be the set of error locations, then M has s ≤ t elements and s is the weight of e.

Example 3.3 Let c =110110010100001 d =110000010100001 e =000110000000000 then s = 2 and the error locations are 10 and 11.

The Syndromes of a Received Word Consider the check matrix Vk,t, then the full syndrome of Vk,t is a word of length 2t with the entries

S1,S2, ..., S2t

The corresponding polynomials to the words above are, c(x) = x14 + x13 + x11 + x10 + x7 + x5 + 1 d(x) = x14 + x13 + x7 + x5 + 1 e(x) = x11 + x10

The rows of Vk,t are of the form (α(q−2)j, ..., α2j, αj, α0) k k where q = 2 , α is the primitive element of GF (2 ) and j = 2t, ..., 1. Thus i − th entry Si can be written as

nX−1 ij i Si = djα = d(α ) j−1

i T Definition 3.4 The values Si = d(α ), i = 1, 2, ..., 2t are called the syndromes of d(x). The word Vk,td = (S1,S2, ..., S2t) is called the full syndrome or the syndrome vector.

Proposition 3.5 a. If c(x) is a code polynomial, d(x) is a polynomial of degree at most 2k − 2 and e(x) = d(x) − c(x), then the syndromes Si of d(x) and e(x) are identical for i = 1, 2, ..., 2t

2 b. The syndrome S2i = Si for i = 1, 2, ..., t c. d(x) is a code polynomial of BCH(k, t) if and only if syndromes S1,S2, ..., S2t are all 0. proof b. nX−1 nX−1 nX−1 2 ij 2 2 2ij 2ij Si = ( djα ) = dj α = djα = S2i j=0 j=0 j=0 Example 3.6

Syndromes of c(x) = x14 + x13 + x11 + x10 + x7 + x5 + 1

S1 = c(2) = 0,S3 = c(8) = 0,S5 = c(11) = 0 Syndromes of d(x) = x14 + x13 + x7 + x5 + 1

S1 = d(2) = 7,S3 = d(8) = 9,S5 = d(11) = 1 Syndromes of e(x) = x11 + x10

S1 = e(2) = 7,S3 = e(8) = 9,S5 = e(11) = 1 Now we consider the case s = 2

Assume that there are precisely two errors. Test whether the syndromes form a column of the check matrix Vk,t. If they do, the column gives the error locations. Let M = {i, j} be the error locations, then we have to solve

i j α + α = S1

2i 2j α + α = S2 3i 3j α + α = S3 Example 3.7 BCH(4,3)

αi + αj = 7 α2i + α2j = 12 α3i + α3j = 9 then α2i + 7αi + 15 = 0 α = 10 = 210 α = 13 = 211 so 10 and 11 are the error locations, then M = {10, 11}.

The Syndrome Polynomial

Definition 3.8 The syndrome polynomial of the word d with syndromes S1,S2, ..., S2t is the polynomial 2Xt−1 2t−1 i s(z) = S1 + S2z + ... + S2t−1z = Si+1z i=0 The syndrome polynomial of d(x) ∈ BCH(4,3) is

s(z) = 14z5 + z4 + 6z3 + 9z2 + 12z + 7 Since nX−1 nX−1 ij ij Si = ejα = djα j=0 j=0 s(z) can be rewritten as 2Xt−1 X 2Xt−1 i j ij i s(z) = Si+1z = ejα α z i=0 j∈M i=0 Let q = αjz, then the inner sum can be written as

2Xt−1 1 − q2t αij zi = 1 + q + q2 + ... + q2t−1 = 1 − q i=0

Formula Syndrome Polynomial

Proposition 3.9 The syndrome polynomial s(z) can be written as

X 1 − (αjz)2 X e αj X e α(2t+1)jz2t s(z) = e αj( ) = j − j j 1 − αjz 1 − αjz 1 − αjz j∈M j∈M j∈M where M is the set of error locations.

Example 3.10 By using this formula, the syndrome polynomial s(z) of d(x) is

210 211 270z6 277z6 s(z) = + − − = 14z5 + z4 + 6z3 + 9z2 + 12z + 7 1 − 210z 1 − 211z 1 − 210z 1 − 211z

Introduction to Fundamental Equation

By adding fractions, the syndrome polynomial can be expressed as difference

w(z) u(z)z2t s(z) = − l(z) l(z)

It is clear that Y l(z) = (1 − αjz) j∈M The roots of l(z) are the inverses of the powers αj, j ∈ M. So l(z) can used to determine the error locations. l(z) is called the error locater polynomial of d(x). However, finding l(z) is still a problem since we assumed that the error polynomial e(x) is known.

Example 3.11 The error locations of d(x) are 10 and 11 so that the error locator is

l(z) = (1 − 210z)(1 − 211z) = (1 − 10z)(1 + 13z) = 15z2 + 7z + 1 Proposition 3.12 The polynomials w(z) and u(z) satisfy the following formulas

X Y j i w(z) = ejα (1 − α z) j∈M i∈M,i6=j X Y (2t+1)j i u(z) = ejα (1 − α z) j∈M i∈M,i6=j proof. From the definition Q j j j j w(z) X e α X e α l(z) X ejα (1 − α z) X Y = j ⇒ w(z) = j = j∈M = e αj (1 − αiz) l(z) 1 − αjz 1 − αjz 1 − αjz j j∈M j∈M j∈M j∈M i∈M,i6=j

Example 3.13 With the error locations 10 and 11,

w(z) = 210(1 + 211z) + 211(1 + 210z) = 10(1 + 13z) + 13(1 + 10z) = 7

u(z) = 270(1 + 13z) + 277(1 + 210z) = 14 + 12z

Once we know the error locator l(z) and hence error locations, w(z) can be used to calculate the error values. It is called the error evaluator. The polynomial u(z) can also be used to determine the error values and it is called the error co-evaluator. In practice, w(z) is used.

The Fundamental Equation

The equation w(z) = l(z)s(z) + u(z)z2t obtained from w(z) u(z)z2t s(z) = − l(z) l(z) is called the fundamental equation for BCH codes.

Example 3.14 By using the calculated polynomials l(z), w(z) and u(z) we see that the fundamental equation is

l(z)s(z) + u(z)z2t = 12z7 + 14z6 + 7 + 12z7 + 14z6 = w(z) Proposition 3.15 If s errors occurred in the received word d(x), then the degrees of the error locator, error evaluator, error co-evaluator satisfy deg(l(z)) = s deg(u(z)) < s deg(w(z)) < s Moreover l(0) = 1.

Now we present an efficient algorithm invented by Sugiyama in 1975. It is based on the Euclid’s algorithm. the knowledge of the error locator enables us to calculate is roots and thus to find the error locations and correct the received word. The key to the solution of this problem is the fundamental equation

w(z) = l(z)s(z) + u(z)z2t

BCH Algorithm with Example BCH(4,3) The algorithm that we will use is based on the fact that all the polynomials that that we are looking for appear in the table produced when Euclid’s algorithm applied to z2t and s(z).

Step 1.

i 2 Calculate Si = d(α ) for i = 1, 3, ..., 2t − 1 and find S2i = Si for i = 1, 2, ..., t. Then calculate the syndrome polynomial

X2t i s(z) = Si+1z i=1

If s(z) = 0, then STOP. The received word has no errors.

We found that syndrome polynomial of d(x) is

s(z) = 14z5 + z4 + 6z3 + 9z2 + 12z + 7

Step 2.

2t Apply Euclid’s algorithm to a(z) = z and b(z) = s(z). Finish at the stage where the reminder rj(z) has degree less that 0 0 0 t. We can use the notation rj(z) = w (z), uj(z) = u (z), vj(z) = l (z).

Applying Euclid’s algorithm to z2t and s(z) = 14z5 + z4 + 6z3 + 9z2 + 12z + 7, we find that

0 r2(z) = 5 = w (z)

0 u2(z) = 2z + 10 = u (z)

2 0 v2(z) = 14z + 5z + 4 = l (z)

Step 3.

0 If rj(z) = 0, there are more than t errors so STOP. Otherwise, put l (z) = vj(z). This differs from l(z) only by a nonzero constant factor, find the roots β1, β2, ..., βs

Theorem 3.16 Denote the polynomials calculated by the BCH algorithm by l0(z), u0(z), w0(z) and true error locator, evaluator polynomials l(z), w(z), u(z). If s ≤ t errors occurred, then there exists a non-zero constant K such that

l0(z) = K · l(z)

w0(z) = K · w(z)

u0(z) = K · u(z) Since l0(z) differs from l(z) by a constant factor, they have same roots.

For our example, l0(z) = 14z2 + 5z + 4 = 4(15z2 + 7z + 1) w0(z) = 5 = 4 · 7 u0(z) = 2z + 10 = 4(12z + 14)

Now consider l0(z) = 14z2 + 5z + 4. Since 4 · 92 + 5 · 9 + 4 = 0 9 is a root of l0(z), and since (z − 9)(14z − 6) = l0(z) the roots of l0(z) are 9 and 6/14=11.

Step 4.

0 p(i) k If the roots of l (z) are βi = α , then the errors occurred at the place 2 −p(i)−1 counting from the right, starting from 0.

9 = 24 and 11 = 25 so that the error locations are 16-4-1=10 and 16-5-1=10. Termination of the Algorithm

Proposition 3.17 Assume that 1 < s ≤ t errors occurred, then the step 2 of the algorithm will end with a non-zero rj(z) such that deg(rj(z)) < t and deg(rj−1(z)) ≥ t. proof. From the fundamental equation w(z) = l(z)s(z) + u(z)z2t, the greatest common divisor (s(z), z2t) of s(z) and z2t divides w(z) so that

deg(s(z), z2t) ≤ deg(w(z)) < s ≤ t 2t 2t Also deg(z ) = 2t > t Since the Euclid’s algorithm terminates with (s(z), z ) = r(z), there exists a j such that deg(rj(z)) < t and deg(rj−1(z)) ≥ t.