Background of the Invention
1. Field of the Invention
The present invention relates to a Reed-Solomon decoder for correcting errors on digital data during a transmission (by electric, radio, or any other suitable signals), and more particularly to Reed-Solomon decoder methods and apparatus for providing, in a suitable order, data to be corrected and the respective correction values.
2. Discussion of the Related Art
Reed-Solomon (RS) encoding consists in providing packets of data to transmit in the form of RS codes, whereby these packets of data may then be extracted from the RS codes and corrected in a receiver. An RS code is a set of M digital data which are associated with coefficients of a polynomial of degree M-1 which is a multiple of a generator polynomial of degree 2t having 2t distinct roots. In transmitting such RS code, up to t erroneous coefficients can be localized and corrected.
In addition, the coefficients of an RS code are associated with elements of a finite field. Thus, if the coefficients to be transmitted are n-bit numbers, a finite field of 2.sup.n elements, noted GF(2.sup.n), will be used. In this finite field, an RS code may include up to N=2.sup.n -1 coefficients.
In a finite field, the addition of two numbers is defined by a bit-to-bit Exclusive-OR between these two numbers. As a consequence, .alpha.+.alpha.=0 if .alpha. is an arbitrary element of a finite field. The multiplication is defined so that the product of two elements of the finite field is also an element of the finite field. Thus, any non-null element of the finite field is a power of another non-null and non-unitary element of this finite field. In a finite field of N+1 elements, the powers are defined modulus N, i.e., .alpha..sup.i =.alpha..sup.i+N, where .alpha. is a non-null and non-unitary element of the finite field and i is a positive or negative integer. Accordingly, the non-null elements of a finite field of N+1 elements can be written .alpha..sup.0, .alpha..sup.1, . . . , .alpha..sup.N-1.
To transmit a set of data a.sub.N-2t-1, . . . , a.sub.0 according to an RS code (M.ltoreq.N), the following polynomial is formed:
Then, the coefficients of a polynomial A(x), where
are transmitted, where r(x) is the remainder of the division of the polynomial x.sup.2t a(x) by a generator polynomial. Thus, the coefficients A of polynomial A(x) constitute an RS code, and the coefficients corresponding to the terms of degrees 2t to N-1 are the effective coefficients a to be transmitted. Of course, the transmission is subject to errors and some of the received coefficients A may be erroneous.
The correction of errors is carried out as follows. A syndrome polynomial S(x) (hereafter referred to as a syndrome) of degree 2t-1 is formed, whose coefficient of the term of degree i (i=0, 1, . . . , 2t-1) is written:
where .alpha..sup.0, .alpha..sup.1, . . . , .alpha..sup.2t-1 are the roots of the generator polynomial. If no transmission error occurred, the syndrome is null, since the roots of the generator polynomial are also roots of the polynomial A(x).
Otherwise, a polynomial .lambda.(x), referred to as an error locator polynomial, of degree less than or equal to t, and a polynomial R(x), referred to as an error correction polynomial, of degree less than t, are searched for such that:
where .gamma.(x) is a polynomial which is not to be determined.
Polynomial .lambda.(x) has t distinct roots at most. If .alpha..sup.r is a root of polynomial .lambda.(x), coefficient A.sub.N-r has been transmitted with an error. The error on this coefficient is expressed by:
where .lambda.' is the derivative polynomial of polynomial .lambda..
The Euclid algorithm is used to calculate polynomials .lambda.(x) and R(x). The Euclid algorithm starts from the following equation system
and, at each of at most 2t steps, a new system is formed from the preceding one by replacing one of the equations with a linear combination of the two equations so that the term of highest degree of the second member is cancelled. Among the two preceding equations, the equation whose second member is of lowest degree is maintained. The operation is repeated in the same manner until an equation with a second member of degree lower than t is obtained. Then, the second member is the polynomial R(x) and the polynomial .lambda.(x) is the one which multiplies S(x) in the same equation.
The article of IEEE Transactions on Computers, Vol. C-34, No. 5, May 1985, "A VLSI Design of a Pipeline Reed-Solomon Decoder" describes an exemplary use of the Euclid algorithm and a circuit for carrying out the Euclid algorithm in this example. This circuit is particularly complex because it requires a relatively complex cell for each calculating step of the algorithm. In addition, each calculating cell must be designed to take into account particular cases (for example, null polynomial coefficients).
Summary of the Invention
An object of the present invention is to provide a particularly simple circuit for carrying out the Euclid algorithm.
A further object of the present invention is to provide a control method of this circuit for carrying out the Euclid algorithm.
In an embodiment of the invention, a Reed-Solomon decoder includes first and second sets of registers whose contents are respectively initialized at values corresponding to the coefficients of a syndrome polynomial of degree 2t-1 and at values which are all zero except for the second value which is equal to 1; third and fourth sets of registers connected to the outputs of the first and second sets of registers and whose contents are initialized at values which are zero except for that of the last register of the third set which is initialized at 1. A calculation circuit is associated with each register of the first and second sets to provide each register, except for the first register of the first set, with the sum of the product of the content of the preceding register of these first and second sets by the content of the last register of the third set and the product of the content of the corresponding register of the third and fourth sets by the content of the last register of the first set. The embodiment further includes a counter and an indicator register which are respectively initialized at a first number and at a number exceeding the first number by 1, the indicator register being connected to an output of the counter and the counter being connected to an output of the indicator register. A sequencer is provided for a) enabling writing of the first and second sets of registers and decrementing the content of the counter if this content is higher than or equal to the content of the indicator register, or if the content of the last register of the first set is zero, or b) enabling writing of the first, second, third and fourth sets of registers and the indicator register if the content of the counter is lower than the content of the indicator register and if the content of the last register of the first set is non-zero. The sequencer stops when the content of the counter is decreased by t.
According to an embodiment of the invention, each calculation circuit includes first and second lines successively receiving the bits of the last registers of the first and third sets, respectively; a first set of gates which transmit the output of the associated register of the first and second sets, respectively, if the second line is at 1, and a second set of gates which transmit the output of the associated register of the third and fourth sets if the first line is at 1; a first adder which receives the outputs of the first and second sets of gates; and a second adder which adds the output of the first adder to the content of a multiplication register, the content of this multiplication register is successively shifted to the left, and a carry is recombined with this content so that a multiplication in a finite field is carried out.
According to an embodiment of the invention, the calculation circuit associated with the first register of the second set executes calculations from the contents of the last registers of the second and fourth sets.
According to an embodiment of the invention, the counter is connected to the output of the indicator register the indicator register is connected to the output of the counter and the sequencer is operable to enable writing of the counter and to decrement the counter at each step b).
Another embodiment of the invention is directed to a method for determining the coefficients required to correct up to t errors in data transmitted as Reed-Solomon codes. The method includes the steps of determining the coefficients of a syndrome polynomial of degree 2t-1; storing the coefficients of the syndrome polynomial in a first set of registers, storing coefficients which are all zero except for the second, equal to 1, in a second set of registers, and storing a first number in a counter; storing coefficients which are all zero, except for the last one, equal to 1, in a third set of registers, storing coefficients which are all zero in a fourth set of registers, and storing a number exceeding the first number by 1 in an indicator register; a) if the content of the counter is greater than or equal to the content of the indicator register, or if the content of the last register of the first set is zero, storing in each register of the first set the sum of the product of the content of the preceding register of the first set by the content of the last register of the third set and the product of the content of the corresponding register of the third set by the content of the last register of the first set, and storing in each register of the second set the sum of the product of the content of the preceding register of the second set by the content of the last register of the third set, and the product of the content of the corresponding register of the fourth set by the content of the last register of the first set, and decrementing the counter; b) otherwise, further transferring the contents of the first and second sets of registers and of the counter into the third and fourth sets of registers and the indicator register respectively; and repeating steps a) or b) until the content of the counter is decremented by t, and then reading the coefficients of an error correction polynomial and the coefficients of an error locator polynomial, respectively, in the first and second sets of registers.
According to an embodiment of the invention, the first and third sets include 2t registers, and the second and fourth sets include t+1 registers. The first register of the second set receives the sum obtained from a product of the last registers of the second and third sets and a product of the last registers of the first and fourth sets.
According to an embodiment of the invention, at step b), the contents of the counter and of the indicator register are swapped, and the counter is then decremented.
According to an embodiment of the invention, the number initially stored in the counter is t.
According to an embodiment of the invention, each sum of products is obtained by the steps of successively establishing first partial products of the bits of the last register of the first set by the content of a register of the third or fourth sets; successively establishing second partial products of the bits of the last register of the third set by the content of a register of the first or second sets; and successively forming the sums of the first and second partial products and adding these sums to the content of a register, left-shifted at each addition.
The foregoing and other objects, features, aspects and advantages of the invention will become apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.
Brief Description of Drawings
FIG. 1 represents an exemplary succession of steps of the method according to the invention;
FIG. 2 represents an embodiment of a circuit carrying out a method according to the present invention; and
FIG. 3 partially represents an alternative embodiment of a circuit carrying out a method according to the present invention.
Detailed Description
Carrying out the Euclid algorithm starts from the system of equations:
According to the invention, a set of registers R, a set of registers .lambda., and a counter dR are associated with the first equations of the successive systems obtained by carrying out the Euclid algorithm. Similarly, a set of registers Q, a set of registers .mu., and an indicator register dQ are associated with the second equations of the successive systems.
The set of registers R includes 2t registers R.sub.2t-1, R.sub.2t-2, . . . , R.sub.0, corresponding to the coefficients of the terms of decreasing degrees of the second member of each first equation. The set of registers .lambda. includes t+1 registers .lambda..sub.t to .lambda..sub.0, corresponding to the coefficients of the terms of decreasing degrees of the factor of S(x) in each first equation. Counter dR contains a number representative of the degree of the second member of each first equation.
Similarly, registers Q are associated with the second member of each second equation, registers .mu. are associated with the factor of S(x) in each second equation, and the indicator register dQ is associated with the degree of the second member of each second equation.
Initially, in the order of decreasing degrees, the set of registers R stores the syndrome coefficients, the set of registers .lambda. stores numbers 0,0, . . . ,0,1,0, the set of registers Q stores numbers 1,0, . . . ,0, and the set of registers .mu. stores zeros. Counter dR and register dQ are respectively initialized at 2t-1 and 2t, for example. Then, the method operates on the registers in 2t-1 steps, each including one of the following steps (in the equations, the register identifiers also designate the contents of the registers).
a) If the content of counter dR is higher than or equal to the content of register dQ, or if the content of register R.sub.2t-1 is null, the content of each register R.sub.i (i=1,2, . . . 2t-2) is modified according to the following equation:
The content of register R.sub.0 is cancelled at the first step a).
Similarly, each register .lambda.i (i=1,2, . . . t) is modified according to the following equation:
the content of register .lambda..sub.0 being replaced with R.sub.2t-1 .mu..sub.t +Q.sub.2t-1 .lambda..sub.t. Counter dR is decremented by one.
In this case, the content of register .lambda. is circularly modified, i.e., register .lambda..sub.0 receives a value calculated from the content of register .lambda..sub.t. This limits the number of registers. As an alternative, t-1 additional registers could have been provided on the left of each of the sets of registers .lambda. and .mu..
b) Otherwise, if the content of counter dR is lower than the content of register dQ, and if the content of register R.sub.2t-1 is non-null, the contents of the set of registers R and the set of registers .lambda. are transferred into the set of registers Q and the set of registers .mu., respectively, and the contents of counter dR and register dQ are swapped. The operations of step a) are also carried out. That is, step b) includes the substeps of step a).
The method stops when counter dR contains a value (t-1, in this case) corresponding to a degree lower than t. Then, the coefficients of the error locator polynomial .lambda.(x) are stored in registers .lambda..sub.t to .lambda..sub.0, and the coefficients of the error correction polynomial R(x) are stored in registers R.sub.2t-1 to R.sub.t.
FIG. 1 illustrates the use of this method for an exemplary syndrome of degree 5 of a Reed-Solomon code with t=3. The finite field used has 15 non-null elements .alpha..sup.0 to .alpha..sup.14. The considered syndrome polynomial is:
This example is used in the above article of IEEE Transactions On Computers. To follow the calculations, refer to the table in this article indicating the binary values of elements .alpha..sup.0 to .alpha..sup.14.
FIG. 1 represents the states of registers R, Q, .lambda., .mu. and dQ and of counter dR at successive steps, represented by circled numbers, of the method according to the invention. The indexes of the registers are represented over the registers (0 to 5 for the sets of registers R and Q wherein 0 indexes the first register and 5 indexes the last register in the sets of registers R and Q; and 0 to 3 for the sets of registers .lambda. and .mu. wherein 0 indexes the first register and 3 indexes the last register in the set of register .lambda. and .mu.).
At an initial step 0, coefficients .alpha..sup.7, .alpha..sup.12, .alpha..sup.6, .alpha..sup.12, .alpha..sup.14 and .alpha..sup.14 of the syndrome are stored in registers R.sub.5 to R.sub.0, respectively. Numbers 0,0,1,0 are stored in registers .lambda..sub.3 to .lambda..sub.0 ; numbers 1,0,0,0,0,0 are stored in registers Q.sub.5 to Q.sub.0 ; and numbers 0,0,0,0 are stored in registers .mu.. Number 5, which is the syndrome degree, is stored in counter dR, and number 6 is stored in register dQ.
Step 1 corresponds to step b) described above, since the content of counter dR is lower than the content of register dQ, and since the content of register R.sub.5 is non-null. The contents of each of the registers R (except for the last register) and each of the registers .lambda. are multiplied by 1 and the contents of each of the registers Q (except for the last register) and each of registers .mu. are multiplied by .alpha..sup.7. The sums of the obtained products are put into the set of registers R after one simple left-shift, and into the set of registers .lambda. after one circular left-shift. At the same time, the preceding contents of the sets of registers R and .lambda. are transferred into the sets of registers Q and .mu.. The contents of counter dR and of register dQ are swapped. Then, the content of counter dR is decremented to indicate that the new content of the set of registers R corresponds to a polynomial of degree 5.
Step 2 corresponds to a step a) described above, since the contents of counter dR and of register dQ are equal. The contents of the set of registers R and the set of registers .lambda. are multiplied by .alpha..sup.7, and the contents of the set of registers Q and the set of registers .mu. are multiplied by .alpha..sup.12. The sums of the obtained products are again put into the set of registers R after one simple left-shift, and into the set of registers .lambda. after one circular left-shift. Counter dR is decremented. The new content of the set of registers R corresponds to a polynomial of degree 4.
The next steps 3 and 4 correspond to a step b) and a step a), respectively. At step 4, the counter dR indicates that the content of the set of registers R corresponds to a polynomial of degree 3. However, this polynomial is in fact a polynomial of degree 1 because the coefficients of the terms of degrees 2 and 3 are null.
Theoretically, the method could stop, but the circuits required to process this particular case would unnecessarily increase the complexity. In the general case, a further step is executed because the content, 3, of counter dR is not lower than t=3.
Step 5 corresponds to a step a) described above since the content of register R.sub.5 is zero. The contents of the set of registers R and the set of registers .lambda. are multiplied by .alpha..sup.10, and the contents of the set of registers Q and the set of registers .mu. are multiplied by 0. The sums are provided to the set of registers R and the set of registers .lambda. after one left-shift (circular shift for the set of registers .lambda.). The content of counter dR is decremented. The method now stops because counter dR indicates a degree less than t=3.
At the end of step 5, the coefficients contained in registers R.sub.5 to R.sub.3 are the coefficients of the error correction polynomial R(x), and the coefficients contained in registers .lambda.3 to .lambda.0 are the coefficients of the error locator polynomial .lambda.(x) (in fact, each of these polynomials is multiplied by a constant, in this case, .alpha..sup.10, which does not affect the error correction). In this example, the polynomials found are:
The roots of polynomial .lambda.(x) are .alpha..sup.10 and .alpha..sup.3, which means that, among the received coefficients, those having indexes 15-10=5 and 15-3=12 are erroneous. The corresponding errors are .alpha..sup.11 and .alpha..sup.7.
FIG. 2 represents an embodiment of a circuit for carrying out a method according to the invention. This circuit can easily be extended to any Reed-Solomon code. Each register R.sub.2t-2 to R.sub.0 provides its content to a respective multiplier 10; each register .lambda..sub.t to .lambda..sub.0 provides its content to a respective multiplier 12; each register Q.sub.2t-2 to Q.sub.0 provides its content to a respective multiplier 14; and each register .mu..sub.t to .mu..sub.0 provides its content to a respective multiplier 16. The content of register R.sub.2t-1 is provided to a second input of multipliers 14 and 16, and the content of register Q.sub.2t-1 is provided to a second input of multipliers 10 and 12. The outputs of multipliers 10 and 14 associated with registers R.sub.i and Q.sub.i are provided to a respective adder 18 whose output is provided to register R.sub.i+1. The outputs of multipliers 12 and 16 associated with registers .lambda..sub.i and registers .mu..sub.i are provided to a respective adder 20 whose output is provided to register .lambda..sub.i+1, or .lambda..sub.0 if i=t.
The set of registers R is connected so that it receives initial values corresponding to the coefficients of syndrome S. The set of registers .lambda. is connected so that it receives the initial values 0,0, . . . ,0,1,0. The set of registers Q is connected so that it receives the initial values 1,0, . . . ,0. Finally, the set of registers .mu. has a reset input RST. The set of registers R and the set of registers .lambda. are connected to the set of registers Q and the set of registers .mu., respectively, so that the contents of the set of registers R and the set of registers .lambda. can be transmitted to the set of registers Q and .mu.. In FIG. 2, counter dR and register dQ are looped.
Counter dR has a decrementation input DEC and is initialized at a value t. Correspondingly, register dQ is initialized at a value t+1. In this embodiment, counter dR is initialized at value t, instead of value 2t-1 corresponding to the syndrome degree as shown in a previous embodiment, because it is easier to compare the value of counter dR with 0 rather than with t-1 to determine when the method must stop.
A sequencer 22 compares the content of register R.sub.2t-1 with 0, and compares the content of counter dR with the content of register dQ to select step a) or step b). Sequencer 22 controls the registers and the counter so that the above described operations are obtained. Such a sequencer can be easily realized by those skilled in the art, who, for example, can translate the steps of the above method in a logic circuit description language, such as VHDL.
The multipliers and adders of the circuit of FIG. 2 are wired to execute the multiplication and the addition defined for the considered finite field.
The addition (Exclusive-OR) is simpler than the addition of binary numbers; however, the multiplication is more complex.
If the product 2nt (n being the number of bits of each coefficient) is lower than the number of coefficients in the transmitted Reed-Solomon codes, instead of using the two multipliers associated with each adder 18, 20, the system can use only one sequential multiplier which, in n cycles, executes a multiplication of two numbers of n bits. With the sequential multipliers, the determination of polynomials .lambda. and R takes 2nt cycles instead of only 2t cycles. This is not a drawback if 2nt cycles are available to process each Reed-Solomon code because the circuit would then include half the number of (sequential) multipliers which are, furthermore, simpler than non-sequential multipliers.
FIG. 3 represents a sequential multiplier associated with a pair of registers R.sub.i and Q.sub.i (i.noteq.2t-1). The outputs of registers R.sub.i and Q.sub.i are provided to respective sets of AND gates 30 and 32. Gates 30 are such that they transmit the output of register R.sub.i to a first input of an adder 34 if a line q.sub.2t-1 is at 1. Gates 32 are such that they transmit the output of register Q.sub.i to a second input of adder 34 if a line r.sub.2t-1 is at 1. Lines q.sub.2t-1 and r.sub.2t-1 successively receive the bits of decreasing weight of registers Q.sub.2t-1 and R.sub.2t-1, respectively. The output of adder 34 is added to the content of a register P.sub.i by adder 36. The output of adder 36 is provided to register R.sub.i+1 of the next stage, and register R.sub.i receives the output of adder 36 of the preceding stage.
The successive bits of register Q.sub.2t-1 are provided on line q.sub.2t-1 at the same time as the successive bits of register R.sub.2t-1 are provided on the line r.sub.2t-1. Thus, the AND gates 30 and 32 successively provide partial multiplications of the contents of registers R.sub.i and Q.sub.2t-1 and of the contents of registers Q.sub.i and R.sub.2t-1. The sum of each pair of partial multiplications, provided by adder 34, is added to the content of register P.sub.i, which is left-shifted at each addition. Register P.sub.i has the same size as registers R.sub.i and registers Q.sub.i and, when it overflows, the carry is recombined with bits of registers P.sub.i to obtain a multiplication in the considered finite field. In the above-mentioned example of the 16-element finite field, the carry is recombined with bits of weights 0 and 1.
As shown, a switch 38 is placed at the input of register R.sub.i. In a first position of this switch, register R.sub.i receives the output of adder 36 of the preceding stage (if i=0, it receives value 0). In a second position selected by enabling a signal INIT, register R.sub.i receives the syndrome coefficient S.sub.i.
A switch 40 is placed at the input of register Q.sub.i. In a first position of switch 40, register Q.sub.i receives the output of register R.sub.i. In a second position of switch 40, selected by enabling signal INIT, register R.sub.i receives a 0 (or 1, if i=2t-1).
The stages associated with the set of registers .lambda. and the set of registers .mu. are similar.
Initially, signal INIT is enabled. Registers R, Q, .lambda., and .mu. receive the corresponding initialization values (S.sub.i, 0, 1) and are enabled to load these values.
A succession of steps a) and b) as above described is executed. Each step includes n sub-steps of partial multiplication during which sequencer 22 successively provides the n bits of register R.sub.2t-1 on line r.sub.2t-1 and, at the same time, the n bits of register Q.sub.2t-1 on line q.sub.2t-1. At each of these sub-steps, registers P are enabled so that they shift the data to the left with a carry recombination.
At the end of each n sub-step of partial multiplication, adders 36 provide the final results. Each of the register sets R and .lambda. is then enabled by the sequencer to receive these results. During step b), the set of registers Q and the set of registers .mu. are enabled at the same time as the set of registers R and the set of registers .lambda. to receive the old values of the set of registers R and the set of registers .lambda..
As is apparent to those skilled in the art, various modifications can be made to the above disclosed preferred embodiments. For example, instead of swapping the contents of counter dR and register dQ and then decrementing counter dR, the content of counter dR can merely be transferred into register dQ, without decrementing the counter. In addition, to detect the end of the method, the system can count t steps a) or b) instead of controlling the content of counter dR.
Having thus described at least one illustrative embodiment of the invention, various alterations, modifications, and improvements will readily occur to those skilled in the art. Such alterations, modifications, and improvements are intended to be within the spirit and scope of the invention. Accordingly, the foregoing description is by way of example only and is not intended to be limiting. The invention is limited only as defined in the following claims and the equivalents thereto.