Chapter 6 BCH Codes
Description of the Codes Decoding of the BCH Codes Outline Implementation of Galois Field Arithmetic Implementation of Error Correction Nonbinary BCH Codes and Reed-Solomon Codes Weight Distribution and Error Detection of Binary BCH Codes
Preface 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 codes for multiple-error correction. Binary BCH codes were discovered by Hocquenghem in 959 and independently by Bose and Chaudhuri in 960. Generalization of the binary BCH codes to codes in p m symbols (where p is a prime) was obtained by Gorenstein and Zierler. Among the nonbinary BCH codes, the most important subclass is the class of Reed-Solomon (RS) codes. Among all the decoding algorithms for BCH codes, Berlekamp s iterative algorithm, and Chien s search algorithm are the most efficient ones. 3
Description of the Codes
min Description of the Codes m integer m 3, t <, a binary BCH codes with m n = Block length n k mt Number of parity-check digits d t Minimum distance Clearly, this code is capable of correcting any combination of t or fewer errors in a block of n = m digits. We call this code a t-error-correcting BCH code. The generator polynomial of this m code is specified in terms of its roots from the Galois field GF( ) m Let be a primitive element of GF( ). The generator poly. g(x) of the t-error-correcting BCH code of length m is the lowestdegree poly. over GF() which has 3 t..... as its roots. 5
Description of the Codes t It follows from Theorem.7 that g(x) has,,..., and their conjugates as all its roots. Let φ i (x) be the minimal poly. i of. Then g(x) must be the least common multiple of φ x), φ ( x),..., φ ( ), that is, ( t x { φ φ φ } gx ( ) = LCM ( x), ( x),... ( x) t If i is an even integer, it can be expressed as a product of the following form : l i = i', ' l i i where i is an odd number and l. Then = ( ) is a conjugate i ' i of and therefore and i have the same minimal poly., that is, φ ( x) = φ ( x). i i 6
Description of the Codes { } Hence, even power of has the same minimal poly. as some preceding odd power of. [ φ ] [ ] gx ( ) = LCM φ( x), φ3( x),... φt ( x) deg i ( x) m (Theorem.5) deg g( x) mt n k mt The BCH codes defined above are usually called primitive (or narrow-sense ) BCH codes. 7
Description of the Codes The single-error-correcting BCH codes of length m is generated by gx ( ) = φ ( x) since t =. m is a primitive element of GF( ) φ ( ) is a primitive poly. of degree x m 0 m (,,..., = ) the single-error-correcting BCH codes of length Hamming code Ex 6. is a 4 is a primitive element of GF( ) given by Table.8 such 4 that = 0. The minimal polynomials of, 3, 5 are m 8
Description of the Codes φ ( x) = x x 3 φ ( x) = x x x x 5 φ5( x) = x x The double-error-correcting BCH code of length n= 4 = 5 is generated by g( x) = LCM{ φ( x), φ3( x)} Since φ x) and φ ( ) are two distinct irreducible polynomials, ( 3 x g( x) = ( x x = x 4 x 4 6 4 3 4 )( x x (5,7) cyclic code with d 5 x 7 x min 8 min W( g( x)) = 5 d = 5 x 3 x 4 ) 9
Description of the Codes The triple-error-correcting BCH code of length 5 is generated by { φ φ φ } gx ( ) = LCM ( x), ( x), ( x) 3 5 = 4 3 4 ( x x )( x x x x )( x x ) 4 5 8 0 = x x x x x x It s a (5,5) cyclic code with d 7.Since W( g( x)) = 7, dmin min = Let L vx ( ) = v0 vx... v n n x be a poly. with vi GF() t If v( x) has roots,,...,, then v( x) is divisible by φ ( x), φ ( x),..., φ ( x). (Theorem.0) t 7. v(x) is a code poly. because v ( x) g( x) = LCM{ φ( x), φ( x),..., φ t ( x)} 0
Description of the Codes We have a new definition for t-error-correcting BCH code: A binary n-tuple v is a code word if and only if the poly. i.e. ),...,,, ( 0 = n v v v v roots as,...,, has... ) v( 0 t n v n x x v v x = i n n i i i v v v v ) ( 0... ) v( =. for 0... ),...,,, ( ) ( 0 t i v v v v i n i n =
Description of the Codes Let If v is a code word in the t-error-correcting BCH code, then The code is the null space of the matrix H and H is the parity-check matrix of the code. = ) (... ) (...... ) (... ) (... H n t t n n 0 H v = T
Description of the Codes j i j i is a conjugate of, then v( ) = 0 iff v( ) = 0 Thm..7 j-th row of H can be omitted. As a result H can be reduced to the following form : EX 6. H n 3 3 3 n ( ) ( ) = (t ) t t n ( ) ( ) double-error-correcting BCH code of length n = 4 = 5, (5,7) 4 code. Let be a primitive element in GF( ) 3
Description of the Codes The parity-check matrix is 4 =... H 3 6... 4 Using 5 =, and representing each entry of H by its 4-tuple, H 0000000 0000000 0000000 0000000 = 000000000 000000000 000000000 000 4 (see p.49)
FACT: Description of the Codes The t-error-correcting BCH code indeed has (pf): Suppose v 0 such that W(v) =δ t j j jδ 5 dmin t Let v, v,... v be the nonzero components of v ( ) ( ) T ( ) ( ) 0 vh ( v jv j.. v j δ ) = = j j j t ( ) ( ) j j j t ( ) ( ) (,...,) = 0... jδ jδ jδ t ( ) ( ) j j t j j j t j jδ jδ t jδ ( ) ( ) (i.e. all ones)
Description of the Codes j j j δ ( ) ( ) j j j δ ( ) ( ) (,...,) = 0 jδ jδ jδ δ ( ) ( ) A = ( t) A, a δ δ square matrix δ 0 j ( δ ) j j ( δ ) j ( j j... jδ ) = jδ ( δ ) jδ 0... 6
Description of the Codes The determinant in the equality above is a Vandermonde determinant which is nonzero. The product on the left-hand side of can not be zero. This is a contradiction and hence our assumption that there exists a nonzero code vector v of W(v) =δ t dmin t is invalid. t is the designed distance of the t-error-correcting BCH code. The true minimum distance of a BCH code may or may not be equal to its designed distance. m Binary BCH code with length n can be constructed in the same manner as for the case n = m. m m Let β be an element of order n in GF( ), n and g(x) be t the binary polynomial of minimum degree that has β, β,..., β as roots. 7
Let ψ ( x), ψ ( x),..., ψ t ( respectively then x Description of the Codes be the minimal poly. of g(x) = LCM{ ψ ( x), ψ ( x),..., ψ t ( x n t n =,,,..., are roots of x β β β β n gx ( ) ( x ) n We see that g(x) is a factor of. ) β, β,... β t The cyclic code generated by g(x) is a t-error-correcting BCH code of length n. If βis not a primitive element of GF( m ), the code is called a nonprimitive BCH code. X The number of parity-check digits dmin t. mt )} 8
Description of the Codes General definition of binary BCH codes. m β GF( ), and consider 0 be any nonnegative integer l0 l0 l0 d 0 β, β,..., β. For 0 i d, let be the 0 ψ 0 i minimal poly. and order of β i (x), ni, respectively. and the length of the code is Note that: g( x) = LCM{ ψ 0( x), ψ ( x),..., ψ d ( x)} d d min 0 { } 0 n= LCM n, n,... n d parity-check digits md ( ) 0 is capable of correcting [( d ) / ] or fewer errors 0 0 0 9
Description of the Codes If we let l0 =, d0 = t and β be a primitive element of GF( m ), the code becomes a t-error-correcting primitive BCH code of m length. If we let l0 =, d0 = t and β be not a primitive element of GF( m ), the code is a nonprimitive t-error-correcting BCH code of length n, which is the order of. For a BCH code with designed distance d0, we require g(x) has d0 - consecutive powers of a field element β as roots. This guarantees that the code has dmin d0. This lower bound on the minimum distance is called the BCH bound. In the rest of this chapter, we consider only the primitive BCH codes. β 0
Decoding of the BCH Codes
Decoding of the BCH Codes Suppose that a code word v(x) = is transmitted and the transmission errors result : r(x) = Let e(x) be the error pattern. Then For decoding, remember 0... n v n x x v x v v 0... n r n x x r x r r e(x) v(x) r(x) = = ) (... ) (...... ) (... ) (... H n t t n n
The syndrome is t-tuple, Decoding of the BCH Codes S T = ( S, S,... S t ) = r H i i i n Let s = r( ) = r r... r ( ) = 0 for i i 0 n s can be evaluated by b ( x) = R [ r( x)] i i φ ( x) i φ ( x) is the minimal poly. of i r( x) = a ( x) φ ( x) b ( x) i i i i i s = r( ) = b ( ) i i i t 3
EX6.4 Decoding of the BCH Codes Consider the double-error-correcting (5, 7) BCH code given in 8 (from Ex6.). 4 3 4 3( x) = x x x x ( ) = φ ( x) [ ( )] = 3 φ ( x) 3 If r = (0000000000000) r( x) = x φ ( x) = φ ( x) = φ ( x) = x x φ b x R r x x b ( x) = R [ r( x)] = x 3 4 s = b( ) =, s = b( ) = s s 4 3 9 3 = b3( ) = 3 7 4 8 = b( ) = 4 4 7 8 s = (,,, ) = = 4
Suppose Decoding of the BCH Codes i i i v( ) = 0 for i t s = r( ) = e( ) t i j j j ex ( ) = x x... x v 0 j< j <... j < n s = s s j j jv... = j j jv ( ) ( )... ( ) = ( )... ( ) j t jv t j j j Where,,... v are unknown. Any method for solving these equations is a decoding algorithm for the BCH codes. v 5
Decoding of the BCH Codes j j j Once,,... v have been found, the powers j, j,... j tell us the error locations in e( x) v If the number of errors in e(x) is t or less, the solution that yields an error pattern with the smallest number of errors is the right solution. j For convenience, let β =, v be the error location numbers. s = β β... β s s v = β β... βv = β β... β t t t t v Power-sum Symmetric function 6
Define Decoding of the BCH Codes σ ( x) = ( β x)( β x)...( β x) σ σ x σ x σ x = 0... : error-location poly. The roots of σ ( x) are β, β,... βv, which are the inverses of the error location numbers. σ 0 = σ = β β... β σ = ββ ββ... β β 3 v σ = β β... v β v v v v v v 7
Decoding of the BCH Codes These coefficients are known as elementary symmetric functions. σi ' s are related to sj ' s by Newton's identities s σ = 0 s σ s σ = 0 s σ s σ s 3σ = 0 3 3 s σ s... σ s vσ = 0 v v v v sv σsv... σv s σvs = 0 Note that, for binary case, = = 0. we have σ i for odd i : iσ i = 0 for even i 8
Decoding of the BCH Codes The equations may have many solutions. We want to find the solution that yields a σ(x) of minimal degree. This σ(x) would produce an error pattern with minimum number of errors. Decoding Procedure step. Compute s = ( s, s,... s ) from r( x) t step. Determine σ ( x) from step 3. Determine the error-location number β, β,... βv by finding the roots of σ( x) and correct the errors in rx ( ) s 9
Decoding of the BCH Codes Iterative Algorithm for finding σ ( x) (Berlekamps iterative algorithm) i = ( i ) σ = s x i. e ρ = s Y i = t σ ( t ) ( x ) = σ ( x ) N END D o es the coeficients σ ( i ) of satisfy the ( i ) th N e w to n s id en tity? σ Y = σ ( i ) ( i ) correction term σ = σ ( i ) ( i ) i N = i a 30
Decoding of the BCH Codes How to add a correction term to () i σ? ( µ ) ( µ ) ( µ ) ( µ ) = Let σ σ x σ x... σ x µ be the minimum-degree poly. determined at the µth step. ( µ To determine σ ) ( x) => compute µth discrepancy ( µ ) ( µ ) ( µ ) σ σ... σ dµ = sµ sµ sµ s µ µ µ = σ = σ ( ) ( ) If d 0 µ ( x) µ ( x) If d µ 0, go back to the steps prior to the µth step and determine ( ρ σ ) ( x) s.t. ρth discrepancy d ρ 0, and ρ ρ has the largest value. ( ρ ) ( = deg [ σ ( x)]). Then ρ σ ( x) = σ ( x) d d x σ ( x) ( µ ) ( µ ) ( µ ρ) ( ρ) µ ρ µ µ 3
Decoding of the BCH Codes is the minimum-degree poly. whose coefficients satisfy the first µ Newton s identities To carry out the iteration of finding σ(x), we begin with the following table: ( µ ) µ σ ( x) d µ 0-0 S 0 0 3 µ µ µ t
l μ is the degree of σ (μ) (X). Decoding of the BCH Codes If d μ =0, then σ μ (μ) (X)= σ (μ) (X) and l μ = l μ. If d μ 0, find another row ρ prior to the μth row such that d ρ 0 and the number ρ-l ρ in the last column of the table has the largest value. Then σ (μ) (X) is given by σ ( x) = σ ( x) d d x σ ( x) ( µ ) ( µ ) ( µ ρ) ( ρ) µ ρ and l μ = max(l μ, l ρ μ-ρ). ( µ ) ( µ ) In either case, dµ = sµ σ sµ... σ s The polynomial σ (t) µ µ µ (X) in the last row should be the required σ(x). 33
Decoding of the BCH Codes Ex 6.5 Consider (5.5) triple-error-correcting BCH codes given in ex 6. px ( ) = x x v = 0 r = x x x 4 3 6 5 e 4 3 5 φ ( x) = φ ( x) = φ ( x) = x x φ ( x) = φ ( x) = x x x x φ ( x) = x x 4 3 4 34
Decoding of the BCH Codes b( x) = R [ r( x)] = φ ( x) 3 φ ( x) 5 φ ( x) b ( x) = R [ r( x)] = x x 3 b ( x) = R [ r( x)] = x s = s = s = s s 5 4 6 9 0 3 = = 8 5 6 = = 0 s5 = = 0 0 5 s (,,,,, ) ( µ ) ( µ ) ( µ ρ) ( ρ) µ ρ 3 σ ( x) = σ ( x) d d x σ ( x) 35
Decoding of the BCH Codes S = d 0 = 0 ρ=- σ () (X)= σ (0) (X)d 0 d - - X (0) σ (-) (X)= X =X l =max(l 0,l - μ-ρ))=max(0,0-0)= μ-l μ =-l =-=0 d =S σ () S = =0 σ () (X)= σ () (X)=X l =l = μ-l μ =-l =-= d =S 3 σ () S σ () S = 0 0 =( )= 5 36
Decoding of the BCH Codes d = 5 0 ρ=0 σ (3) (X)=σ () (X)d d - 0 X (-0) σ (0) (X)=X 5 X =X5 X l 3 =max(l,l 0 μ-ρ))=max(,0-0)= μ-l μ =3-l 3 =3-= d 3 =S 4 σ (3) S 3 σ (3) S σ (3) 3 S = 0 5 0 =( )( )=0 37
Decoding of the BCH Codes ( µ µ σ ) ( x) d µ µ µ µ 0-0 0 0 x 0 0 5 5 3 0 5 0 4 5 x x x x x 5 3 x x 0 3 5 3 6 x x - - - σ( x) = σ ( x) = x x (6) 5 3 = 3 0 ( x)( x)( x) 3 0 x =,, 38
Decoding of the BCH Codes error location numbers 3 0 5 3 β = =, β = =, β3 = = 3 5 ex ( ) = x x x rx ( ) = rx ( ) ex ( ) = 0 If the number of errors in the received polynomial r(x) is less than the designed error-correcting capability t of the code, it is not necessary to carry out the t steps of iteration to find the error-location polynomial σ(x). It has been shown that if d μ and the discrepancies at the next t- l μ - steps are all zeros (i.e. successive t-l μ zeros), σ (μ) (X) is the error-location polynomial. If v(v t) errors occur, only vt steps of iteration are needed. The iterative algorithm described above not only applies to binary BCH codes but also nonbinary BCH codes. 39
Decoding of the BCH Codes Simplified Algorithm for finding σ ( x) For a binary BCH code, it is only required to fill out a table with t empty rows. Such a table is presented below. ( µ ) µ σ ( x) d µ I µ µ Iµ -/ 0-0 S 0 0.. t 40
Decoding of the BCH Codes ( ) ( ). If d 0, then µ = ( x) = µ ( x) µ σ σ. If d 0, find another row ρ proceding the µ th row, µ s.t. ρ is as large as possible and d 0 ρ ( ) ( ) ( ) ( ) Then µ ( X) µ ( X) d d X µ σ = σ ρ ρ µ ρ σ ( X) note that d = s σ s σ s ( µ ) ( µ ) µ µ 3 µ µ µ =... σ ( µ ) s µ 3 µ µ ( µ ) deg [ σ ( x)] ρ 4
Decoding of the BCH Codes The polynomial σ (t) (X) in the last row should be the required σ(x). If it has degree greater than t, there were more than t errors, and generally it is not possible to locate them. The computation required in this simplified algorithm is one-half of the computation required in the general algorithm. The simplified algorithm applies only to binary BCH codes. If the number of errors in the received polynomial r(x) is less than the designed error-correcting capability t of the code, it is not necessary to carry out the t steps of iteration to find the errorlocation polynomial σ(x) for a t-error-correcting binary BCH code. 4
Remarks: Decoding of the BCH Codes If v t errors occur, only ( t v)/ steps needed. If, for some μ, d μ and the discrepancies at the next (t-l μ -)/ steps are zero, then σ( X) is the error-location poly.. EX6.6 The simplified table for finding σ(x) for the code in ex6.5 is given (3) 5 3 below. Thus, σ ( x) = σ ( x) = x x. ( µ ) µ σ ( x ) d µ I µ µ I µ -/ 0-0 S= 0 0 Sx=x 5 S3S S== (take ρ = -/ ) x 5 x 0 (take ρ = 0 ) x 5 x 3 ---- 3 3(take ρ = ) 43
Decoding of the BCH Codes Finding the Error-Location Numbers and Error Correction. Consider ex6.6. The error-location poly. has been found to be 5 3 σ ( x) = x x By substituting 4 3 0,,,..., into it, we find that,, are the roots of σ(x). Therefore, the error location numbers are 5 3 3 5,, => e( x ) = x x x Chien s procedure: The received vector n r( x) = r0 r x r x... r n x is decoded on a bit-by-bit basis. The high-order bits are decoded n first. To decode r n-, the decoder test whether is an errorlocation number; this is equivalent to test whether its inverse is a root of σ(x). If is a root, then v σ σ... σ v = 0 44
Decoding of the BCH Codes To decode rn l, the decoder forms tests the sum... l l σ σ l l σ, σ,..., and If the sum is zero, then n-l is an error-location number and r n-l is an erroneous digit; otherwise, r n-l is a correct digit. σ Cyclic error location search unit v vl σ v vl σ σ σ t x x t i= σ i A i x t 45
Decoding of the BCH Codes The t σ-registers are initial stored with σ, σ,..., σ t calculated in step of the decoding ( σ v = σ v =... = σ v = 0 for v < t). Immediately before rn- is read out of the buffer, the t multiplier are pulsed v once. The multiplications are performed and σ, σ,..., σ v are stored in the σ -registers. The output of the logic circuit A is v if and only if the sum σ otherwise, the σ... σ v = 0; output of A is 0. The digit rn- is read out of the buffer and corrected by the output of A. Having decoded rn-,the t multipliers 4 v are pulsed again. Now σ, σ,..., σ v are stored in the σ-registers. The sum 4 v σ σ... σ v is tested for 0. The digit rn- is read out of the buffer and corrected in the same manner as rn- is corrected. 46
Implementation of Galois Field Arithmetic
Implementation of Galois Field Arithmetic Galois field adder (GF( 4 ) given by Table.8) ADD a 0 a a a 3 Register A (accumulator) a 0 b 0 a b a b a 3 b 3 b 0 b b b 3 Register B By adding their vector representations with modulo- addition. 48
Implementation of Galois Field Arithmetic For multiplication, we first consider multiplying a field element by a fixed element from the same field. Suppose that we want to multiply a field element β in the GF( 4 ) by the primitive element 4 whose minimal polynomial is φ ( x ) = x x. β = b b b b 3 0 3 β = b ( b b ) b b 3 3 0 3 4 = b0 b b b3 Ex: let β = 7 3 =. The vector representation of β is ( 0 ). Load it into the register. After the register is pulsed, the new content in it will be ( 0 0). 49
Implementation of Galois Field Arithmetic the above circuit can be used to generate all the nonzero elements 4 of by load (000) first into the register GF( ) Ex: as another example, multiply β by 3 : β = b b b b 3 0 3 β= b b b b 3 3 4 5 5 0 3 = b b( ) b ( ) 3 0 3 b3 ( ) = b ( b b ) ( b b ) ( b b ) 3 3 0 3 b0 b b b3 50
Implementation of Galois Field Arithmetic Ex3: multiplying two arbitrary elements Steps: β = b b b b 3 0 3 r = c c c c 3 0 3 βr = c β c β c β c β 3 0 3 = ((( c β ) c β) c β) c β 3 0. multiply c β by and add the product to c β 3. multiply ( c β ) c β by and add the product to cβ 3 3. multiply (( c β) c β) cβ by and add the product to c β 3 0 5
Implementation of Galois Field Arithmetic The circuit in ex can be modified to carry out the computation given by ex3 b b b 0 b3 c0 c c c3 5
Implementation of Galois Field Arithmetic Step : Register A are empty B ( b0 b b b3) C ( c0 c c c3) Step : Registers A. C. are shifted four times. At the end of first shift, A (( cb 3 0, cb 3, cb 3, cb 3 3), the vector representation of c3β At the end of second shift, A (( c3β ) cβ) At the end of third shift, A ((( c3β ) cβ) cβ) At the end of fourth shift, A βγ 53
Implementation of Galois Field Arithmetic If we express βγ = ((( c β ) c β ) c β c β 0 ) then we obtain a different multiplication circuit. 3 3 b0 b b b 3 c 3 c c c0 54
Implementation of Galois Field Arithmetic Multiplication can be implemented by combinational logic circuit with m inputs and m outputs. advantage speed disadvantage m > 7, prohibitively complex and costly. Programmed in a general-purpose computer will require roughly 5m instruction executions. i How to compute syndrome si = r( )? i It can be done with a circuit for multiplying a field element by. Suppose that we wan to compute 4 r( ) = r0 r r... r4 =(...((( r ) r ) r )...) r 4 3 0 4 where is a primitive element in GF( ) 55
Implementation of Galois Field Arithmetic The computation of r() can be accomplished by adding an input to the circuit r (x) input At the end of first shift At the end of nd shift At the end of 3rd shift ( r4,0,0,0) r r 4 3 ( r r ) r 4 3 56
Implementation of Galois Field Arithmetic 3 We can compute r( ) by adding an input to the circuit for 3 multiplying by of figure in Ex. rx ( ) input i There is another way of computing r( ). Let φ i (x) be the i minimal poly. of. Let b(x) be the remainder resulting from divding r(x) by φ i (x). Then i i r( ) = b( ) 57
58 Implementation of Galois Field Arithmetic Thus, computing r( ) is equivalent to computing b( ). Again we consider computation over GF( ). Suppose that we want to compute r( ). The minimal poly. of is The remainder Then i i 4 3 3 3 0 ) ( b x b x b b x b x = 3 4 3 3 ) ( x x x x x = φ 3 3 3 0 3 3 3 3 0 9 3 6 3 0 3 ) ( ) ( ) ( ) b( b b b b b b b b b b b b b b = = =
Implementation of Galois Field Arithmetic Such a circuit is shown below 59
60 Implementation of Galois Field Arithmetic Since is a conjugate of, it has the same poly. as Its circuit is shown in the next page 6 3 3 3 3 0 3 3 3 3 0 8 3 6 0 6 ) ( ) ( ) ( ) ( ) ( ) b( b b b b b b b b b b b b b b b b = = =
Implementation of Galois Field Arithmetic 6
Implementation of Error Correction
Implementation of Error Correction Syndrome Computation The first step in decoding t-error-correction BCH code is to compute the t syndrome component S,S,,St. Software: S = r( ) = r ( ) r ( ) i i n i n i n n i... r r0 i i i = (...(( rn rn ) rn 3) i... r) r0 (n-) addition and (n-) multiplication For binary S i = Si :t syndrome components can be computed with (n-)t additions and nt= (n-)tt multiplications. 63
Implementation of Error Correction For hardware implementation, a variety of types of circuits can be adopted, e.g. Figure 6.7 and 6.8, or Figure 6.0. Alternatively, as shown in Figure 6. (the following page), at most t feedback shift registers, each consisting of at most m stages, are needed to form the t syndrome components because the generator polynomial is a product of at most t minimal polynomials. 64
Implementation of Error Correction Syndrome computation circuit for the double-error-correcting (5,7) BCH code 65
Implementation of Error Correction As soon as the entire r(x) has entered the decoder, the t syndrome components are formed. It takes n clock cycles to complete the computation. Finding the Error-Location Polynomial σ(x) Software computation requires somewhat less than t additions and t multiplications to compute each σ (μ) (X) and each d μ, and since there are t of each, the total is roughly t additions and t multiplications. 66
Implementation of Error Correction hardware: requires the same total, and the speed would depend on how much is done in parallel. Computation of Error-location Numbers and Error Correction Worst case: requires substituting n field elements into an errorlocation poly. σ() x of degree t to determine roots. Software : requiring nt multiplications and nt additions. Hardware : using Chien s searching circuit. See Figure 6.. t It requires t multipliers for multiplying by,,..., respectively. 67
Implementation of Error Correction At the end of the th shift, If sum =... l l σ σ n sum=0, is an error-location number. The sum can be formed by using tm-input modulo- adders. A m-input OR gate is used to test whether the sum is zero. It takes n clock cycles to complete this step. If we only to correct the massage digits, only k clock cycles are needed. A Chien s searching circuit for (5, 7, ) BCH code is shown next slide. σ t tl 68
Implementation of Error Correction 69
Nonbinary BCH Codes and Reed-Solomon Codes
Nonbinary BCH Codes and Reed-Solomon Codes In addition to the binary codes, there are nonbinary codes. If p is a prime number and q is any power of p (q=p m ), there are codes with symbols from the Galois field GF(q). These codes are called q-ary codes. An (n, k) linear code with symbols from GF(q) is a k-dimensional subspace of the vector space of all n-tuples over GF(q). A q-ary (n, k) cyclic code is generated by a polynomial of degree (n-k) with coefficients from GF(q), which is a factor of X n -. Encoding and decoding of q-ary codes are similar to that of binary codes. For any choice of positive integers s and t, there exists a q-ary BCH code of length n=q s -, which can correct any combinational of t or fewer errors and requires no more than st parity-check digits. 7
Nonbinary BCH Codes and Reed-Solomon Codes Let be a primitive element in the Galois field GF(q s ). The generator polynomial g(x) of a t-error-correcting q-ary BCH is the polynomial of lowest degree with coefficients from GF(q) for which,,, t are roots. Let Φ i (X) be the minimal polynomial of i. Then g(x)=lcm{φ (X),Φ (X),,Φ t (X) } The degree of each minimal polynomial is s or less. Therefore, the degree of g(x) is at most st, and hence the number of parity-check digits of the code generated by g(x) is no more than st. For q=, we obtain the binary BCH codes. 7
Nonbinary BCH Codes and Reed-Solomon Codes t-error-correcting Reed-Solomon code with symbols from GF(q): s =, Block length: n=q-, # parity-check digits: n-k =t, Minimum distance: d min =t. Reed-Solomon codes with code symbols from GF( m ) (i.e., q= m ) Let be a primitive element in GF( m ) The generator polynomial of code length m - is g( x) = ( x )( x )...( x )= g g x... g x x t t t 0 t (n,n-t) cyclic code and coefficients of g(x) is from GF( m ) k Let Message: a( X) = a0 ax ax ak X In systematic form, the t parity-check digits are coefficients of t ( ) ( ) ( ) b X = R X X = b b X b X g X a t 0 t 73
Nonbinary BCH Codes and Reed-Solomon Codes Hardware implementation 74
Nonbinary BCH Codes and Reed-Solomon Codes Where m multiplier in GF( ) m adder in GF( ) bi storage device Decoding of RS code: v(x) = v vx r(x) = r0 r x... r n x 0... v n x n n v( x) ex ( ) = rx ( ) vx ( ) = e ex... e x e = r v, GF( ) i i i 0 n m n ex () rx ( ) 75
Nonbinary BCH Codes and Reed-Solomon Codes Suppose the error pattern e(x) contains v errors (nonzero components), then e( x) = e x e x... e x j j jv j j jv j To determine e(x), we need error-locations x l s and the error values e j s l (i.e. vpairs( x, e )' s ) j l j l In decoding a RS code, the same three steps used for decoding a binary BCH code are required ; in addition, a fourth step involving calculation of error values is required. 76
Nonbinary BCH Codes and Reed-Solomon Codes i Let β = =... v s = r( ) = e β e β... e β j j jv v s = r( ) = e β... e β j jv v s = r( ) = e β.. e β t t t t j jv v note: S = R [ r( x)] = b i i ( x ) i ( ie.. r( x) = e( x)( x ) b) i i i 77
Nonbinary BCH Codes and Reed-Solomon Codes Syndrome computation circuit for R-S codes Division circuit (a) over GF ( ) m (b) in binary form 78
Nonbinary BCH Codes and Reed-Solomon Codes To find σ ( x) : the error-location poly. by Berlekamp s iterative algorithm σ ( x) = ( β x)( β x)...( β x) v = σx... σvx Once σ ( x) is found, we can determine the error values. Let zx ( ) = ( s σ) x ( s σs σ) x... ( sv σsv... σv) x It can be shown that the error value at location β l = j l is given by: ( Z β ) l e j = l ν ββ 79 v ( ) i l i= i l v
Nonbinary BCH Codes and Reed-Solomon Codes Ex: Consider a triple-error-correcting Reed-Solomon code with symbols from GF( 4 ) The generator polynomial of this code is: 6 gx ( ) = ( x )( x )...( x ) = x x x x x x 6 9 6 4 3 4 4 0 5 6 (5, 9, 3) RS code, n =5. n k = 6, t = 3 e x (00...0) 7 3 4 r = (000 00 00000 00) rx ( ) = x x x 7 3 3 6 4 80
Nonbinary BCH Codes and Reed-Solomon Codes Step. Using table.8 below to compute syndrome components: 8
Nonbinary BCH Codes and Reed-Solomon Codes S S S S S S 3 4 5 6 = r( ) = = 0 9 = r = = 3 3 ( ) = r( ) = = 3 6 0 4 = r( ) = = 4 4 7 0 = r = = 5 7 3 4 ( ) 0 = r( ) = = 6 0 9 (Note, S ) Step. Find next slide. σ( x) = x x x 7 4 6 3 by filling out table in 8
Nonbinary BCH Codes and Reed-Solomon Codes 83
Nonbinary BCH Codes and Reed-Solomon Codes 4 Step 3. By substituting,,,... into σ( x) 3 9 σ 3 9 6 3 =, =, = are the error-location 3 6 numbers of ex ( ) ex ( ) = ex ex e x Step 4. From 6.34, find,, are roots of ( x) 3 z( ) 3 6 3 3 7 e = = ( )( ) e 6 z( ) 6 3 6 6 3 6 z( x) = x x x 3 = = ( )( ) 6 3 84
Nonbinary BCH Codes and Reed-Solomon Codes e z( ) 3 6 4 = = ( )( ) ex ( ) = x x x vx ( ) = rx ( ) ex ( ) = 0 7 3 3 6 4 If β is not a primitive element of GF( m ), then the m -ary code generated by t g( x) = ( x β )( x β )...( x β ) is a nonprimitive t-error-correcting RS code. The length n of this code is simply the order of β. Decoding of a nonprimitive Reed-Solomon code is identical to the decoding of a primitive Reed-Solomon code. 85
86 Nonbinary BCH Codes and Reed-Solomon Codes Reed-Solomon codes are very effective for correcting multiple bursts of errors. Two information symbols can be added to a RS code of length n without reducing its minimum distance. The extended RS code has length n and the same number of parity-check symbols as the original code. For a t-error-correcting RS code, the parity-check matrix may take the form = ) (... ) (... ) (... ) (... H n t t t n n
87 Nonbinary BCH Codes and Reed-Solomon Codes The parity-check matrix of the extended RS code is = H 0 0 0 0... 0... 0 0 0 H
Weight Distribution and Error Detection of Binary BCH Codes
Weight Distribution and Error Detection of Binary BCH Codes The weight distributions of double-error-correcting, triple-error-correcting, and some low-rate primitive BCH codes have been completely determined. However, for the other BCH codes, their weight distribution are still unknown. Computation of the weight distribution of a doubleerror-correcting or a triple-error-correcting primitive BCH code can be achieved by first computing the weight distributions of its dual code and then applying the Macwilliams identity of (3.3). 89
Weight Distribution and Error Detection of Binary BCH Codes The weight distribution of the dual of a double-error-correcting primitive BCH code of length m - is given below : 90
Weight Distribution and Error Detection of Binary BCH Codes 9
Weight Distribution and Error Detection of Binary BCH Codes 9
Weight Distribution and Error Detection of Binary BCH Codes If a double-error-correcting or a triple-error-correcting primitive BCH code is used for error detection on a BSC with transition probability p, its probability of an undetected error can be computed from (3.36) and one of the weight distribution tables. It would be interesting to know how a general t-error-correcting primitive BCH code performs when it s used for error detection on a BSC with transition probability p. For a t-error-correcting m primitive BCH code of length -, if the number of parity-check digits is equal to mt and m is greater than certain constant m0(t), the number of code vectors of weight i satisfies the following equalities : A t ( 0 for 0 < i / 0 n ( n k ) λ 0 n ) for i > t i = 93 t
Weight Distribution and Error Detection of Binary BCH Codes where n = m and λ0 is upper bounded by a constant. From (3.9) and (6.6), we obtain n /0 ( n k ) n i Pu ( E ) = ( λ n 0 ) p ( p ) i = t i Let ε = ( t ) / n. Then n n i n i p ( p ) i = ε i provided that p < ε, where E( ε, p) = H( p) ( ε p) H'( p) H( ε ) => H( x) = xlog H'( x) = log x x x ( x)log 94 ( x) ne ( ε, p ) > 0 for ε > p n i
Weight Distribution and Error Detection of Binary BCH Codes So we can obtain /0 ne ( ε, p ) ( n k ) Pu ( E ) = ( λ 0n ) For p < ε and sufficient large n, Pu(E) can be made very small. For p ε, we obtain upper bound. It s clear from n /0 ( n k ) n i n i Pu ( E ) = ( λ 0 n ) p ( p ) i = 0 i Since n n i n i p ( p ) = i = 0 i, so P u ( E ) ( λ /0 ( n k ) 0 n ) 95
Weight Distribution and Error Detection of Binary BCH Codes m For a t-error-correcting primitive BCH code of length - with number of parity-check digits n-k = mt and m m ( t 0 ), its probability p satisfies : /0 n[ R E ( ε, p )] λ n p < ε P ( ( 0 ) for u E ) /0 n ( R ( λ n ) ) 0 for p ε where ε = ( t ) / n, R = k / n, and λ0 is a In the nonbinary case, for a t-error-correcting primitive BCH code of length q- with symbols from GF(q), the number of code vectors of weight j is A j = q j 96 j ( q i j t j ( ) t i i i = 0 constant. ).