Abstract:
An error correction method and apparatus for correcting multiple errors in received digital data word signals calculates syndromes S 0 , S 1 , S 2  and S 3  from a block of n received data words and a parity check matrix H. First coefficients σ 1  and σ 2  are calculated from the derived syndromes and a second coefficient K is calculated from the first coefficients σ 1  and σ 2 . An error location value x 1  is calculated from the second coefficient K, actual error location values X 1  and X 2  are calculated from the value x 1 , and error values Y 1  and Y 2  are calculated from the actual error location values X 1  and X 2 . The received data words are then corrected by applying the calculated error values Y 1  and Y 2 . The error location value x 1  calculator is preferably constituted by logic gates which enable the apparatus to be smaller and faster than those using a conventional ROM table.

Description:
FIELD OF THE INVENTION 
     The present invention relates to an error correction technique, and more particularly to an error correction method and an apparatus thereof for protection of digital data, using an error correcting code in which up to two-word errors can be corrected. 
     BACKGROUND OF THE INVENTION 
     Generally, an error correction apparatus is applied to a digital communication system or a digital storage system, and can correct errors generated in the data to be received or to be reproduced. 
     As an example of the conventional error correction technique, there is a Japanese patent laid-open publication No. sho 57-25047 entitled &#34;Error Correction Method&#34; by SONY Corporation of Japan, published on Feb. 9, 1982. This publication discloses a method which can correct even two-word errors in a block of data having n words, each of which is composed of m bits. 
     The detailed descriptions are as follows. 
     The K syndromes S 0  to S K-1  are obtained from a block of data V T  consisting of n words to be received and a parity check matrix H by the following operation: ##EQU1## 
     Here, the parity check matrix H has n columns and k rows, and each of the elements in a predetermined row is selected among α 0  (=1) to α 2m-2 , where the element α is a root value satisfying the equation F(X)=0. Thus, two identical values are not found within the predetermined row, and the elements in the other rows are selected by the involution of the corresponding elements of the predetermined row. The parity check matrix H is represented as follows: ##EQU2## 
     In case of a double word error ei and ej, the equations for the syndromes S 0 , S 1 , S 2 , S 3  are as follows: 
     
         S.sub.0 =ei+ej 
    
     
         S.sub.1 =α.sup.i ei+α.sup.j ej 
    
     
         S.sub.2 =α.sup.2i ei+α.sup.2j ej 
    
     
         S.sub.3 =α.sup.3i ei+α.sup.3j ej. 
    
     The above equations can be modified as follows: 
     
         (α.sup.i S.sub.0 +S.sub.1)(α.sup.i S.sub.2 +S.sub.3)=(α.sup.i S.sub.1 +S.sub.2).sup.2. 
    
     If the equation is again modified, the following error location polynomial is obtained: 
     
         (S.sub.0 S.sub.2 +S.sub.1.sup.2)α.sup.2i +(S.sub.1 S.sub.2 +S.sub.0 S.sub.3)α.sup.i +(S.sub.1 S.sub.3 +S.sub.2.sup.2)=0 
    
     
         S.sub.0 S.sub.2 +S.sub.1.sup.2 =A 
    
     
         S.sub.1 S.sub.2 +S.sub.0 S.sub.3 =B 
    
     
         S.sub.1 S.sub.3 +S.sub.2.sup.2 =C 
    
     The error locations for two-word errors can be calculated by using the coefficients A, B, and C of the polynomial equation. 
     [1] In the case of no errors: 
     
         A=B=C=0, S.sub.0 =0, S.sub.3 =0. 
    
     [2] In the case of a one-word error: 
     When A=B=C=0, S 0  ≠0, and S 3  ≠0, a one-word error is determined. An error location i can be easily obtained from the equation α i  =S 1  /S 0 , and an error correction can be made using ei=S 0 . 
     [3] In the case of a two-word error: 
     In the case of an error of two words or more, the relationships of A≠0, B≠0 and C≠0 are satisfied. At this time, the following relationship is satisfied: 
     
         Aα.sup.2i +Bα.sup.1 +C=0 
    
     in which i ranges from zero to n-1. 
     If it is assumed that the relationships of B/A=D and C/A=E are satisfied, the following equations are obtained: 
     
         D=α.sup.i +α.sup.j 
    
     
         E=α.sup.i α.sup.j. 
    
     Accordingly, the following equation is derived from the above equations: 
     
         α.sup.2i +Dα.sup.i +E=0. 
    
     Here, when the difference of two error locations is t, that is, when the relationship of j=i+t is satisfied, the following equations are obtained: 
     
         D=α.sup.i (1+α.sup.t) 
    
     
         E=α.sup.2i+t. 
    
     Whereby, the following equation can be further derived: ##EQU3## 
     The values of α -t  +α t  for t=1 to (n-1) are previously stored in ROM, and t is obtained by detecting an agreement between an output of ROM and a value of D 2  /E calculated from the received word. If there is no agreement, the error is determined to be three words or more. 
     Thus, the following relationships are assumed: ##EQU4## Through derivation, the following equations are true: ##EQU5## 
     From the above equations, the error locations i and j are obtained. Then, the error patterns ei and ej are represented as follows: ##EQU6## The error locations and error patterns are obtained through the above-mentioned process, so that the error of the received word at the corresponding error locations can be corrected according to the error patterns. 
     However, in the method proposed in the Japanese patent laid-open publication No. Sho 57-25047, in order to obtain the error locations, the error locator polynomial α 2i  +D α i  +E=0 is solved to obtain two roots α i , α j  from which the error locations i and j are obtained, making the circuit required for the operations overly complicated, and the operational delay time overly long. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is an object of the present invention to provide an error correction method which can obtain error values without the step for calculating an error location polynomial. 
     It is another object of the present invention to provide an error correction apparatus which has a shorter delay time and a more simplified circuit. 
     To achieve the objects, an error correction method of the present invention comprises the steps of: 
     obtaining four syndromes S 0 , S 1 , S 2  and S 3  using the following operation of a block data V T  composed of n received words and a parity check matrix H ##EQU7## determining no errors when the syndromes S 0 , S 1 , S 2  and S 3  satisfy S 0  =S 1  =S 3  =0: 
     calculating D=S 0  S 2  +S 1   2  from the syndromes S 0 , S 1 , S 2  and S 3  and determining whether D is equal to zero; 
     calculating the following coefficients σ 1  and σ 2 , if D is not equal to zero: ##EQU8## obtaining the following coefficient K and the value Tr(K), when the coefficients σ 1  and σ 2  are not equal to zero: ##EQU9## obtaining the following error locations X 1  and X 2  from the coefficient K: 
     
         X.sub.1 =X.sub.1 σ.sub.1 
    
     
         X.sub.2 =(1+X.sub.1)σ.sub.1 
    
      where, from Tr(α 5 )=1, the following is derived: ##EQU10## obtaining the following error values Y 1  and Y 2  from the error locations X 1  and X 2  : ##EQU11## thereby correcting two-word errors where K GF(2 8 ). 
     An error correction apparatus of the present invention to achieve the other object of the present invention comprises: 
     a syndrome calculator for calculating syndromes S 0 , S 1 , S 2  and S 3  from n received words; 
     a first coefficient calculator for calculating the following coefficients σ 1  and σ 2  from the syndromes ##EQU12## a second coefficient calculator for calculating the following coefficient K from the coefficients σ 1  and σ 2  ##EQU13## an X 1  value calculator for calculating a value X 1  from the coefficient K; 
     an error location value calculator for calculating the following error locations X 1  and X 2  from the value X 1   
     
         X.sub.1 =X.sub.1 σ.sub.1 
    
     
         X.sub.2 =(1+X.sub.1)σ.sub.1 
    
     an error value calculator for receiving the error location values X 1  and X 2  and then calculating the following error values Y 1  and Y 2  ##EQU14## an error discriminator for determining how many errors happen, wherein the x 1  value calculator uses XOR logic gates which satisfy the following equations: 
     
         x.sub.0 =k.sub.3 +k.sub.5 +k.sub.6 
    
     
         x.sub.1 =k.sub.0 +k.sub.2 +k.sub.4 
    
     
         x.sub.2 =k.sub.0 +k.sub.3 +k.sub.4 +k.sub.6 
    
     
         x.sub.3 =k.sub.1 +k.sub.2 +k.sub.3 +k.sub.4 
    
     
         x.sub.4 =k.sub.0 +k.sub.7 
    
     
         x.sub.5 =k.sub.1 +k.sub.2 +k.sub.3 +k.sub.4 +k.sub.6 
    
     
         x.sub.6 =k.sub.0 +k.sub.1 +k.sub.2 +k.sub.4 +k.sub.7 
    
     
         x.sub.7 =k.sub.0 +k.sub.1 +k.sub.2 +k.sub.4. 
    
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The above objects and other advantages of the present invention will become more apparent by describing the preferred embodiment of the present invention with reference to the attached drawings, in which: 
     FIG. 1 is a logic circuit diagram to be applied to a preferred embodiment of the error correction apparatus according to the present invention; 
     FIG. 2 is a block diagram of the preferred embodiment of the error correction apparatus according to the present invention; and 
     FIG. 3 is a flowchart illustrating the operation of the apparatus shown in FIG. 2. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     First of all, an error correction code used in the present invention will be explained. 
     If an element λ[λ GF(q m )] to be θ=λ-λ q  exists, from the following propositions: ##EQU15## the following equation is obtained: 
     
         Tr(θ)=0. 
    
     If γ GF(q m ) and θ GF(q m ) are satisfied, the following equations are obtained: ##EQU16## 
     Thus, when an element over GF(q m ) satisfying Tr(λ)=1 is selected and Tr(θ) is equal to zero, the element λ defined in Eq. (1) satisfies θ=λ-λ from Eq. (2). Thus, if we infer x 2  +x=K from the error location polynomial σ(x)=x 2  +x+K and assume that x and K respectively correspond to λ and θ of the propositions, then, where Tr(θ)=0, the roots of the error location polynomial σ(x) are obtained, and the value x is represented as in Eq. (1). 
     Also, K can be given as 
     
         K=k.sub.0 k.sub.1 α+k.sub.2 α.sup.2 +k.sub.3 α.sup.3 +k.sub.4 α.sup.4 +k.sub.5 α.sup.5 +k.sub.6 α.sup.6 +k.sub.7 α.sup.7 
    
     and taking the traces for both sides of K GF(2 m ), it is given as 
     
         Tr(K)=k.sub.0 Tr(1)+k.sub.1 Tr(α)+k.sub.2 Tr(α.sup.2)+k.sub.3 Tr(α.sup.3)+k.sub.4 Tr(α.sup.4)+k.sub.5 Tr(α.sup.5)+k.sub.6 Tr(α.sup.6)+k.sub.7 Tr(α.sup.7)(3). 
    
     Using ##EQU17## and β GF(q m ) from the above-mentioned propositions to calculate the trace values of both sides of Eq.(3), they are given as: ##EQU18## and then Tr(α 5 ) becomes &#34;1&#34;. 
     As a result, the value Tr(K) becomes zero only when K 5  becomes zero, so that there exists roots of the error location polynomial σ(x). That is, if the propositions establish Tr(K) to be zero, there exists a value x over GF(q m ) satisfying x 2  +x=K. Here, if K GF(2 8 ) and Tr(K)=K 5  =0 is satisfied, one root is obtained using the following method. 
     i) An element K satisfying Tr(K)=1 is α 5 , which is proven as follows: ##EQU19## 
     ii) For Tr(K)=0, x is obtained as in Eq. (1), that is, ##EQU20## Rewriting Eq. (4) with respect to θ, x is given as: ##EQU21## 
     iii) Substituting γ=α 5  into Eq. (5), the respective coefficients can be obtained from ##EQU22## 
     iv) Each value x for θ=1 to α 7  is obtained. ##EQU23## 
     v) Considering the matrix equation obtained from step iv is: ##EQU24## then the following is true: ##EQU25## 
     From 
     
         X.sub.1 =K×M, 
    
     
         and 
    
     
         X.sub.1 =(x.sub.0,x.sub.1,x.sub.2,x.sub.3,x.sub.4, x.sub.5,x.sub.6,x.sub.7) 
    
     
         K=(k.sub.0,k.sub.1,k.sub.2,k.sub.3,k.sub.4,k.sub.5,k.sub.6,k.sub.7) 
    
     rewriting Eq. (6), M is given as ##EQU26## 
     Thus, a root X 1  of x 2  +x=K can be obtained. At this time, each value of component elements x 0  to x 7  of X 1   is given from Eq. (8) as ##EQU27## Here, k 5  should be &#34;0&#34; to satisfy the above-mentioned Tr(K)=k 5  =0. 
     Thus completing the method for obtaining the root X 1 , the other root X 2  is obtained from X 2  =X 1  +1. 
     Since the actual error locations can be obtained from multiplying each of X 1  and X 2  by σ 1 , they are given as ##EQU28## Also, the error values Y 1  and Y 2  are determined as: ##EQU29## 
     FIG. 1 shows a logic circuit diagram using XOR gates for implementing Eq. (9). Then, substituting x=σ 1  x&#39; into the double error location polynomial σ(x)=x 2  +σ 1  x+σ 2  yields 
     
         σ(x&#39;)=x&#39;.sup.2 +x&#39;.sup. +K 
    
     Then, K=σ 2  /σ 1   2  of Eq. (7) is obtained. 
     FIG. 2 is a block diagram of a preferred embodiment of an error correction apparatus according to the present invention. 
     With reference to FIG. 2, an input terminal 105 indicates an input for received data, and is connected to the inputs of a buffer memory device 100 and a syndrome calculator 120. The output of the buffer memory device 100 is connected to a first input of a first adder 110 which in turn outputs via an output terminal 115. The output of the syndrome calculator 120 is connected to a third input terminal of an error value calculator 180, a first input of a first coefficient calculator 130 and a first input of an error discriminator 160. A first output terminal of the first coefficient calculator 130 is connected to an input of a second coefficient calculator 140, the first input terminal of the first adder 110, and a first input terminal of a second multiplier 171. A second output of the first coefficient calculator 130 is connected to a second input of the error discriminator 160. A second output of the second coefficient calculator 140 is connected to a third input of the error discriminator 160. The output of the error discriminator 160 is connected to a first input of a controller 190. The output of an error location calculator 150 is connected to a first input of a second adder 111 and a second input of a first multiplier 170. The output of the second adder 111 is connected to a second input of the second multiplier 171. The output of the first multiplier 170 is connected to a second input of the error value calculator 180 and a second input of the controller 190. The output of the second multiplier 171 is connected to a third input of the error value calculator 180 and a third input of the controller 190. The output of the error value calculator 180 is connected to a first input of a buffer recorder 101. The output of the buffer recorder 101 is connected to a second input of the first adder 110. An output of the first adder 110 is connected to an output 115. First to eighth output terminals of the controller 190 are connected to control inputs of the buffer memory device 100, the syndrome calculator 120, the first coefficient calculator 130, the second coefficient calculator 140, the error location calculator 150, the error discriminator 160, the error value calculator 180, and the buffer recorder 101, respectively. 
     The operation of the error correction apparatus shown in FIG. 2 will be explained with reference to FIG. 1. 
     The received data fed through the input terminal 105 is simultaneously supplied to the buffer memory device 100 and the syndrome calculator 120. 
     The buffer device 100 delays the received data fed through the input terminal 105 for the required processing time of the syndrome calculator 120, the first and second coefficient calculators 130 and 140, the error location calculator 150, the second adder 111, the first and second multipliers 170 and 171, the error value calculator 180, and the buffer recorder 101, and then supplies the delayed received data to the first input of the first adder 110. 
     The syndrome calculator 120 stores the received data fed in series from input terminal 105 in its memory, and when the input of received data corresponding to a block has been completed, then the syndromes S 0 , S 1 , S 2  and S 3  are calculated using the following equation: ##EQU30## 
     The first coefficient calculator 130 produces coefficients σ 1 , σ 2  and D using the following operation of the syndromes S 0  through S 3  received from the syndrome calculator 120: ##EQU31## Then, the first coefficient calculator 130 supplies the two coefficients σ 1 , σ 2  to the second coefficient calculator 140 and the first and second multipliers 170 and 171 through the first output terminal, and supplies the coefficient D to the error discriminator 160 through the second output terminal. Here, the two coefficients σ 1  and σ 2  are coefficients of the quadratic error location polynomial σ(y)=y 2  +σ 1  y+σ 2  =0. 
     The second coefficient calculator 140 calculates the third coefficient K using the following operation of the two coefficients σ 1  and σ 2  received from the first coefficient calculator 130: ##EQU32## and then, via the first output, supplies the calculated coefficient K to the error location calculator 150. 
     The error location calculator 150 supplies the first error location value x 1  to the second adder 111 and the second multiplier 171 by the circuit shown in FIG. 1. The second adder 111 adds &#34;1&#34; to the first error location value x 1  to supply the second error location value x 2  to the first multiplier 170. The first multiplier 170 multiplies the second error location value x 2  by the first coefficient σ 1  to supply it to the error value calculator 180. The second multiplier 171 multiplies the first error location value x 1  by the second coefficient σ 2  to supply it to the error value calculator 180. The error value calculator 180 calculates the error value Y 1  and Y 2  using the first error location value X 1  and the second error location value X 2  as shown below: ##EQU33## and then supplies the error values Y 1  and Y 2  to the buffer recorder 101. 
     The buffer recorder 101 stores the two error values Y 1  and Y 2  received from the error value calculator 180. Then, when the received word having the error is supplied to the first input of the first adder 110, the buffer recorder 101 supplies the error values Y 1  and Y 2  to the second input of the first adder 110. 
     The first adder 110 adds the error values Y 1  and Y 2  fed to the second input terminal from the buffer recorder 101 to the received data fed to the first input terminal from the buffer memory device 100 and then corrects errors generated in received data. 
     The error discriminator 160 checks the syndromes S 0  through S 3  received from the syndrome calculator 120, the coefficient D received from the first coefficient calculator 130, and the value received from the second coefficient calculator 140, and then determines the existence or the absence of an error, the generation of one word error, the generation of a double word error, or the generation of a triple word error or greater. 
     The controller 190 supplies control signals for normalized timing to the buffer memory device 100, the syndrome calculator 120, the first and second coefficient calculators 130 and 140, the K value calculator 150, the error discriminator 160, the error value calculator 180 and the buffer recorder 101, respectively. 
     The operation of the apparatus shown in FIG. 2 will be described in detail according to the operational flowchart shown in FIG. 3. 
     The controller 190 supplies a syndrome calculation control signal to the syndrome calculator 120, instructing it to calculate syndromes (in step 200). 
     After step 200, the controller 190 queries the error discriminator 160 by way of an error discrimination control signal to determine whether the syndromes are all zero. If at this time, when the discrimination result signal received back from the error discriminator 160 shows that S 0  =S 1  =S 2  =S 3  =0, the controller 190 recognizes a no-error condition and then terminates the error correction operation (in step 201). 
     When the discrimination result signal fed to the error discriminator 160 shows that one or more syndromes are unequal to zero in the step 201, the controller 190 supplies the coefficient calculation control signal to the first coefficient calculator 130, instructing the first coefficient calculator to calculate D (in step 202), and also supplies the error discrimination control signal to the error discriminator 160, instructing the error discriminator to determine whether D is equal to zero (in step 203). 
     If the discrimination result signal received from the error discriminator 160 shows D=0, the controller 190 controls the error value calculator 180 and the buffer recorder 101 to correct one-word errors (in step 204). 
     And, if the discrimination result signal shows that D≠0, the controller 190 instructs the first coefficient calculator 130 to calculate the two coefficients σ 1  and σ 2  of the quadratic error location polynomial σ(y)=y 2  +σ 1  y+σ 2  =0 (in step 205). 
     Step 206 determines whether the discrimination result signal from the error discriminator 160 shows that σ 1  =0 and σ 2  =0. If the discrimination result signal received in the error discriminator 160 shows that σ 1  =0 or σ 2  =0, it is determined there are three or more errors (in step 209). And if the discrimination result signal shows that σ 1  ≠0 and σ 2  ≠0, the controller 190 supplies a control signal, instructing the second coefficient calculator 140 to calculate K and Tr(K) (in step 207). 
     After the step 207, it is determined whether the discrimination result signal received in the error discriminator 160 satisfies Tr(K)=0 (in step 208). If the discrimination result signal received in the error discriminator 160 shows that Tr(K) is not equal to zero, the controller 190 recognizes the generation of the three or more errors (in step 209). And if the discrimination result signal received in the error discriminator 160 shows that Tr(K) is equal to zero, the controller 190 instructs the X 1  value calculator 150 to calculate the value X 1 . Also in same step (step 210), the first multiplier 170 multiplies the value X 1  by the value σ 1  to calculate the value X 1 , and the second multiplier 171 multiplies the value X 2  by the value σ 2  to calculate the value X 2  (in step 210). 
     After step 210, the controller 190 supplies a control signal to the error value calculator 180, instructing it to calculate the error values Y 1  and Y 2  (in step 211). 
     After the step 211, the controller 190 controls the buffer recorder 101 according to the error location values X 1  and X 2  received from the first and second multipliers 170 and 171 in the step 210, thereby making the buffer recorder 101 supply the stored error values Y 1  and Y 2  received from the error value calculator 180 to the first adder 110. At this time, the first adder 110 adds the error values received from the buffer recorder 101 to the received word having the error and received from the buffer memory device 100, thereby correcting two-word errors in the received word (in step 211). 
     According to the present invention, the method and the apparatus used for correcting double errors over GF(2 8 ), receives the value from the second coefficient value calculator 140, and outputs the data using the XOR gates shown in FIG. 1, thereby being faster and simpler, and also having a smaller chip size than that using the conventional ROM table.