REAL-TIME BCH ERROR CORRECTION CODE DECODING MECHANISM

Abstract: Error locations and error values are simultaneously found by inserting a first value of x, xa1 (22) into the expressions delta even(x) (24c) and delta odd(x) (24b) and also into an error value polynomial PHI (x) (24a). Next, while the error locator equation is evaluated at the calculated values of delta even(xa1) and delta odd(xa1) to determine if xa1 is a solution (26b), the now known values of the error evaluator polynomial PHI (xa1) and the expression delta odd(xa1) are substituted into an error value formula (26a). Thus as soon as an error location is found, the error can then be quickly corrected (30). Next, the values are calculated for another value of x, xa2 (34b). The newly evaluated expressions are then substituted into the error locator equation and the error value equation formula to determine if xa2 is a solution. If xa2 is a solution, the error value va2 which was simultaneously calculated for xa2 is used to correct the error (20). If xa2 is not a solution, the calculated error value is ignored (28). Then, the expressions are similarly evaluated at the other values of x.

Description: REAL-TIME BCH ERROR CORRECTION CODE DECODING MECHANISM This application is a continuation in-part of the co-pending application entitled "Apparatus for Computing Multiplicative Inverses in Error Encoding and Decoding Devices", Serial Number 050,725 filed May 15, 1987 on behalf o the same inventor. FIELD OF INVENTION This invention relates to error correction code decoding mechanisms _j.n general and more particularly to the decoding of Bose-Chaudhuri-Hocquenghem (BCH) error correction codes, including Reed-Solomon error correction codes. DESCRIPTION OF PRIOR ART The importance of error correction coding of data in digital computer systems has increased greatly as the density of the data recorded on mass storage media, more particularly magnetic disks, has increased. With higher recording densities, a tiny imperfection in the recording surface of a disk can corrupt a large amount of data. In order to avoid losing that data, error correction codes ("ECC's") are employe to, as the name implies, correct the erroneous data. Before a string of data symbols is recorded on a disk, it is mathematically encoded to form ECC symbols. The ECC symbols are then appended to the data string to form code words - data symbols plus ECC symbols - and the code words are then stored on the disk. When the stored data is to be accessed from the disk, the code words containing the data symbols are retrieved from the disk and mathematically decoded. During decoding any errors in the data are detected and, if possible, corrected through manipulation of the ECC symbols [For a detailed description of decoding see Peterson and Weldon, Error Correction Codes, 2d Edition, MIT Press, 1972]. Stored digital data can contain multiple errors. One of the most effective types of ECC used for the correction of multiple errors is a Reed-Solomon code [For a detailed description of Reed-Solomon codes, see Peterson and Weldon, Error Correction Codes] . Error detection and correction techniques for Reed-Solomon ECC's are well known. Id. One such technique begins with again encoding the code word data to generate ECC symbols and then comparing these ECC symbols with the ECC symbols in the code word, i.e. the ECC symbols generated by the pre-storage encoding of the data, to detect any errors in the retrieved data. [For a detailed discussion of this error detection technique, see United States Patent 4,413,339 issued to Riggle and Weng] . The comparison of the two sets of ECC symbols is made by exclusive OR'ing ("XOR'ing") them. If there are no errors in the retrieved data, the XOR'ing will produce a string of symbols containing only zeros. If there are errors in the retrieved data, the result of the XOR'ing will be non-zero and error correction will be performed, if possible. If the number of non-zero symbols which result from the XOR'ing is less than the number of errors the code is designed to correct, all the errors are in the ECC symbols and no error correction is required. If the number of non-zero resulting symbols is equal to or greater than the number of errors the code is designed to correct, the data contains one or more errors and error correction is then performed. In order to correct the data errors, the locations and the magnitudes or "values" of the errors must be determined. The first step in determining the error locations and the error values is to form error syndrome equations from the results of the XOR'ing of the ECC symbols. [For a detailed discussion of the generation of the error syndromes refer to United States Patent 4,413,339 issued to Riggle and Weng]. The error syndromes are then used to generate polynomials which, when evaluated, will identify the location and the value of each of the errors. Alternatively the error syndromes may be formed using the entire retrieved code word. This avoids the steps of re- encoding the retrieved data and comparing the ECC symbols with the retrieved ECC symbols. However, error syndromes will be generated for every code word, even those without errors, although in the latter case ' the syndromes will be identically zero. Where there are errors, i.e. the error syndromes are not zero, the syndromes are then used to locate and correct any errors in exactly the same manner as the syndromes formed from the results of the XOR'ing of the ECC symbols. The choice between these two arrangements may, for example, depend on whether the syndromes are generated in software or hardware. The calculation of the values of the errors is necessarily dependent on their locations. Typically, the error locations are calculated first by using the error syndromes to generate an error locator polynomial δ(x). The solutions or roots of the equation, δ(x) = 0, designate the locations of the errors. The roots, x r , are then substituted into an error evaluator polynomial §(x) and the polynomial is evaluated. The results are then divided by the corresponding values of the first derivative, δ'(x r ), of the error locator polynomial to provide the values of the errors. Once both the error locations and the corresponding error values are known, the data can then be corrected. The time it takes to perform error correction significantly affects the rate at which data can be retrieved from a storage device. As the potential for errors in stored data increases with the use of higher recording densities, the effect of slow error correction has a material effect on the average speed with which the data can be retrieved. The increased data retrieval time in turn limits the speed of all computer applications that require the retrieval of the stored data. This speed limitation occurs at a time when computer system technology advances have otherwise made possible faster data transfer operations. What is needed is an error correction technique that can be performed significantly more quickly than the methods currently in use. Such a technique will enable computer systems to operate at the faster rates permitted by the advances in the state of the art computer technology. SUMMARY OF THE INVENTION The invention calculates the locations and values of the errors simultaneously and thus more quickly corrects the errors. Using this technique, errors can be corrected in "real-time" even with fast data transfer rates. The error locations and error values are found by evaluating various expressions, at values of x, where x is an element of the Galois Field used to encode the data. All values of x corresponding to possible error locations are systematically tried using an iterative evaluation technique which uses the values of each of the terms of the equations calculated for one value of x in evaluating the equations at the next value of x, in, for example, the error locator equation δ(x) = ** 0 (1) where δ(x) is the error locator polynomial, to find all the existing solutions to the equation. Each solution to the equation indicates the location of an error. The error locator polynomial δ(x) - 1 + δ χ *x + δ 2 *x 2 +...+ δ n *x n (2) can be rewritten δ(x) = 1 + δ βvβn (x) + δ odd (x) (2a) and equation (1) can be rewritten & e ven (χ) + OΛdΛd ~ ) ~ - (la) where δ βvβn (x) and δ odd (x) are the even- and odd-power terms of polynomial (2) and the δ's are calculated by the error syndrome generator. Thus the iterative evaluation technique is used to find the solutions, x r , of equation (1), where δ(x) is in the form of polynomial (2a). Solutions to polynomial (2a) are found by simultaneously inserting a first value of x, x al , into the expressions δ βvβn (x) and δ odd (x) and also into an error value polynomial Φ(x). Next, while the error locator equation (la) is evaluated at the calculated values of δ βvβn (x al ) and δ odd (x al ) to determine if x al is a solution, the now known values of the error evaluator polynomial Φ(x al ) and the expression δ odd (x al ) are substituted into an error value formula v = x * » ( x) (3) where the expression δ odd < x > ( 4 ) represents a simplified version of the first derivative, δ'(x), of δ(x). Equation (3) is then evaluated using the method for Galois Field division disclosed in the co-pending application entitled "Apparatus for Computing Multiplicative Inverses in Error Encoding and Decoding Devices", Serial Number 067,712 _ filed June 26, 1987. Thus as soon as an error location is found, i.e., x al satisfies equation (la), the error value, v al , associated with that location is also known. The error can then be quickly corrected. Next, the values of expressions δ odd (x), δ βvβn (x) and the polynomial §(x) are calculated for another value of x, x a2 . The respective terms of δ odd (x a2 ), δ βvβn (x a2 ) and Φ(x a2 ) are calculated using the previously calculated terms of δ odd (x al ) , δeven(xa.xi) and Φ(x&,x,),* and the calculations are thus simp -•lified. The newly evaluated expressions δ βvβn (x a2 ), δ odd (x a2 ) and polynomial $(x a2 ) are then substituted into the error locator equation (la) and the error value equation (3) to determine if x a2 is a solution, and if so, where the corresponding error is located. If x a2 is a solution, the error value v a2 which was simultaneously calculated for x a2 is used to correct the error. If x a2 is not a solution, the calculated error value is ignored. Then, the expressions δ odd (x), δ βvβn (x) and the polynomial Φ(x) are similarly evaluated at the other values of x. Once all the solutions are found, that is, the last error in the data is located, the data is corrected, if possible, and thus the data can then be immediately transferred. The syste is then ready to process the next block of stored data. DESCRIPTION OF THE DRAWINGS This invention is pointed out with particularity in the appended claims. The above and further advantages of this invention may be better understood by referring to the following description taken in conjunction with the accompanying drawings, in which: Figure 1 is a functional block diagram of an error correcting system in accordance with the preferred embodiment of the invention. The system simultaneously determines data error locations and values and corrects the errors. Figure 2 is a functional block diagram of an error correction system constructed in accordance with the preferred embodiment of the invention; Figure 3 is a functional block diagram of the calculators shown in Figure 2. DETAILED DESCRIPTION It should be understood that all addition, multiplication and division operations performed during the error correction process are Galois Field operations, the variable x is a Galois Field element of the form α L , where α is the primitive polynomial associated with a Galois Field, and the Galois Field is of the form GF(2 P ) . With reference to Figures 1 and 2, a retrieved code word is first checked for the presence of any data errors (Steps 10-16), as described above. Specifically, the data portion of the retrieved code word is encoded in an encoder 42 (Step 12), and the ECC symbols generated by this encoding are compared in a comparator 44, or XOR'ed, with the code word ECC symbols. (Step 14). If the results of the comparison indicate that there are ^ one or more errors in the retrieved data, error correction is performed. The results of the comparison are used to generate the error syndromes (Step 18b) in an error syndrome generator 48 which is enabled by a gate 46. The error syndromes are then utilized to generate an error locator polynomial, δ(x), and an error evaluator polynomial, Φ(x), (Step 20) in generators 50 and 54, respectively. The error locator polynomial and the error evaluator polynomial are evaluated to identify the locations and the values of the data errors. The error locator polynomial δ(x) is defined as: δ(x) = 1 + δ χ *x + δ 2 *x 2 +...+ δ n *x n (2) The locations of the errors are typically identified by the solutions of the error locator equation (1), δ(x) = 0. Each root, x r , of this equation identifies the location of one error. In conventional error code correction methods, the roots of the error locator equation are substituted into an error evaluator polynomial and into the first derivative, δ'(x), of the error locator polynomial to calculate the values of the respective errors. The error evaluator polynomial Φ(x) is defined as: Φ(x) = Φ 0 *x° + Φ χ *x x + Φ 2 *χ 2 +...+ Φ u *x u (5) where u = n - 1. The value v r of an error corresponding to a root x r is given by the error value formula v *** - * x *Φ(x) δ'(x) where δ'(x) is the first derivative of δ(x), and C is a constant, the value of which depends on the ECC generator polynomial selected and the roots of the generator polynomial The generator polynomial has been selected such that x is the lowest root / and therefore, C is equal to one. If a generator polynomial is selected which does not have x as the lowest root, the expression (x c-1 *Φ(x)) should be substituted for Φ(x). Calculation of the first derivative of δ(x) can be simplified by exploiting a property of Galois Fields of characteristic 2, i.e. GF(2 P ). Consider polynomial (2) with n being an even number. This expression can be rewritten: δ(x)=l+[δ 1 *x + δ 3 *x 3 +...+ δ n . 1 *x n"1 ]+[δ 2 *x 2 + δ 4 *x 4 +...+ δ n *x n ] / odd— / / even / which is δ(x) = 1 + δ odd (x) + δ βvβn (x) (2a) The first derivative of polynomial (2a) is δ'(x) = 0 + δ odd '(x) + δ βvβn '(x) (2b) In a Galois Field of characteristic 2, the derivative of a variable "Y" raised to an even power, for example Y n , whose derivative is 2n * Y 2n_1 , is equal to zero. The derivative of Y 2n-1 , however, which is (2n-l)*Y n~2 , is non-zero; it is equal to Y 2n~2 . Thus the first derivative of δ(x) can be rewritten δ'(x) = 0 + δ^x 0 + 3*δ 3 *x 2 + 5*δ 5 *x 4 +...+ (n-l)*δ n _ 1 *x n_2 . (6) By taking advantage of the properties of Galois Fields of characteristic 2, this can be further simplified to: δ' (x) - 0 + δ 3 *x' δ 5 * n-2 .+ *»-!** (6a) Formula (6a) can be further rewritten as δ o d ( χ ) δ'(x) = —--- (6b) As stated above, error locations are indicated by the roots of equation (1). This equation can be rewritten, using polynomial (2a) as: δ βvβ „< χ) + χ) = 1 da ) The corresponding error value formula will then be v _ * Φ ( x ) (3) O The solutions of equation (la) are found by using an iterative technique to evaluate the expressions δ odd (x) and δeven(x)' for successive values of x in calculators 56 and 58, respectively. For each such evaluation, the values of δ odd (x) and δeven(x) are then added to determine if the sum is eq•*ual to 1. Basically, the iterative technique tries the values of x, where x represents possible locations of errors in the encoded data, in a specified order, as solutions to equation (la), until all the values of x have been tried. At the same time that the expressions δ odd (x) and δ βvβn (x) are being evaluated at each value of x, the iterative technique is used to evaluate the error evaluator polynomial Φ(x) at the same x value in calculator 60. The iterative technique is discussed in detail in connection with Figure 3. Continuing with reference to Figures 1 and 2, an adder 64 sums the evaluations of δ odd (x al ) and δ βvβn (x al ). At the same time, results of the evaluations of the error evaluator polynomial Φ(x) and the expression δ odd (x) are substituted into the error value formula (3) (Step 28) and the error value is calculated in an error value generator 62. The generator 62 may, for example, use the method for Galois Field division disclosed in the co-pending U.S. patent application entitled "Apparatus for Computing Multiplicative Inverses in Error Encoding and Decoding Devices", Serial Number 067,712 filed on June 26, 1987. The output of adder 64 is applied to a one-detector 65, which asserts its output whenever δ odd (x) + δ βvβn (x) ****■ 1, that is, whenever a particular x is a root of equation (la) (Step 32). The asserted output of the one-detector 65 enables an error corrector 66 which quickly corrects the error with the then known error value v obtained from the generator 62. If a particular x is not a root of equation (la), the output of the one-detector 65 is not asserted and the calculated error value v is disregarded, that is, the error corrector 66 is not enabled. The process is continued until all the values of x corresponding to possible error locations have been tried as solutions to equation (la) (Steps 36, 38). If, after all values of x corresponding to possible error locations have been tried (Step 36), the number of solutions found for equation (la), which are totaled in a counter 70, is equal to the degree of the error locator polynomial δ(x), the corrected data is passed to the circuitry requesting the data. If the number of solutions found for equation (la) is less than the degree of the error locator polynomial δ(x), the data is labeled uncorrectable. Figure 3 illustrates the iterative technique used in evaluating the expressions δ odd (x), δ even (x) and the polynomial Φ(x) in calculators 56, 58, and 60, respectively. Calculator 56 contains a plurality of Galois Field multipliers 100, 102 and 103. Each Galois Field multiplier computes the values of a particular term of δ odd (x) at various values of x. Thus multiplier 100 calculates the value of x*δ 1 , multiplier 102 calculates x 3 *δ 3 , etc. The calculated values of each of the terms at a particular x are stored in the multipliers and then added modulo 2 in a summer 101 to evaluate δ odd (x). Specifically, to evaluate δ odd (x) at various x's the multipliers 100, 102 and 103 are set to an inital condition using the δ odd (x) terms. Multiplier 100, for example, is set to δ x , and multiplier 102 is set to δ 3 . Next, to calculate the values of the δ odd (x) terms at a first value of x, x al , where x al is typically α, the contents of the multipliers are multiplied by the constants α, α ... , α n~ , respectively. Thus, for example, the δ n-1 term is multiplied by the constant α 11- to calculate the value of (x^)" "1 *S n-1 . The products are then stored in the multipliers, and added by the summer 101 to calculate δ odd (x al ) . Thereafter, to calculate the value of δ odd (x) at the next value of x, x a2 , i.e. α if x βl = α, the contents of the multipliers are again multiplied by the constants α, α , α ... α n~ , respectively, the products are stored in the multipliers, and the stored terms are again added to calculate δ odd (x a2 ). This calculation process is repeated until δ odd (x) is calculated for all values of x corresponding to possible error locations. Calculators 58 and 60 (Figure 2), consisting of Galois Field multipliers 104-109, operate similarly to calculate the values of δ βven (x) and Φ(x) at the various values of x. If the first value of x tried as a solution is x n , rather than x x , the constants used in the respective multipliers are -1 -2 -3 -n α , α , α ... α . Evaluating the expressions δ odd (x), δ βven (x) and Φ(x) for the various values of x is simplified using the iterative evaluation technique. Ttfe iterative evaluation technique is adapted from the well-known Chien search technique. Ascertaining the locations and the values of the data errors simultaneously provides that the errors can be quickly and efficiently corrected. Using conventional techniques for the individual components of the process, the error locations are first calculated and then the error values are found, and only after these two calculations have been performed can the errors be corrected. Moreover, the technique described above takes advantage of the properties of Galois Fields GF(2 P ) to simplify the evaluation of the first derivative of the error locator polynomial, and thus the calculation of the error values is simplified and quickened. The ability to simultaneously ascertain the locations and values of the data errors and to then immediately correct them permits a computer system to take advantage of faster transfer rates which are technologically feasible. The foregoing description has been limited to a specific embodiment of this invention. It will be apparent, however, that variations and modifications may be made to the invention, with the attainment of some or all of the advantages of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention. What is claimed as new and desired to be secured by Letters Patent of the United States is:

Claims: CLAIMS 1. A method of correcting data which is encoded into code words using a BCH error correction code based on Galois Field GF(2 P ) and a selected generator polynomial, where the data error syndromes have been utilized to generate a error locator polynomial δ(x) of the form * δ(x) » 1 + δ even < χ ) + δ odd ( χ >' where δ βvβn (x) and δ odd (x) are the even- and odd- terms of δ(x), respectively, and an error evaluator polynomial Φ(x), comprising the steps of: 1. simultaneously substituting successive values of elements, x, of GF(2 ) into expressions for the error evaluator polynomial, Φ(x), δ βvβn (x) and δ odd (x); 2. evaluating said expressions; 3. substituting the results of step 2 into the error locator polynomial and an error value formula; 4. evaluating said error locator polynomial and said error value formula to obtain error locations and error values; and 5. (a) if εaid error locator polynomial is equal to ZERO, correcting the error corresponding to the value •of x using said error value; (b) if said error locator polynomial is not equal to ZERO, disregarding said error value; 6. repeating steps 1-5 until all values of x corresponding to possible error locations are tried. 2. The method for correcting_errors in Claim 1 wherein: A. if the generator polynomial has x as a root the error value formula is: v =- x * Φ(x) odd( χ ) where * is Galois Field multiplication, and B. if the generator polynomial does not have x as a root the error value formula is: v = - Φ(x) δ odd( ) where * is Galois Field multiplication, and C * is a constant which depends on the generator polynomial. 3. The method for correcting errors in Claim 2 wherein the error correction code used to encode the data is a Reed-Solomon code. 4. The method for correcting errors in Claim 2 wherein the method for evaluating said expressions at the various values of variable x uses an iterative evaluation technique comprising the steps of: A. computing the values of the terms of the expressions and the polynomial for a first value of variable x; B. storing the computed values; C. multiplying each of the stored values by a constant B n , where, x * B is equal to the next value of x to be tried, n equals the exponent of the variable in the respective terms and * is Galois Field multiplication; and D. repeating steps A-C for each possible x. An apparatus for correcting data which is encoded into code words using a BCH error correction code based on Galois Field GF(2 ) and a generator polynomial with x as a root, where the data error syndromes have been utilized to generate an error locator polynomial δ(x) of the form δ(x) = 1 + δ βvβn (x) + δ odd (x), where δ βvβn (x) and δ odd (x) are the even- a.nd odd- terms of δ(x), respectively, and an error evaluator polynomial Φ(x), comprising: A. means for simultaneously substituting successive values of elements, x, of GF(2 P ) into expressions for the error evaluator polynomial Φ(x), δ βven (x) and δ odd < X ) '- B. means for evaluating said expressions; C. means for substituting the results of step 2 into the error locator polynomial and an error value formula; D. means for evaluating said error locator polynomial and * said error value formula to obtain error values; and E. (1) if said error locator polynomial is equal to ZERO, correcting the error corresponding to the value of x using said error value; (2) if said error locator polynomial is not equal to ZERO, disregarding said error value; F. repeating steps A-E until all values of x are tried. 6. The apparatus for correcting errors in Claim 5 wherein: A. if the generator polynomial has x 1 as the lowest root the error value formula is: v = x * Φ(x) δ 0dd( χ ) where * is Galois Field multiplication, and B. if the generator polynomial does not have x as the lowest root the error value formula is: v = - x c * Φ(x) cdd( χ ) where * is Galois Field multiplication, and C is a constant which depends on the generator polynomial. 7. The apparatus for correcting errors in Claim 6 wherein the error correction code used to encode the data is a Reed- Solomon code. 8. The apparatus for correcting errors in Claim 6 wherein the means for evaluating said expressions at the various values of x uses an iterative evaluation technique comprising the steps of: A. computing the values of the terms of the expressions and the polynomial for a first value of variable x; B. storing the computed values; C. multiplying each of the stored values by a constant B n , where, x * B is equal to the next value of x to be tried, n equals the exponent of the variable in the respective terms and * is Galois Field multiplication; and D. repeating steps A-C for each possible x.

Inventors: WENG LIH-JYH, WENG, LIH-JYH
Applicants: DIGITAL EQUIPMENT CORP, DIGITAL EQUIPMENT CORPORATION
Application year: 1988
Main classification: G06F11
IPC codes: G06F11, H03M13