Abstract:
A highly efficient Reed-Solomon decoding algorithm and a VLSI implementation thereof are used to correct errors found in data which was previously encoded utilizing Reed-Solomon encoding. The Reed-Solomon decoding algorithm takes advantage of certain desirable features of Euclid&#39;s algorithm and of the Berlekamp-Massey algorithm to provide a simplified and computationally efficient algorithm which eliminates the need to perform inverses.

Description:
RELATED APPLICATIONS 
     This patent application claims the benefit of the filing dates of U.S. Provisional patent application Ser. No. 60/055,275, filed on Aug. 13, 1997 and entitled SIMPLIFIED PROCEDURE FOR CORRECTING ERRORS OF REED-SOLOMON CODE USING AN INVERSIONLESS THE [SIC] BERLEKAMP-MASSEY ALGORITHM; and U.S. Provisional patent application Ser. No. 60/072,407, filed on Jan. 23, 1998 and entitled VLSI DESIGN OF A DECODER FOR CORRECTING ERRORS OF REED-SOLOMON CODES USING AN INVERSIONLESS BERLEKAMP-MASSEY ALGORITHM, the contents of both of which are hereby incorporated by reference. 
    
    
     FIELD OF INVENTION 
     The present invention relates generally to forward error correcting methodology. The present invention relates more particularly to a method for decoding Reed-Solomon encoded data so as to effect error correction in a manner which is computationally efficient and which is suited for very large scale integrated circuit (VLSI) implementation. The present invention further comprises a VLSI implementation of the Reed-Solomon decoding methodology. 
     BACKGROUND OF THE INVENTION 
     As data storage densities and data transmission rates increase, the ability of hardware devices to correctly recognize binary data diminishes. Such binary data, which comprises a string of bits, i.e., zeros and ones, must be correctly recognized so as to facilitate the proper interpretation of the information represented thereby. That is, each individual zero and one needs to be interpreted reliably, so as to facilitate the accurate reconstruction of the stored and/or transmitted data represented thereby. 
     Such increased storage densities and transmission rates place a heavy burden upon the hardware utilized to recognize the state of individual bits. In contemporary storage devices, high storage densities dictate that the individual data bits be stored very close to one another. Further, in some data storage systems, the difference between the manner in which a one and a zero is stored in the media is not great enough to make the reading thereof as reliable as desired. 
     High data transmission rates imply either that the time allocated for each bit is substantially reduced, or that a modulation scheme is utilized wherein small differences in amplitude, frequency, and/or phase indicate a distinct sequence of bits, e.g., such as in multi-bit modulation. In either instance, the ability of hardware devices to accurately and reliably interpret such transmitted data is substantially reduced. 
     Although modern data storage systems are generally capable of limiting read errors to approximately one bit in ten billion, the extremely high volume of data processing typically being performed in contemporary data processing systems makes even such a seemingly low error rate unacceptable. In many systems, such an error rate would result in at least one error per day. 
     It must be appreciated that the incorrect reading of even a single bit of data may have highly undesirable effects. For example, the incorrect reading of a single bit of a computer program may cause the program to lock up or otherwise function incorrectly. Also, the incorrect reading of a single bit of numeric data may cause a number to be misread, which may have serious consequences when dealing with financial data, for example. 
     As those skilled on the art will appreciate, increasing data storage density and/or increasing data transmission speed inherently increases the bit error rate, i.e., the percentage of error bits contained in a message. It is desirable to be able to identify and correct data errors which occur during data storage and/or transmission operations. By being able to identify and correct such data errors, data may be stored more densely and/or transmitted more rapidly. 
     Further, the ability to correct data errors facilitates the use of mechanical devices, e.g., record/read heads, which are manufactured according to reduced tolerances and which are therefore less expensive. That is, hardware may be utilized which is more prone to introducing data errors, but which costs less. 
     Moreover, the ability to correct errors facilitates storage and transmission of data in low signal to noise environments. Thus, since data errors can be corrected, more noise can be tolerated within a storage medium (or rather the data signal can be recorded at a lower level as compared to the noise level, thus facilitating higher storage densities). Similarly, more noise can also be tolerated in data transmission, thereby facilitating increased data transmission speed. 
     The ability to store and transmit data in low signal to noise environments provides substantial benefit in satellite/spacecraft communications, compact disc (CD) recording, high definition television (HDTV), digital versatile disc (DVD) recording, network communications, and the like. In satellite/spacecraft communications, a weak signal (low signal to noise ratio) inherently results from the use of low power transmitters necessitated by weight constraints. In compact disc (CD) and digital disc (DVD) recording, being able to record in low signal to noise environments facilitates increased storage densities. In high definition television (HDTV) and network communications, being able to operate in low signal to noise environments facilitates communication at increased data transmission rates. 
     Error detection and correction methodologies for determining the existence of errors in stored and/or transmitted data and for correcting those errors are well known. Among the simplest of these methodologies is the use of data redundancy, wherein the data is repeated several times when it is stored or transmitted. When the data is read, a particular data error is unlikely to affect more than one occurrence of the data, such that a majority vote results in the correct data being recognized. 
     For example, a data byte may be stored three times. A data error is likely to affect only one of these three stored data bytes. Thus, the two correctly stored data bytes constitute a majority with respect to the incorrectly stored data byte, thereby identifying the data error and assuring correct interpretation of the stored data. However, as those skilled in the art will appreciate, such a majority vote method is extremely inefficient, since the data must be stored or transmitted several, e.g., 3, times. It is preferable to utilize an error detection and correction methodology which requires as few added bits to the message data as possible. This tends to minimize storage requirements and maximize transmission speed. 
     In an effort to overcome the deficiencies associated with the inefficient methodology of the majority vote system, various means for providing data correction which add only a few extra bits to the data have evolved. For example, the well known use of parity bits provides a much mnore efficient scheme for indicating the presence of a data error, although the use of simple parity alone does not facilitate the correction of such errors. When only parity error detection is used, then incorrectly transmitted data must be re-transmitted. Thus, although corrupt data is readily identifiable, corrupt data which was only present in a storage medium, and thus is not available for re-transmission, may not be recoverable. 
     Since it does not facilitate error correction without retransmission, parity is not a forward error correction methodology. In forward error correction methodologies, sufficient information is added to the stored or transmitted data to facilitate the reliable correction of data errors without requiring such retransmission, as long as a mathematically determined error rate is not exceeded. 
     It is desirable to provide a methodology for correcting burst errors. Burst errors involve the corruption of a plurality of consecutive bits. Burst errors are common in data storage and data transmission. 
     Burst errors typically occur during data storage due to faulty media. For example, a scratch or other imperfection upon a magnetic or optical storage medium may result in the loss or corruption of many consecutive bits stored upon the medium. 
     Burst errors typically occur during data transmission due to noise or static within the transmission frequency band. Signal fading and cross-talk may also cause burst errors during data transmission. 
     The well known Reed-Solomon encoding methodology provides an efficient means of error detection which also facilitates forward error correction, wherein a comparatively large number of data errors in stored and/or transmitted data can be corrected. 
     Reed-Solomon encoding is particularly well suited for correcting burst errors, wherein a plurality of consecutive bits become corrupted. For example, the implementation of Reed-Solomon encoding currently used to store information upon compact discs (CDs) is capable of correcting error bursts containing as many as four thousand consecutive bits. 
     Reed-Solomon encoding is based upon the arithmetic of finite fields. A basic definition of Reed-Solomon encoding states that encoding is performed by mapping from a vector space of M over a finite field K into a vector space of higher dimension over the same field. Essentially, this means that with a given character set, redundant characters are utilized to represent the original data in a manner which facilitates reconstruction of the original data when a number of the characters have become corrupted. 
     This may be better understood by visualizing Reed-Solomon code as specifying a polynomial which defines a smooth curve containing a large number of points. The polynomial and its associated curve represent the message. That is, points upon the curve are analogous to data points. A corrupted bit is analogous to a point that is not on the curve, and therefore is easily recognized as bad. It can thus be appreciated that a large number of such bad points may be present in such a curve without preventing accurate reconstruction of the proper curve (that is, the desired message). Of course, for this to be true, the curve must be defined by a larger number of points than are mathematically required to define the curve, so as to provide the necessary redundancy. 
     If N is the number of elements in the character set of the Reed-Solomon code, then the Reed-Solomon encode is capable of correcting a maximum of t errors, as long as the message length is less than N-2t. 
     Although the use of Reed-Solomon encoding provides substantial benefits by enhancing the reliability with which data may be stored or transmitted, the use of Reed-Solomon encoding according to contemporary practice possesses inherent deficiencies. These deficiencies are associated with the decoding of Reed-Solomon encoded data. It should be noted that in many applications, the encoding process is less critical than the decoding process. For example, since CDs are encoded only once, during the mastering process, and subsequently decoded many times by users, the encoding process can use slower, more complex and expensive technology. However, decoding must be performed rapidly to facilitate real-time use of the data, e.g., music, programs, etc., and must use devices which are cost competitive in the consumer electronics market. Thus, it is desirable to provide a VLSI device for performing Reed-Solomon decoding, since such VLSI devices tend to be comparatively fast and inexpensive. 
     Decoding Reed-Solomon encoded data involves the calculation of an error locator polynomial and an error evaluator polynomial. One of two methods is typically utilized to decode Reed-Solomon encoded data. The Berlekamp-Massey algorithm is the best known technique for finding the error locator. The Berlekamp-Massey algorithm is capable of being implemented in a VLSI chip. However, the Berlekamp-Massey algorithm utilizes an inversion process which undesirably increases the complexity of such a VLSI design and which is computationally intensive, thereby undesirably decreasing the speed of decoding process. 
     Also well known is the use of Euclid&#39;s algorithm for the decoding of Reed-Solomon encoded data. However, Euclid&#39;s algorithm utilizes a polynomial division methodology which is computationally intensive and which is difficult to implement in VLSI. 
     In view of the foregoing, it is desirable to provide a method for decoding Reed-Solomon encoded data which is easily and economically implemented as a VLSI chip and which is computationally efficient so as to substantially enhance decoding speed. 
     SUMMARY OF THE INVENTION 
     The present invention specifically addresses and alleviates the above mentioned deficiencies associated with the prior art. More particularly, the present invention comprises a highly efficient Reed-Solomon decoding algorithm and a VLSI implementation thereof. The VLSI implementation of the algorithm is used to correct errors found in data which was encoded utilizing Reed-Solomon encoding and is particularly well suited for low cost, high speed applications. The algorithm of the present invention takes advantage of certain desirable features of Euclid&#39;s algorithm and of the Berlekamp-Massey algorithm. 
     According to the present invention, the error locator polynomial and the error evaluator polynomial are calculated simultaneously and there is no need to perform polynomial divisions within the reiteration process. Further, the need to compute the discrepancies and to perform the field element inversions, as required by the prior art, is eliminated. Thus, the complexity of the VLSI implementation is substantially reduced and the processing time is shortened. A software simulation of the decoding algorithm of the present invention shows that the decoding process is faster than that of the original Euclid&#39;s algorithm and faster than the Berlekamp-Massey algorithm. 
     As discussed above, two different methods, Euclid&#39;s algorithms and the Berlekamp-Massey algorithm, for decoding Reed-Solomon encoded data are well known. Euclid&#39;s algorithm offers the advantage of facilitating the simultaneous calculation of the error evaluator polynomial along with the error locator polynomial. However, Euclid&#39;s algorithm is less efficient in practice than the Berlekamp-Massey algorithm because Euclid&#39;s algorithm performs polynomial divisions within the iteration process thereof. 
     The Berlekamp-Massey algorithm is the most widely used technique for determining the error locator polynomial and error evaluator polynomial. Although the Berlekamp-Massey algorithm can be implemented in a VLSI chip, such implementation is made undesirably complex by the Berlekamp-Massey algorithm&#39;s iteration process and field element inversions. Thus, the error locator polynomial and the error evaluator polynomial can be calculated simultaneously when using the Berlekamp-Massey algorithm with inverses. 
     According to the present invention, desirable features of Euclid&#39;s algorithm and the Berlekamp-Massey algorithm are utilized to reduce the complexity of a VLSI implementation of the decoding algorithm and to reduce the processing time required for decoding. More particularly, the present invention utilizes an iteration process similar to that of Euclid&#39;s algorithm. According to the present invention, field element inversion computations are eliminated as well. According to the present invention, the error evaluator polynomial is computed simultaneously with the error locator polynomial. Further simplifying computation, polynomial swaps are avoided. Thus, the decoding algorithm of the present invention is substantially easier to implement in a VLSI design, as compared to contemporary algorithms such as Euclid&#39;s algorithm and the Berlekamp-Massey algorithm. 
     The method for correcting errors in Reed-Solomon encoded data of the present invention can be practiced using either a general purpose computer or dedicated circuits, e.g., a VLSI implementation. As used herein, the term dedicated circuit refers to a circuit which facilitates Reed-Solomon decoding and which is not used in general purpose computing. 
     These, as well as other advantages of the present invention will be more apparent from the following description and drawings. It is understood that changes in the specific structure shown and described may be made within the scope of the claims without departing from the spirit of the invention. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is an overall block diagram of a pipeline ( 255 ,  223 ) Reed-Solomon domain decoder according to the present invention; 
     FIG. 2 is a systolic array for computing the modified Berlekamp-Massey algorithm according to the present invention; 
     FIG. 3 is a block diagram of a Chien search unit according to the present invention; and 
     FIG. 4 is a block diagram of the iteration circuit and the polynomial calculation circuit according to a VLSI implementation of the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     The detailed description set forth below in connection with the appended drawings is intended as a description of the presently preferred embodiment of the invention, and is not intended to represent the only form in which the present invention may be constructed or utilized. The detailed description sets forth the functions of the invention, as well as the sequence of steps for constructing and operating the invention in connection with the illustrated embodiment. It is to be understood, however, that the same or equivalent functions may be accomplished by different embodiments that are also intended to be encompassed within the spirit and scope of the invention. 
     The present invention comprises a decoding method for correcting errors which occur in Reed-Solomon (RS) encoded data by using a modified, i.e., inversionless, Berlekamp-Massey algorithm. The modified Berlekamp-Massey algorithm of the present invention provides a method which is readily incorporated into a VLSI design and which is comparatively fast as compared to contemporary Reed-Solomon decoding algorithms. According to the present invention, the error locator polynomial and the error evaluator polynomial are obtained simultaneously. As a consequence, the decoder can be made more modular, simpler, and is suitable for both VLSI and software implementation. An exemplary software simulation result and an example illustrating the pipeline and systolic array aspects of this decoder structure is given for a ( 225 , 223 ) Reed-Solomon code. 
     According to the present invention, the modified Berlekamp-Massey algorithm is improved such that it finds the error locator polynomial and the error evaluator polynomial simultaneously. In other words, the error locator polynomial and the error evaluator polynomial are computed directly by using the modified Berlekamp-Massey algorithm with no inverses. Thus, according to the present invention, the computation of inverse field elements is completely avoided in Berlekamp&#39;s key equation. 
     The modified Berlekamp-Massey algorithm is used to reduce the hardware complexity for the time domain decoder of Reed-Solomon codes of the present invention. As a consequence, an efficient VLSI implementation of time domain Reed-Solomon decoder is provided. 
     Time Domain Decoder for Reed-Solomon Codes 
     The algorithm for decoding Reed-Solomon encoded data according to the present invention is provided below. As discussed above, this algorithm avoids the need to perform inverses (as required by contemporary decoding algorithms). According to the present invention, the error evaluator polynomial and the error locator polynomial are computed simultaneously. This simplification of the decoding process makes the algorithm of the present invention suited for implementation in very large scale integrated circuit (VLSI) design. 
     The conventional decoder methodology is now explained in more detail. Let n be the block length of an (n, k) RS code in GF(2 m ), where k is the number of m-bit message symbols. Also, let d be the minimum distance of the code, where d−1 denotes the number of parity symbols. Thus, k=n−(d−1). Finally, let the code vector be  c =(c 0 ,c 1 ,c 2  . . . ,c n−1 ). Also, let the error vector be  e =(e 0 ,e 1 ,e 2  . . . , e n−1 ). The received vector at the input of the RS decoder is r=c+e=(r 0 , r 1 ,r 2  . . . , r n−1 ). Suppose that  v  errors occur in the received vector  r  and assume that 2v≦d−1. Then, the maximum number of errors in RS codes which can be corrected is 
     
       
         t=└(d−1)/2┘  (1) 
       
     
     where └x┘ denotes the greatest integer less than or equal to  x . 
     It is well known that the syndromes are defined by                S   k     =         ∑     i   =   0       n   -   1              r   i          α   ik         =           ∑     i   =   0       n   -   1              e   i          α   ik         +       ∑     i   =   0       n   -   1              c   i          α   ik                   for                 1         ≤   k   ≤     d   -   1                 (   2   )                                
     where  α  is a primitive element in GF( 2 m)and S k , is known for 1≦k≦d−1. But c 0 +c 1 α k +c 2 α 2k  . . . +c n−1 α (n−1)k =0, for 1≦k≦d−1. Then, (2) becomes                S   k     =         ∑     i   =   1     v            Y   i          X   i   k                   for                 1       ≤   k   ≤     d   -   1               (   3   )                                
     where X i  and Y i  are the  i   th  error amplitude and the  i   th  error location, respectively. 
     Define the syndrome polynomial as                S        (   x   )       =       ∑     k   =   1       d   -   1              S   k            x   k     .                 (   4   )                                
     A substitution of (3) into (4) yields                S        (   x   )       =         ∑     k   =   1       d   -   1              (       ∑     i   =   1     v            Y   i          X   i   k         )          x   k         =       ∑     i   =   1     v              Y   i          (       ∑     k   =   1       d   -   1              (       X   i        x     )     k       )       .                 (   5   )                                
     But            ∑     k   =   1       d   -   1              (       X   i        x     )     k       =             X   i        x     +       (       X   i        x     )     d         1   +       X   i        x         .                            
     Thus (5) becomes                S        (   x   )       =         ∑     i   =   1     v            Y   i                X   i        x     +       (       X   i        x     )     d         1   +       X   i        x             ≡       ∑     i   =   1     v            Y   i              X   i        x       1   -       X   i        x                       mod                     x   d     .                   (   6   )                                
     Now, let the error locator polynomial be defined by                σ        (   x   )       =         ∏     j   =   1     v          (     1   +       X   j        x       )       =       ∑     j   =   0     v            σ   j          x   j                   (   7   )                                
     where σ(x) is the polynomial with zeros at the inverse error locations with σ 0 =1 and deg{σ(x)}= ν . Finally, let the error evaluator polynomial be defined by                P        (   x   )       =       ∑     i   =   1     v            Y   i          X   i        x          ∏     l   ≠   i            (     1   +       X   l        x       )                   (   8   )                                
     where deg{P(x)}= ν  and P(O)=0. Hence (6) becomes                S        (   x   )       ≡         P        (   x   )         σ        (   x   )                       mod                     x   d     .               (   9   )                                
     Thus, by (9), Berlekamp&#39;s key equation is given by 
     
       
         (1+S(x))σ(x)≡Ω(x) mod x d   (10) 
       
     
     where Ω(x)=σ(x)+P(x) with Ω(0)=1 and deg{Ω(x)}= ν . 
     Thus, the error evaluator polynomial is given by 
     
       
         P(x)≡Ω(x)+σ(x).  (11) 
       
     
     It is well known that the Berlekamp-Massey algorithm can be used to find σ(x) and Ω(x) in (10). For a given these known polynomials, the error evaluator polynomial can be obtained by (11). Note that P(X i   −1 )=Ω(X i   −1 )+σ(X i   −1 )=Ω(X i   −1 ), where X i   −1  is the reciprocal root of σ(x) for 1≦i≦ν. 
     The following algorithm is the iterative procedure developed by Berlekamp and Massey to find σ(x) and Ω(x) that satisfies (10). 
     1. Initially define C (0) (x)=1, D (0)  (x)=1, A (0) (x)=1, B (0) (x)=0, l (0) =1 and k=0. 
     2. Set k=k+1 if S k  is unknown stop. Otherwise define                  Δ   k     =       ∑     j   =   0       l     (     k   -   1     )                c   j     (     k   -   1     )            s     k   -   j                             and                 let             (   12   )                   C     (   k   )            (   x   )       =         D     (     k   -   1     )            (   x   )       -       Δ     (   k   )                B     (     k   -   1     )            (   x   )       ·   x                 (   13   )                   D     (   k   )            (   x   )       =         D     (     k   -   1     )            (   x   )       -       Δ     (   k   )                B     (     k   -   1     )            (   x   )       ·   x                 (   14   )                   A     (   k   )            (   x   )       =     {             x   ·       A     (     k   -   1     )            (   x   )         ,       if                   Δ     (   k   )         =       0                 or                 if                 2        l     (     k   -   1     )         &gt;     k   -   1                           C     (     k   -   1     )            (   x   )       /     Δ     (   k   )         ,       if                   Δ     (   k   )         ≠     0                 and                 2        l     (     k   -   1     )         ≤     k   -   1                               (   15   )                           (   16   )                     B     (   k   )            (   x   )       =     {               x   ·       B     (     k   -   1     )            (   x   )         ,       if                   Δ     (   k   )         =       0                 or                 if                 2        l     (     k   -   1     )         &gt;     k   -   1                           D     (     k   -   1     )            (   x   )       /     Δ     (   k   )         ,       if                   Δ     (   k   )         ≠     0                 and                 2        l     (     k   -   1     )         ≤     k   -   1                             and                   (   17   )                           (   18   )                       l     (   k   )            (   x   )       =     {             l     (     k   -   1     )       ,             if                   Δ     (   k   )         =   0           or                 if             2        l     (     k   -   1     )         &gt;     k   -   1                   k   -       l     (     k   -   1     )            (   x   )         ,             if                   Δ     (   k   )         ≠   0         and           2        l     (     k   -   1     )         ≤     k   -   1                           (   19   )                           (   20   )                                    
     3. Return to step 2. 
     In this iterative procedure, 
     
       
         σ(x)=C (d−1) (x)  (21) 
       
     
     and 
     
       
         Ω(x)=D (d−1) (x).  (22) 
       
     
     The errors are located by finding the reciprocal root of the polynomial σ(x) in (21). These roots are usually found by a Chien-search procedure. Note that in (16) and (18) there are only two places in the algorithm where the inversion of the element Δ (k)  is required. It is well known that inversion takes many operations or special hardware. The modified Berlekamp Massey algorithm is developed for finding the error locator polynomial and the error evaluator polynomial that satisfies (10). The following algorithm is the modified Berlekamp-Massey algorithm which eliminates the requirement for inversion. 
     1. Initially define {overscore (C)} (0) (x)=1, {overscore (D)} (0) (x)=1, {overscore (A)} (0) (x)=1, {overscore (B)} (0) (x)=0, {overscore (l)} (0) =0, γ (k) =1 if k≦0. 
     2. Set k=k+1 if k=d−1, stop. Otherwise, define                    Δ   _       (   k   )       =       ∑     j   =   0         l   _       (     k   -   1     )                  c   _     j     (     k   -   1     )            s     k   -   j                             and                 let             (   23   )                     C   _       (   k   )            (   x   )       =         γ     (     k   -   1     )                C   _       (     k   -   1     )            (   x   )         -         Δ   _       (   k   )                  A   _       (     k   -   1     )            (   x   )       ·   x                 (   24   )                     D   _       (   k   )            (   x   )       =         γ     (     k   -   1     )                D   _       (     k   -   1     )            (   x   )         -         Δ   _       (   k   )                  B   _       (     k   -   1     )            (   x   )       ·   x                 (   25   )                     A   _       (   k   )            (   x   )       =     {             x   ·         A   _       (     k   -   1     )            (   x   )         ,             if                     Δ   _       (   k   )         =   0           or                 if             2          l   _       (     k   -   1     )         &gt;     k   -   1                       C   _       (     k   -   1     )            (   x   )       ,             if                     Δ   _       (   k   )         ≠   0         and           2          l   _       (     k   -   1     )         ≤     k   -   1                           (   26   )                           (   27   )                         B   _       (   k   )            (   x   )       =     {             x   ·         B   _       (     k   -   1     )            (   x   )         ,             if                     Δ   _       (   k   )         =   0           or                 if             2          l   _       (     k   -   1     )         &gt;     k   -   1                       D   _       (     k   -   1     )            (   x   )       ,             if                     Δ   _       (   k   )         ≠   0         and           2          l   _       (     k   -   1     )         ≤     k   -   1                           (   28   )                           (   29   )                         l   _       (   k   )            (   x   )       =     {               l   _       (     k   -   1     )       ,             if                     Δ   _       (   k   )         =   0           or                 if             2          l   _       (     k   -   1     )         &gt;     k   -   1                   k   -         l   _       (     k   -   1     )            (   x   )         ,             if                     Δ   _       (   k   )         ≠   0         and           2          l   _       (     k   -   1     )         ≤     k   -   1                           (   30   )                           (   31   )                     γ     (   k   )       =     {             γ     (     k   -   1     )       ,             if                     Δ   _       (   k   )         =   0           or                 if             2          l   _       (     k   -   1     )         &gt;     k   -   1                     Δ   _       (   k   )       ,             if                     Δ   _       (   k   )         ≠   0         and           2          l   _       (     k   -   1     )         ≤     k   -   1                           (   32   )                           (   33   )                                    
     3. Return to step 2. 
     The following theorem illustrates the principal relations of these two algorithms. 
     Theorem 1. For 0≦n≦d−1,                    C   _       (   n   )            (   x   )       =       ∏     i   =     -   1         n   -   1              γ     (   i   )              C     (   n   )            (   x   )                   (   34   )                     D   _       (   n   )            (   x   )       =       ∏     i   =     -   1         n   -   1              γ     (   i   )              D     (   n   )            (   x   )                   (   35   )                     A   _       (   n   )            (   x   )       =       γ     (   n   )              A     (   n   )            (   x   )                 (   36   )                       B   _       (   n   )            (   x   )       =       γ     (   n   )              A     (   n   )            (   x   )                         and           (   37   )                   l   _       (   n   )       =     l     (   n   )               (   38   )                                
     where C (k) (x), D (k) (x), A (k) (x), B (k) (x) and l (k)  are defined in (13)-(20), for n=k. 
     Proof. Theorem 1 can be proved by induction. By definition, the relations in (34)-(38) hold for n=0. Assume (34)-(38) hold for n=k−1. For n=k, a substitution of (34) for n=k−1 into (23) yields                        Δ   _     k     =       ∑     j   =   0         l   _       (     k   -   1     )                (       ∏     i   =     -   1         k   -   2              γ     (   i   )            c     (     k   -   1     )           )          s     k   -   j                       =         ∏     i   =     -   1         k   -   2              γ     (   i   )              ∑     j   =   0         l   _       (     k   -   1     )                c   j     (     k   -   1     )            s     k   -   j               =       ∏     i   =     -   1         k   -   2              γ     (   i   )            Δ     (   k   )                           (   39   )                                
     where γ (i) =1 for i=0 or −1. A substitution of (34) for n=k−1, (36) for n=k−1 and (39) into (24) yields                          C   _       (   k   )            (   x   )       =                    γ     (     k   -   1     )            (       ∏     i   =     -   1         k   -   2              γ     (   i   )              C     (     k   -   1     )            (   x   )           )       -       (       ∏     i   =     -   1         k   -   2              γ     (   i   )            Δ     (   k   )           )     ·                                  (       γ     (     k   -   1     )              A     (     k   -   1     )            (   x   )         )        x                 =                  γ     (     k   -   1     )              ∏     i   =     -   1         k   -   2              γ     (   i   )            (         C     (     k   -   1     )            (   x   )       -       Δ     (   k   )              A     (     k   -   1     )            (   x   )          x       )                         (   40   )                                
     By (13), (40) becomes                    C   _       (   k   )            (   x   )       =         γ     (     k   -   1     )              ∏     i   =     -   1         k   -   2              γ     (   i   )              C     (   k   )            (   x   )             =       ∏     i   =     -   1         k   -   1              γ     (   i   )              C     (   k   )            (   x   )                     (   41   )                                
     Thus, (34) is proved. 
     Using a technique similar to that used for derivation of (39), once can derive (35). 
     Note by (39) that {overscore (Δ)} (k) =0 if Δ (k) =0 and {overscore (Δ)} (k) ≠0 if Δ (k) ≠0 because γ (i) ≠0 for −1&lt;i≦k−2. Hence, if {overscore (Δ)} (k) =Δ (k) =0 or if 2{overscore (l)} (k−1) =2l (k−1) &gt;k−1, then, by (26) and (36) for n=k−1, one has 
     
       
           {overscore (A)}   (k) ( x )= x·{overscore (A)}   (k−1) ( x )= x ·γ (k−1)   A   (k−1) ( x ).  (42) 
       
     
     But γ (k) =γ (k−1)  in (32) and A (k) (x)=x·A (k−1) (x) in (15). Thus, (42) becomes A (k) (x)=γ (k)  A (k) (x). If {overscore (Δ)} (k) =Δ (k) ≠0 and 2{overscore (l)} (k−1) =2l (k−1) ≦k−1, then, by (27), (34) for n=k−1 and (39), one has                          A   _       (   k   )            (   x   )       =           C   _       (     k   -   1     )            (   x   )       =       ∏     i   =     -   1         k   -   2              γ     (   i   )              C     (     k   -   1     )            (   x   )                         =         (         Δ   _       (   k   )         Δ     (   k   )         )            C     (     k   -   1     )            (   x   )         =         Δ   _       (   k   )            (         C     (     k   -   1     )            (   x   )         Δ     (   k   )         )                       (   43   )                                
     But, by (16) and (33), (43) becomes {overscore (A)} (k) (x)=γ (k)  A (k) (x). Thus (36) is proved. Using a technique similar to that used for derivation of (36), one can derived (37). If {overscore (Δ)} (k) =Δ (k) =0 or if 2{overscore (l)} (k−1) &gt;k−1, then {overscore (l)} (k) ={overscore (l)} (k−1) =l (k−1) =l (k) . If {overscore (Δ)} (k) =Δ (k) ≠0 or if 2{overscore (l)} (k−1) =2l (k−1) ≦k−1, then {overscore (l)} (k) =k−{overscore (l)} (k−1) =k−l (k−1) =l (k) . Thus, (38) is proved. Hence, the theorem is proved. 
     From (38) and (35), the modified error locator polynomial and error evaluator polynomial are given by.                    C   _       (     d   -   1     )            (   x   )       =       β   ·       C     (     d   -   1     )            (   x   )         =       β   ·     σ        (   x   )         =     (       βσ   0     ,     βσ   1     ,     …βσ     d   -   1         )                 (   44   )             and                                 D   _       (     d   -   1     )            (   x   )       =       β   ·       D     (     d   -   1     )            (   x   )         =       β   ·     Ω        (   x   )         =     (       β   ·     Ω   0       ,     β   ·     Ω   1       ,     …β   ·     Ω     d   -   1           )                         where           (   45   )               β   =         ∏     i   =     -   1         d   -   2                       γ     (   i   )         =           C   _       (     d   -   1     )            (   0   )       =         D   _       (     d   -   1     )            (   0   )                   (   46   )                                
     is a field element in GF(2 m ). 
     Therefore, by (44) and (45), the error locator polynomial and the error evaluator polynomial are obtained by                σ        (   x   )       =           C   _       (     d   -   1     )            (   x   )       β             (   47   )             and                           P        (   x   )       =         Ω        (   x   )       -     σ        (   x   )         =             D   _       (     d   -   1     )            (   x   )       β     -       σ        (   x   )       .                 (   48   )                                
     The errors are located by finding the reciprocal root of the polynomialσ(x) in (47) or {overscore (C)} (d−1) (x) in (44). The Forney algorithm can be used to find the error magnitudes from P(x) given in (8). This algorithm is illustrated as follows: 
     By [14], evaluating (8) and (11) at X j   −1  yields                P        (     X   j     -   1       )       =       Ω        (     X   j     -   1       )       =       Y   j            ∏     l   ≠   j                         (     1   -       X   l          X   j     -   1           )     .                   (   49   )                                
     By (47) and (49), the error magnitudes are given by                Y   j     =         Ω        (     X   j     -   1       )           ∏     l   ≠   j                       (     1   -       X   l          X   j     -   1           )         =         Ω        (     X   j     -   1       )           X   j     -   1              σ   1          (     X   j     -   1       )           =           D   _       (     d   -   1     )            (     X   j     -   1       )           X   j     -   1                C   _         (     d   -   1     )        ′            (     X   j     -   1       )                       (   50   )             where                             σ   ′          (     X   j     -   1       )       =       X   j            ∏     l   ≠   j            (     1   -       X   l          X   j     -   1           )                               and                               C   _         (     d   -   1     )        ′            (     X   j     -   1       )       =     β   ·       σ   ′          (     X   j     -   1       )                                                  
     are the derivative with respect to  x  of σ(x) given in(7) and {overscore (C)} (d−1) ′(x) given in (44) evaluated at  x =X j   −1 , respectively. 
     Let us recapitulate the decoding of RS codes for errors using the modified Berlekamp-Massey algorithm which eliminates the requirement for inversion. This procedures is composed of the following four steps: 
     Step 1. If ν&gt;t, the best policy is not to decode the message. Otherwise, compute the syndrome values S 1 ,S 2 , . . . S d−1  from (2). If S k =0 for 1≦k≦d−1, the received word is a codeword and no further processing is needed. 
     Step 2. Use an inversionless Berlekamp-Massey algorithm to determine the modified error locator polynomial β·σ(x) and the modified error evaluator polynomial β·Ω(x) from the known S k  for 1≦k≦d−1. 
     Step 3. Compute the roots of β·σ(x) using the Chien search. The roots of β·σ(x) are the inverse locations of the  ν  errors. 
     Step 4. Compute the error values from (50). 
     To illustrate the time domain decoder for correcting errors a (15,9) Reed-Solomon triple-error correcting code over GF(2 4 ) is now presented, The representation of the filed GF(2 4 ) generated by the primitive irreducible polynomial p(x)=x 4 +x+1 is given in Table 1 as follows: 
     
       
         
               
             
               
               
               
             
           
               
                 TABLE 1 
               
             
             
               
                   
               
               
                 Representations of the elements of GF (2 4 ) 
               
               
                 generated by α 4  + α + 1 = 0 
               
             
          
           
               
                 Zero and 
                   
                   
               
               
                 Power s of α 
                 Polynomials over GF (2 4 ) 
                 vectors over GF (2 4 ) 
               
               
                   
               
               
                 0 
                 0 
                 0000 
               
               
                 α 0   
                 1 
                 0001 
               
               
                 α 1   
                 α 
                 0010 
               
               
                 α 2   
                 α 2   
                 0100 
               
               
                 α 3   
                 α 3   
                 1000 
               
               
                 α 4   
                 α + 1 
                 0011 
               
               
                 α 5   
                 α 2  + α 
                 0110 
               
               
                 α 6   
                 α 3  + α 2   
                 1100 
               
               
                 α 7   
                 α 3  + α + 1 
                 1011 
               
               
                 α 8   
                 α 2  + 1 
                 0101 
               
               
                 α 9   
                 α 3  + α 
                 1010 
               
               
                 α 10   
                 α 2  + α + 1 
                 0111 
               
               
                 α 11   
                 α 3  + α 2  + α 
                 1110 
               
               
                 α 12   
                 α 3  + α 2  + α + 1 
                 1111 
               
               
                 α 13   
                 α 3  + α 2  + 1 
                 1101 
               
               
                 α 14   
                 α 3  + 1 
                 1001 
               
               
                   
               
             
          
         
       
     
     For example, consider a (15,9) Reed-Solomon code over GF (2 4 ) with a minimum distance d=7 In this code,  ν  errors under the condition 2 ν ≦6 can be corrected. Thus, the generator polynomial of such a (15,9) Reed-Solomon code is defined by          g        (   x   )       =         ∏     i   =   1     6                     (     x   -     α   i       )       =       x   6     +       α   10          x   5       +       α   14          x   4       +       α   4          x   3       +       α   6          x   2       +       α   9        x     +       α   6     .                                
     Assume the message symbols are all zeros. The encoded code word, which is a multiple of g(x), is C(x)=0. Written as a vector, the code word is  c =(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) Assume the error vector is  e =(0,0,α 11 ,0,0,α 5 ,0,α,0,0,0,0,0,0,0). Thus, the received vector is r=c+e. By (2), the syndromes S k  for  r  are          S   k     =         ∑     n   =   0     14            r   n          α   nk         =             α   11          (     α   2     )       k     +         α   5          (     α   5     )       k     +         α        (     α   7     )       k                   for                 1       ≤   k   ≤   6.                              
     This yields S 1 =α 12 ,S 2 =1, S 3 =α 14 ,S 4 =α 13 , S 5 =1 and S 6 =α 11  Thus, the syndrome polynomial is 
     
       
           S ( x )=α 12   x+x   2 +α 14   x   3 +α 13   x   4   +x   5 +α 11   x   6 .  (51) 
       
     
     In this example, by (1), the maximum error correcting capability is t=└(d−1)/2┘=6/2=3. 
     The modified Berlekamp-Massey algorithm is applied next to S( x ) given in (51). By this means, the modified error locator polynomial and the modified error evaluator polynomial are determined by a use of the modified Berlekamp-Massey algorithm. These are accomplished by the recursive formula (24) and (25), given in Table 2 . From Table 2, one can observe that the computation terminates at k=6 and the modified error locator polynomial {overscore (C)} (6) (x) is obtained. 
     That is, 
     
       
           {overscore (C)}   (6) ( x )=α 5 +α 4   x+αx   2 +α 4   x   3   (52) 
       
     
     where deg{{overscore (C)} (6) (x)}=3 and β={overscore (C)} (6) (0)=α 5 . 
     By (47), the error locator polynomial is σ(x)={overscore (C)} (6) (x)/β=1+α 14 x+α 11 x 2 +α 14 x 3 . By the derivative with respect to  x  of in (52), one obtains 
     
       
           {overscore (C)}   (6) ′( x )=α 4 +α 4   x   2 .  (53) 
       
     
     Using the Chien search, the root of {overscore (C)} (6) (x) constitute the set {α −2 ,α −5 ,α −7 }. Also from Table 2, the modified error evaluate polynomial is obtained. That is, 
     
       
           {overscore (D)}   6 ( x )=(α 5 +α 10   x+α   5   x   2 +α 11   x   3 ).  (54) 
       
     
     Thus, by (50), the error values are          Y   1     =             D   _       (   6   )            (     α     -   2       )           α     -   2                C   _         (   6   )        ′            (     α     -   2       )           =           α   5     +       α   10          (     α     -   2       )       +         α   5          (     α     -   2       )       2     +         α   11          (     α     -   2       )       3           α     -   2            (       α   4     +         α   4          (     α     -   2       )       2       )         =     α   11                 Similarly   ,                one                 obtains               Y   2     =             D   _       (   6   )            (     α     -   5       )           α     -   5                C   _         (   6   )        ′            (     α     -   5       )           =           α   5     +       α   10          (     α     -   5       )       +         α   5          (     α     -   5       )       2     +         α   11          (     α     -   5       )       3           α     -   5            (       α   4     +         α   4          (     α     -   5       )       2       )         =     α   5               and           Y   3     =             D   _       (   6   )            (     α     -   7       )           α     -   7                C   _         (   6   )        ′            (     α     -   7       )           =           α   5     +       α   10          (     α     -   7       )       +         α   5          (     α     -   7       )       2     +         α   11          (     α     -   7       )       3           α     -   7            (       α   4     +         α   4          (     α     -   7       )       2       )         =   α                              
     Table 2 below is an example of the modified Berlekamp-Massey algorithm used to find the modified polynomials βxσ(x) and βxΩ(x). 
     
       
         
               
               
               
               
               
               
               
               
             
           
               
                   
               
               
                 k 
                 {overscore (Δ)} (k)   
                 {overscore (C)} (k) (x) 
                 {overscore (A)} (k) (x) 
                 {overscore (D)} (k) (x) 
                 {overscore (B)} (k) (x) 
                 γ (k)   
                 {overscore (l)} (k)   
               
               
                   
               
             
             
               
                 0 
                 0 
                 {overscore (C)} (0) (χ) = 1 
                 {overscore (A)} (0) (x) = 1 
                 {overscore (D)} (0) (x) = 1 
                 {overscore (B)} (0) (x) = 0 
                 γ (0)  = 1 
                 {overscore (l)} (0)  = 0 
               
               
                   
               
               
                   
               
               
                 1 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     
                                       
                                         
                                           t 
                                           _ 
                                         
                                         
                                           ( 
                                           0 
                                           ) 
                                         
                                       
                                       = 
                                       0 
                                     
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       j 
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       
                                         1 
                                         - 
                                         j 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     0 
                                     
                                       ( 
                                       0 
                                       ) 
                                     
                                   
                                    
                                   
                                     S 
                                     1 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   12 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       1 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           C 
                                           _ 
                                         
                                         
                                           ( 
                                           0 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           0 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   1 
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   2 
                                    
                                   
                                     
                                       l 
                                       _ 
                                     
                                     
                                       ( 
                                       0 
                                       ) 
                                     
                                   
                                 
                                  
                                 
                                     
                                 
                                 = 
                                 
                                   k 
                                   - 
                                   1 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     
                                       A 
                                       _ 
                                     
                                     
                                       ( 
                                       1 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                  
                                 
                                     
                                 
                                 = 
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       0 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                     
                                 
                                  
                                 
                                   = 
                                   1 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       1 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     χ 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         0 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           D 
                                           _ 
                                         
                                         
                                           ( 
                                           0 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         χ 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           B 
                                           _ 
                                         
                                         
                                           ( 
                                           0 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   1 
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     0 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 1 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               B 
                               _ 
                             
                             
                               ( 
                               1 
                               ) 
                             
                           
                            
                           
                             ( 
                             x 
                             ) 
                           
                         
                         = 
                         
                           
                             
                               
                                 D 
                                 _ 
                               
                               
                                 ( 
                                 0 
                                 ) 
                               
                             
                              
                             
                               ( 
                               x 
                               ) 
                             
                           
                           = 
                         
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   γ 
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   12 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   k 
                                   - 
                                   
                                     
                                       l 
                                       _ 
                                     
                                     
                                       ( 
                                       0 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 1 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
               
               
                   
               
               
                   
               
               
                 2 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     2 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     
                                       
                                         
                                           t 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                       = 
                                       1 
                                     
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       j 
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       
                                         2 
                                         - 
                                         j 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       0 
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       2 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       1 
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       1 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     1 
                                     · 
                                     1 
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                       α 
                                       12 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   7 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           C 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         1 
                                         + 
                                         
                                           
                                             α 
                                             12 
                                           
                                            
                                           x 
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       7 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     1 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     12 
                                   
                                   + 
                                   x 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     2 
                                      
                                     
                                       
                                         l 
                                         _ 
                                       
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                   
                                    
                                   
                                       
                                   
                                   &gt; 
                                   
                                     k 
                                     - 
                                     1 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       
                                         A 
                                         _ 
                                       
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                    
                                   
                                       
                                   
                                   = 
                                   
                                     x 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                       
                                   
                                    
                                   
                                     = 
                                     
                                       
                                         x 
                                          
                                         
                                             
                                         
                                         · 
                                         
                                             
                                         
                                          
                                         1 
                                       
                                        
                                       
                                           
                                       
                                       = 
                                       x 
                                     
                                   
                                 
                               
                             
                           
                            
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           D 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           B 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     1 
                                   
                                   + 
                                   
                                     
                                       α 
                                       7 
                                     
                                      
                                     
                                         
                                     
                                     · 
                                     1 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     12 
                                   
                                   + 
                                   
                                     
                                       α 
                                       7 
                                     
                                      
                                     
                                         
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   x 
                                    
                                   
                                     
                                       
                                         B 
                                         _ 
                                       
                                       
                                         ( 
                                         1 
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   x 
                                    
                                   
                                       
                                   
                                   · 
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 x 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   γ 
                                   
                                     ( 
                                     2 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   γ 
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   12 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     2 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 1 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
               
               
                   
               
               
                   
               
               
                 3 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     3 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     
                                       
                                         
                                           t 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                       = 
                                       1 
                                     
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       j 
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       
                                         3 
                                         - 
                                         j 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       0 
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       3 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       1 
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                       α 
                                       14 
                                     
                                   
                                   + 
                                   
                                     1 
                                     · 
                                     1 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   12 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       3 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           C 
                                           _ 
                                         
                                         
                                           ( 
                                           2 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           2 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           12 
                                         
                                         + 
                                         x 
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     9 
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   2 
                                    
                                   
                                     
                                       l 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                 
                                  
                                 
                                     
                                 
                                 = 
                                 
                                   k 
                                   - 
                                   1 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     
                                       A 
                                       _ 
                                     
                                     
                                       ( 
                                       3 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                  
                                 
                                     
                                 
                                 = 
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                     
                                 
                                  
                                 
                                   = 
                                   
                                     
                                       α 
                                       12 
                                     
                                     + 
                                     x 
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       3 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         2 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           D 
                                           _ 
                                         
                                         
                                           ( 
                                           2 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           
                                             B 
                                             _ 
                                           
                                           
                                             ( 
                                             2 
                                             ) 
                                           
                                         
                                         ( 
                                         x 
                                         ) 
                                       
                                        
                                       
                                           
                                       
                                       · 
                                       
                                           
                                       
                                        
                                       x 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           12 
                                         
                                          
                                         
                                             
                                         
                                         + 
                                         
                                           
                                             α 
                                             7 
                                           
                                            
                                           
                                               
                                           
                                            
                                           x 
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     9 
                                   
                                   + 
                                   
                                     
                                       α 
                                       4 
                                     
                                      
                                     
                                         
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       ( 
                                       3 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     12 
                                   
                                   + 
                                   
                                     
                                       α 
                                       7 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   γ 
                                   
                                     ( 
                                     3 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     3 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   12 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     3 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   k 
                                   - 
                                   
                                     
                                       l 
                                       _ 
                                     
                                     
                                       ( 
                                       2 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 2 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
               
               
                   
               
               
                   
               
               
                 4 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     4 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     
                                       
                                         
                                           t 
                                           _ 
                                         
                                         
                                           ( 
                                           1 
                                           ) 
                                         
                                       
                                       = 
                                       2 
                                     
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       j 
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       
                                         4 
                                         - 
                                         j 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       0 
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       4 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       1 
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       3 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       2 
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       9 
                                     
                                     · 
                                     
                                       α 
                                       13 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                       α 
                                       14 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     1 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   9 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           C 
                                           _ 
                                         
                                         
                                           ( 
                                           3 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           3 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           9 
                                         
                                         + 
                                         
                                           
                                             α 
                                             12 
                                           
                                            
                                           x 
                                         
                                         + 
                                         
                                           
                                             α 
                                             12 
                                           
                                            
                                           
                                               
                                           
                                            
                                           
                                             x 
                                             2 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                       
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         α 
                                         9 
                                       
                                       · 
                                       
                                           
                                       
                                        
                                       
                                         ( 
                                         
                                           
                                             α 
                                             12 
                                           
                                           + 
                                           x 
                                         
                                         ) 
                                       
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     6 
                                   
                                   + 
                                   
                                     
                                       α 
                                       5 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     2 
                                      
                                     
                                       
                                         l 
                                         _ 
                                       
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                   
                                    
                                   
                                       
                                   
                                   &gt; 
                                   
                                     k 
                                     - 
                                     1 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       
                                         A 
                                         _ 
                                       
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                    
                                   
                                       
                                   
                                   = 
                                   
                                     χ 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           3 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                       
                                   
                                    
                                   
                                     = 
                                     
                                       
                                         x 
                                          
                                         
                                           ( 
                                           
                                             
                                               α 
                                               12 
                                             
                                             + 
                                             x 
                                           
                                           ) 
                                         
                                       
                                        
                                       
                                           
                                       
                                       = 
                                       
                                         
                                           
                                             α 
                                             12 
                                           
                                            
                                           x 
                                         
                                         + 
                                         
                                           x 
                                           2 
                                         
                                       
                                     
                                   
                                 
                               
                             
                           
                            
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           D 
                                           _ 
                                         
                                         
                                           ( 
                                           3 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           B 
                                           _ 
                                         
                                         
                                           ( 
                                           3 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           9 
                                         
                                         + 
                                         
                                           
                                             α 
                                             4 
                                           
                                            
                                           x 
                                         
                                         + 
                                         
                                           
                                             α 
                                             12 
                                           
                                            
                                           
                                               
                                           
                                            
                                           
                                             x 
                                             2 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                       
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       α 
                                       9 
                                     
                                      
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           12 
                                         
                                         + 
                                         
                                           
                                             α 
                                             7 
                                           
                                            
                                           x 
                                         
                                       
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     6 
                                   
                                   + 
                                   
                                     
                                       α 
                                       11 
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       3 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   x 
                                    
                                   
                                     
                                       
                                         B 
                                         _ 
                                       
                                       
                                         ( 
                                         3 
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       7 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   γ 
                                   
                                     ( 
                                     4 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   γ 
                                   
                                     ( 
                                     3 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   12 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     2 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     1 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 1 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
               
               
                   
               
               
                   
               
               
                 5 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     5 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     
                                       
                                         
                                           t 
                                           _ 
                                         
                                         
                                           ( 
                                           4 
                                           ) 
                                         
                                       
                                       = 
                                       2 
                                     
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       j 
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       
                                         5 
                                         - 
                                         j 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       0 
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       5 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       1 
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       4 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       2 
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       3 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       6 
                                     
                                     · 
                                     1 
                                   
                                   + 
                                   
                                     
                                       α 
                                       5 
                                     
                                     · 
                                     
                                       α 
                                       13 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   2 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       5 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           C 
                                           _ 
                                         
                                         
                                           ( 
                                           4 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           4 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           6 
                                         
                                         + 
                                         
                                           
                                             α 
                                             5 
                                           
                                            
                                           x 
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                       
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         α 
                                         2 
                                       
                                       · 
                                       
                                           
                                       
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               α 
                                               12 
                                             
                                              
                                             x 
                                           
                                           + 
                                           
                                             x 
                                             2 
                                           
                                         
                                         ) 
                                       
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     3 
                                   
                                   + 
                                   
                                     
                                       α 
                                       2 
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       14 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       2 
                                     
                                      
                                     
                                       x 
                                       1 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   2 
                                    
                                   
                                     
                                       l 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                 
                                  
                                 
                                     
                                 
                                 = 
                                 
                                   k 
                                   - 
                                   1 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     
                                       A 
                                       _ 
                                     
                                     
                                       ( 
                                       5 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                  
                                 
                                     
                                 
                                 = 
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                     
                                 
                                  
                                 
                                   = 
                                   
                                     
                                       α 
                                       6 
                                     
                                     + 
                                     
                                       
                                         α 
                                         5 
                                       
                                        
                                       x 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       5 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         4 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           D 
                                           _ 
                                         
                                         
                                           ( 
                                           4 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           B 
                                           _ 
                                         
                                         
                                           ( 
                                           4 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       12 
                                     
                                      
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           α 
                                           6 
                                         
                                         + 
                                         
                                           
                                             α 
                                             11 
                                           
                                            
                                           x 
                                         
                                         + 
                                         
                                           
                                             α 
                                             3 
                                           
                                            
                                           
                                               
                                           
                                            
                                           
                                             x 
                                             2 
                                           
                                         
                                       
                                       ) 
                                     
                                   
                                   + 
                                   
                                       
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       α 
                                       2 
                                     
                                      
                                     
                                         
                                     
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             α 
                                             12 
                                           
                                            
                                           x 
                                         
                                         + 
                                         
                                           
                                             α 
                                             7 
                                           
                                            
                                           
                                             x 
                                             2 
                                           
                                         
                                       
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     3 
                                   
                                   + 
                                   
                                     
                                       α 
                                       8 
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       3 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       9 
                                     
                                      
                                     
                                       x 
                                       3 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       ( 
                                       5 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     6 
                                   
                                   + 
                                   
                                     
                                       α 
                                       11 
                                     
                                      
                                     
                                         
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       3 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   γ 
                                   
                                     ( 
                                     5 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     5 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   2 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     5 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   k 
                                   - 
                                   
                                     
                                       l 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 3 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
               
               
                   
               
               
                   
               
               
                 6 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     Δ 
                                     _ 
                                   
                                   
                                     ( 
                                     6 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     ∑ 
                                     
                                       j 
                                       = 
                                       0 
                                     
                                     
                                       
                                         
                                           t 
                                           _ 
                                         
                                         
                                           ( 
                                           5 
                                           ) 
                                         
                                       
                                       = 
                                       3 
                                     
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       j 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       
                                         6 
                                         - 
                                         j 
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       0 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       6 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       1 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       5 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       2 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       4 
                                     
                                   
                                   + 
                                   
                                     
                                       
                                         C 
                                         _ 
                                       
                                       2 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       S 
                                       4 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       3 
                                     
                                     · 
                                     
                                       α 
                                       11 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       2 
                                     
                                     · 
                                     1 
                                   
                                   + 
                                   
                                     
                                       α 
                                       14 
                                     
                                     · 
                                     
                                       α 
                                       11 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       2 
                                     
                                     · 
                                     
                                       α 
                                       14 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 0 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       C 
                                       _ 
                                     
                                     
                                       ( 
                                       6 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           C 
                                           _ 
                                         
                                         
                                           ( 
                                           5 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         6 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           5 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   ( 
                                   
                                     
                                       α 
                                       3 
                                     
                                     + 
                                     
                                       
                                         α 
                                         2 
                                       
                                        
                                       x 
                                     
                                     + 
                                     
                                       
                                         α 
                                         14 
                                       
                                        
                                       
                                         x 
                                         2 
                                       
                                     
                                     + 
                                     
                                         
                                     
                                      
                                     
                                         
                                     
                                      
                                     
                                       
                                         α 
                                         2 
                                       
                                        
                                       
                                         
                                           x 
                                           3 
                                         
                                          
                                         
                                             
                                         
                                         · 
                                         
                                           α 
                                           2 
                                         
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     5 
                                   
                                   + 
                                   
                                     
                                       α 
                                       4 
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     αx 
                                     2 
                                   
                                   + 
                                   
                                     
                                       α 
                                       4 
                                     
                                      
                                     
                                       x 
                                       3 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     2 
                                      
                                     
                                       
                                         l 
                                         _ 
                                       
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                   
                                    
                                   
                                       
                                   
                                   &gt; 
                                   
                                     k 
                                     - 
                                     1 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     
                                       
                                         A 
                                         _ 
                                       
                                       
                                         ( 
                                         6 
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                    
                                   
                                       
                                   
                                   = 
                                   
                                     χ 
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     
                                       
                                         
                                           A 
                                           _ 
                                         
                                         
                                           ( 
                                           5 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                       
                                   
                                    
                                   
                                     = 
                                     
                                       
                                         
                                           α 
                                           6 
                                         
                                          
                                         x 
                                       
                                       + 
                                       
                                         
                                           α 
                                           5 
                                         
                                          
                                         
                                           x 
                                           2 
                                         
                                       
                                     
                                   
                                 
                               
                             
                           
                            
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       D 
                                       _ 
                                     
                                     
                                       ( 
                                       6 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     
                                       γ 
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           D 
                                           _ 
                                         
                                         
                                           ( 
                                           5 
                                           ) 
                                         
                                       
                                        
                                       
                                         ( 
                                         x 
                                         ) 
                                       
                                     
                                   
                                   - 
                                   
                                     
                                       
                                         Δ 
                                         _ 
                                       
                                       
                                         ( 
                                         6 
                                         ) 
                                       
                                     
                                      
                                     
                                       
                                         
                                           B 
                                           _ 
                                         
                                         
                                           ( 
                                           5 
                                           ) 
                                         
                                       
                                       ( 
                                       x 
                                       ) 
                                     
                                      
                                     x 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     2 
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         α 
                                         3 
                                       
                                       + 
                                       
                                         
                                           α 
                                           8 
                                         
                                          
                                         x 
                                       
                                       + 
                                       
                                         
                                           α 
                                           3 
                                         
                                          
                                         
                                             
                                         
                                          
                                         
                                           x 
                                           2 
                                         
                                       
                                       + 
                                       
                                           
                                       
                                        
                                       
                                           
                                       
                                        
                                       
                                         
                                           α 
                                           9 
                                         
                                          
                                         
                                           x 
                                           3 
                                         
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     α 
                                     5 
                                   
                                   + 
                                   
                                     
                                       α 
                                       10 
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       5 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       11 
                                     
                                      
                                     
                                       x 
                                       3 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       ( 
                                       4 
                                       ) 
                                     
                                   
                                    
                                   
                                     ( 
                                     x 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   x 
                                    
                                   
                                     
                                       
                                         B 
                                         _ 
                                       
                                       
                                         ( 
                                         5 
                                         ) 
                                       
                                     
                                      
                                     
                                       ( 
                                       x 
                                       ) 
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   
                                     
                                       α 
                                       6 
                                     
                                      
                                     
                                         
                                     
                                     · 
                                     
                                         
                                     
                                      
                                     x 
                                   
                                   + 
                                   
                                     
                                       α 
                                       11 
                                     
                                      
                                     
                                         
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                   + 
                                   
                                     
                                       α 
                                       3 
                                     
                                      
                                     
                                       x 
                                       2 
                                     
                                   
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   γ 
                                   
                                     ( 
                                     6 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   γ 
                                   
                                     ( 
                                     5 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 
                                   α 
                                   2 
                                 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     6 
                                     ) 
                                   
                                 
                                 = 
                                 
                                   
                                     l 
                                     _ 
                                   
                                   
                                     ( 
                                     5 
                                     ) 
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 = 
                                 3 
                               
                             
                           
                         
                          
                       
                     
                             
                     
                         
                     
                   
                 
               
               
                   
               
             
          
         
       
     
     Program Implementation and Simulation Results 
     The new Reed-Solomon decoding procedure described in the previous section has been verified using a C++ program. The program is implemented to correct ν errors for general (n, k) Reed-Solomon codes, where n is of the form n=2 m −1, 1≦k≦n−1, and 0≦ν≦└(n−k)/2┘. The error patterns are randomly generated over the positions and magnitudes. An example of simulation results for a ( 255 , 223 ) Reed-Solomon code correcting ν errors, where ν≦16, is given in Table 3. For each ν, the computation times are in second, which is averaged from the computations of correcting 100 different error patterns. The computation times tend to decrease when the number of errors occurred decrease. This is because of the quantity {overscore (Δ)} (k)  in Eqs. (24)-(33) is zero. 
     
       
         
               
             
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
             
           
               
                 TABLE 3 
               
               
                   
               
               
                 New decoding method for (255, 223) RS code. Each entry is the time in second needed 
               
               
                 for one block computation, which is averaged from 100 computations. 
               
               
                   
               
             
             
               
                   
               
             
          
           
               
                 error 
                 0 
                 1 
                 2 
                 3 
                 4 
                 5 
                 6 
                 7 
                 8 
                 9 
                 10 
                 11 
                 12 
                 13 
                 14 
                 15 
                 16 
               
               
                 time 
                 0.17 
                 0.18 
                 0.19 
                 0.20 
                 0.20 
                 0.22 
                 0.23 
                 0.24 
                 0.26 
                 0.28 
                 0.30 
                 0.32 
                 0.34 
                 0.37 
                 0.40 
                 0.43 
                 0.46 
               
               
                   
               
             
          
         
       
     
     A VLSI Design of the Time Domain Reed-Solomon Decoder 
     Referring now to FIG. 1, the block diagram of a ( 255 , 223 ) Reed-Solomon time domain decoder is shown. The major functional units in this decoder are the syndrome computation unit  12 , the modified Berlekamp-Massey algorithm unit  14 , the polynomial evaluation unit  16 , and the Chien search unit  18 . Also, included is a delay register  10 , which facilitates synchronization of the decoded message output. 
     The syndrome computation unit  12  accepts the received sequence of received messages r 0 ,r 1 , . . . , r 254  and computes their syndromes. 
     The sequence of syndromes S 32 , . . . , S 2 ,S 1  is shifted serially to the modified Berlekamp-Massey algorithm unit  14 . The output of this unit is the modified error locator polynomial {overscore (C)} (16) (x)=β·σ(x) and the modified error evaluator polynomial {overscore (D)} (16) (x)=β·Ω(x), where β={overscore (C)} (16) (0). The processing of these polynomials is performed by the Chien search unit  18  and the polynomila evaluation unit  16 , as discussed below. 
     Referring now to FIG. 2, the VLSI implementation of this modified Berlekamp-Massey algorithm of the present invention is shown. The only input is the sequence of syndromes S 32 , . . .S 2 ,S 1 . The maximum order of either polynomial {overscore (C)}(x) or {overscore (D)}(x) is t=32/2=16. Thus, one needs only t+1=17 sub-registers to store syndromes for calculating {overscore (Δ)} (k) . A register  30  comprises sub-registers F 0 ,F 1 , . . . ,F 16 . That is, F=(F 0 ,F 1 , . . . , F 16 ). Similarly, the registers {overscore (C)}=({overscore (C)} 0 ,{overscore (C)} 1 , . . . ,{overscore (C)} 16 ) and {overscore (D)}=({overscore (D)} 0 ,{overscore (D)} 1 , . . . ,{overscore (D)} 16 ) are used to store the coefficients of {overscore (C)}( x ) and {overscore (D)}( x ) given in (24) and (25), respectively. Also, C=(C 0 ,C 1 , . . . ,C 16 ) and D=(D 0 ,D 1 , . . . ,D 16 ) are the temporary storage of register C and D, respectively. The register {overscore (A)}=({overscore (A)} 0 , {overscore (A)} 1 , . . . ,{overscore (A)} 16 ) and {overscore (B)}=({overscore (B)} 0 ,{overscore (B)} 1 , . . . ,{overscore (B)} 16 ) are used to store the coefficients of {overscore (A)}( x ) and {overscore (B)}( x ) given in (28) and (29), respectively. The registers γ and L are used to store the values of γ and {overscore (l)} respectively. Also, there is a decision circuit which generates a control signal δ to control the switches, and a count K is used to store the updated value of k. The outputs are two sequences out of the contents of registers {overscore (C)} and {overscore (D)} following the operations of this structure. The operations of this VLSI structure are described below. 
     At the initial state, all switches are at position  1 . Assume initially in registers that F=0, C=0, D=0, {overscore (C)}=1, {overscore (D)}=1, {overscore (A)}=1 and {overscore (B)}=0. Also, assume the contents in registers γ, L and K are 1, 0 and 0 respectively. During k th  iteration, the contents of counter K is increased by one. Next, the new syndrome is shifted into sub-register F l  and simultaneously the contents in sub-registers F i  are shifted right into subsequent sub-registers F i+l  for i=0,1,2, . . . ,15 so that the contents of register F will be timed properly for multiplication with the contents of register {overscore (C)} for generating Δ (k) . Simultaneously, the contents of registers C and D are loaded into {overscore (C)} and {overscore (D)} registers, respectively. Then, the upper logic is activated to compute {overscore (Δ)} (k)  given in (23) and simultaneously registers {overscore (A)} and {overscore (B)} are shifted right by one position to perform x·{overscore (A)} (k−1) ( x ) and x·{overscore (B)} (k−1) ( x ) respectively. From the known {overscore (Δ)} (k) , x·{overscore (A)} (k−1)  and x·{overscore (B)} (k−1) ,the lower logic is activated to compute {overscore (C)} (k) ( x ) and {overscore (D)} (k) ( x ) signal stored in registers C and D, respectively. At the same time, the controls signal δ is calculated. If Δ (l) =0 or 2{overscore (l)} (k−1) &gt;k−1, i.e., δ=0, switches are still remain at position  1 . Thus, γ (k)  and {overscore (l)} (k)  in (32) and (38) can be realized and the new updated data of γ (k)  and {overscore (l)} (k) ,i.e., γ (k) =γ (k−1)  and {overscore (l)} (k) ={overscore (l)} (k−1)  are stored in registers γ and L, respectively. If Δ (k) ≠0 and 2{overscore (l)} (k−1) ≦k−1, i.e. δ=1, one moves switches to position  2  so that one replaces the contents of registers {overscore (A)} and {overscore (B)} by the contents of registers {overscore (C)} and {overscore (D)}, respectively. Also, the contents of registers γ and L are replaced by Δ (k)  and k−{overscore (l)} (k−1) , respectively. Then, the same procedure is received repeatedly. This sequence of operations stops when the content of register K equals d−1=32. Finally, the modified error location polynomial and the modified error evaluation polynomial stored in registers {overscore (C)} and {overscore (D)}, respectively are obtained. 
     The register transfer language (RTL) of this inverse-free Berlekamp-Massey algorithm is described as follows: 
     T 0 : F←0, C←0, D←0, {overscore (C)}←1, {overscore (D)}←1, {overscore (A)}←1, B←0,γ←1, L←0, K←0 and all switches are at position  1 . 
     T 1 : k←k+1 if k&gt;d−1=32 stop. Otherwise, F 0 ←S 0  and simultaneously F i+l ←F i  for i=1,2, . . . , 15, {overscore (C)}←C={overscore (C)} (k−1) ( x ) and {overscore (D)}←D={overscore (D)} (K−1) ( x )                T   2     :     Compute                     Δ   _       (   k   )           =       ∑     i   =   0         l   _       (   k   )                  c   _     j     (     k   -   1     )            S     k   -   j             ,       A   _     ←       x   ·       A   _       (     k   -   1     )                                      and                   B   _       ←     x   ·       B   _       (     k   -   1     )                                               
     T 3 : C←{overscore (C)} (k) (x)=γ (k−1) {overscore (C)}−{overscore (Δ)} (k) {overscore (A)}, and D←{overscore (B)} (k) (x)=γ (k−1) {overscore (B)}−Δ (k) {overscore (D)} 
     T 4 : If δ=0, go to T 1 . Otherwise, move all switches to position  2  so that {overscore (A)}←{overscore (C)}=C (k−1) (x), {overscore (B)}←{overscore (D)}=D (k−1) ( x ), γ←{overscore (Δ)} (k)  and L←k−{overscore (l)} (k−1) . Then, move all switch to position  1  and go to T 1 . 
     One output of the modified Berlekamp-Massey algorithm unit, the modified error locator polynomial {overscore (C)} 16  (x)=β·σ(x) is sent to a Chien search unit for generating a binary sequence of error locations and computing a sequence of β·σ′(α −255 )·α −255  , . . . , β·σ′(α −1 )·α −1  simultaneously. In the Chien search method, by [2],one has                      C   _     16          (     α     -   i       )       =       β   ·     σ        (     α     -   i       )         =         ∑     j   =   0     16            β   ·     σ   j            α     -   ij           =       ∑     j   =   0     16            β   ·     σ   j            α       -     (     i   -   1     )          j            α     -   j                                   for                 1     ≤   i   ≤   255             (   54   )                                
     By (54), if one multiplies the j th  term of β·σ(α −(i−l) ) by α j  for 0≦j≦16, then one obtains the corresponding term of β·σ(α −i ). Thus, one only needs a constant multiplier and a register for computing each term of β·σ(α −(i−l) ). In order to facilitate the implementation of the Forney algorithm, β·σ(α −i ) in (54) can be separated into the odd and even terms. That is, 
     
       
           {overscore (C)}   (16) (α −i )=β·σ(α −i )=Δ e (α −i )+Δ 0 (α −i ) for 1≦j≦255  (55) 
       
     
     where                  Δ   e          (     α     -   i       )       =       ∑       j   =   0     ,   2   ,   …     16            β   ·     σ   j            α       -     (     i   -   1     )          j            α     -   j                   (   56   )                                
     is the summation of even coefficients and                  Δ   0          (     α     -   i       )       =       ∑       j   =   1     ,   3   ,   …     16            β   ·     σ   j            α       -     (     i   -   1     )          j            α     -   j                   (   57   )                                
     is the summation of odd coefficients. 
     The summation of odd coefficients of β·σ(α −i ), i.e., Δ 0 (α −i ) in (57) is equal to β·σ(α −i )α −j . That is, 
     
       
         Δ 0 (α −i )=β·σ′(α −i )α −i ={overscore (C)} (16)′ (α −i )α −i  for 1≦i≦255  
       
     
     Referring you to FIG. 3, the architecture of the Chien search method unit is shown. As shown, the odd and even number terms are summed separately. The architecture of this unit is similar to that of a contemporary Chien search unit, except there are only 17 error locator sub-cells in this ( 255 , 223 ) Reed-Solomon decoder and a zero detector at the end. The zero detector is converted the sequence {overscore (C)} (16) (α −i )&#39;s into a sequence of 1&#39;s and 0&#39;s , where 1 and 0 indicate the occurrence, i.e., {overscore (C)} (16) (α −l )=β·σ(α −l )=0, or nonoccurrence, i.e., {overscore (C)} 0   (16) (α −l )=β·σ(α −l )≠0, respectively, of and error at a specific inverse location. α −l . 
     The other output of the modified Berlekamnp-Massey algorithm unit, a sequence of the modified error evaluator polynomial β·Ω(x) is sent to the polynomial evaluation unit to perform the evaluation of β·Ω(x). The output of the polynomial evaluation unit β·Ω(α −i )&#39;s and one output of the Chien search unit, a sequence of β·σ′(α −255 )α −255 , . . . ,β·σ′(α −1 )α −1 ,are shifted to a finite field divider for computing the sequence of Ω(α −255 )/α −255  ·σ′(α −255 ), . . . , Ω(α −1 )/α −1 ·σ′(α −1 ). The product of the Ω(α −i )/α −i ·σ′(α −i )&#39;s and the other output of the Chien search unit, the binary sequence of error locations forms the sequence of the estimated error patterns, i.e., e 0 , e 1 , . . . ,e 254 . Finally, the estimated code vector is obtained by subtracting the error vector e from the received vector r. 
     Refering now to FIG. 4, a very large scale integrated circuit (VLSI) implementation of the present invention is shown. The VLSI implementation comprises an integrated circuit  40  comprising an iteration circuit  42  which performs iteration according to the modified Berlekamp-Massey algorithm of the present invention and a polynomial calculator circuit  44  which defines the modified error locator polynomial according to equation 44 and also defines a modified error evaluator polynomial according to equation 45. 
     It is understood that the exemplary algorithm described herein and shown in the drawings represents only a presently preferred embodiment of the invention. Indeed, various modifications and additions may be made to such embodiment without departing from the spirit and scope of the invention. For example, those skilled in the art will appreciate that the algorithm of the present invention is applicable to Reed-Solomon codes having various different sizes. Thus, the description herein of a ( 225 , 223 ) Reed-Solomon code is by way of illustration only, and not by way of limitation. Further, those skilled in the art will appreciate that various different VLSI implementations of the present invention are contemplated. Thus, these and other modifications and additions may be obvious to those skilled in the art and may be implemented to adapt the present invention for use in a variety of different applications. 
     The following is a C++ program listing of the computer simulation of the algorithm for decoding Reed-Solomon encoded data according to the present invention. 
     
       
         
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
               
             
               
               
               
             
               
               
             
               
               
               
             
               
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
             
           
               
                   
               
             
             
               
                 //------------------------------------------------------------------------- 
               
               
                 #include &lt;stdio.h&gt; 
               
               
                 #include &lt;stdlib.h&gt; 
               
               
                 #include &lt;string.h&gt; 
               
               
                 #include &lt;iostream.h&gt; 
               
               
                 #include &lt;math.h&gt; 
               
               
                 #include &lt;time.h&gt; 
               
               
                 #define N  256    // array size, use 16 to save time when possible 
               
               
                 #define delimit “--------------------------------------------------------”&lt;&lt;endI 
               
               
                 #defineDELIMIT“===============================================================”&lt;&lt;endI 
               
               
                 //======================================================================== 
               
               
                 // GF class 
               
               
                 //======================================================================== 
               
               
                 class GF 
               
               
                 { 
               
               
                 public: 
               
               
                 int power; 
               
               
                 int symbol; 
               
               
                 GF(void); 
               
               
                 GF(int pwr, int sym); 
               
               
                 ˜GF(void); 
               
               
                 GF operator+(const GF &amp; b) const; 
               
               
                 GF operator*(const GF &amp; b) const; 
               
               
                 GF inv(void) const; 
               
               
                 bool operator==(const GF &amp;b) const; 
               
               
                 bool operator!=(const GF &amp;b) const; 
               
               
                 }; 
               
               
                 //======================================================================== 
               
               
                 // POLY class 
               
               
                 //======================================================================== 
               
               
                 class POLY 
               
               
                 { 
               
               
                 public: 
               
               
                 GF c[N]; 
               
               
                 POLY(void); 
               
               
                 ˜POLY(void); 
               
               
                 int deg(void) const; 
               
               
                 POLY operator*(const GF &amp; b) const; 
               
               
                 POLY operator+(const POLY &amp; q) const; 
               
               
                 POLY operator*(const POLY &amp; q) const; 
               
               
                 //POLY operator/(const POLY &amp; q) const; 
               
               
                 POLY operator&lt;&lt;(const int &amp; j) const; 
               
               
                 POLY operator&gt;&gt;(const int &amp; j) const; 
               
               
                 bool operator==(const POLY &amp; q) const; 
               
               
                 POLY lshift(void) const; 
               
               
                 POLY rshift(void) const; 
               
               
                 POLY diff(void) const; 
               
               
                 POLY mod(const int &amp; a) const; 
               
               
                 GF eval(const GF &amp; x) const; 
               
               
                 void disp(char* title); 
               
               
                 }; 
               
               
                 //======================================================================== 
               
               
                 // global variables 
               
               
                 //======================================================================== 
               
               
                 void init(void); 
               
               
                 void gen_GF(void); 
               
               
                 void dump(void); 
               
               
                 void gen_errata(void); 
               
               
                 void Forney_syndromes(void); 
               
               
                 void syndromes(void); 
               
               
                 void Chien(const POLY &amp; p, int * npt, GF *rtpt); 
               
               
                 void s_if_BM_e(void); // simplified if_BM_e 
               
               
                 void POLYdivide(const POLY &amp; p,const POLY &amp; q,POLY &amp; quotient,POLY &amp; remainder); 
               
               
                 POLY pdtmoda(const POLY &amp; p,const POLY &amp; q); 
               
               
                 POLY pdtmod(const POLY &amp; p,const POLY &amp; q,const int a); 
               
               
                 void report(void); 
               
               
                 inline double random01( ) {return (double)random(32767)/32767.;} 
               
               
                 int n,k,d;  // n,k command line parameters, d=n−k+1 
               
               
                 int m; // number of bits, defined in init( ) 
               
               
                 int Prim[65];  //2{circumflex over ( )}m, m in [0,64], max 64 bits 
               
               
                 GF GFzero,alpha[N]; 
               
               
                 int s0,t0,b0; 
               
               
                 int t,s,v; 
               
               
                 int Power_tab[N],Symbl_tab[N]; 
               
               
                 int Bits[256]; 
               
             
          
           
               
                 int cnt_s; 
                 // used as a counter for the erasure s 
               
               
                 int cnt_t; 
                 // used as a counter for image frame or t 
               
               
                 int cnt_b; 
               
               
                 int fsize; 
               
             
          
           
               
                 POLY POLYzero,POLYone; 
               
               
                 POLY g; 
               
               
                 POLY erasure,error,errata; 
               
               
                 POLY info,cw,r,eccw; 
               
               
                 POLY Lambda; // erasure locator poly 
               
               
                 POLY ers_lp; // erasure locator poly 
               
               
                 //POLY sigma; 
               
               
                 //POLY tau; 
               
               
                 POLY S; 
               
               
                 POLY T; 
               
               
                 POLY errfound; 
               
               
                 int Nor; 
               
               
                 GF Roots[N]; 
               
               
                 int Noe; 
               
               
                 GF Errloc[N]; 
               
               
                 int a; 
               
               
                 int Report_flag; 
               
               
                 clock_t ck1,ck2,CK1,CK2; 
               
               
                 clock_t ct1_alg,ct2_alg,ct_alg;  // collect the time used to compute elp and eep 
               
             
          
           
               
                 clock_t ct1_Symd,ct2_Symd,ct_Symd; 
                 // collect the time used for Symdrome 
               
               
                 clock_t ct1_Chien,ct2_Chien,ct_Chien; 
                 // collect the time used for Chien 
               
               
                 clock_t ct1_Mag,ct2_Mag,ct_Mag; 
                 // collect the time used to compute Magnitude 
               
             
          
           
               
                 clock_t ct1_ert,ct2_ert,ct_ert;  // collect the time used to compute Magnitude 
               
               
                 double SNR,q2A;  // for modulation 
               
               
                 //======================================================================== 
               
               
                 // methods for GF 
               
               
                 //======================================================================== 
               
               
                 GF::GF(void) 
               
               
                 { 
               
               
                 power=n; 
               
               
                 symbl=0; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 GF::GF(int pwr,int sym) 
               
               
                 { 
               
               
                 power=pwr; 
               
               
                 symbl=sym; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 GF::˜GF(void) 
               
               
                 { 
               
               
                 } 
               
               
                 //====================== 
               
               
                 GF GF::operator+(const GF &amp; b) const 
               
               
                 { 
               
               
                 GF sum; 
               
               
                 sum.symbl=symbl{circumflex over ( )}b.symbl; 
               
               
                 sum.power=Power_tab[sum.symbl]; 
               
               
                 return sum; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 GF GF::operator*(const GF &amp; b) const 
               
               
                 { 
               
               
                 GF pdt; 
               
               
                 if(symbl==0 || b.symbl==0) return GFzero; 
               
               
                 pdt.power=(power+b.power) % n; 
               
               
                 pdt.symbl=Symbl_tab[pdt.power]; 
               
               
                 return pdt; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 bool GF::operator==(const GF &amp; b) const 
               
               
                 { 
               
               
                 if (power==b.power &amp;&amp; symbl==b.symbl) return true; 
               
               
                 else return false; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 bool GF::operator!=(const GF &amp; b) const 
               
               
                 { 
               
               
                 if (power!=b.power || symbl!=b.symbl) return true; 
               
               
                 else return false; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 GF GF::inv(void) const 
               
               
                 { 
               
               
                 ///if(symbl==0) {cout&lt;&lt;“Inversion of GFzero!!!”;} 
               
               
                 if(power==0) return alpha[0]; else return alpha[n-power]; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // methods for POLY 
               
               
                 //======================================================================== 
               
               
                 POLY::POLY(void) 
               
               
                 { 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;n;i++) c[i]=GFzero; 
               
               
                 } 
               
               
                 //===================== 
               
               
                 POLY::˜POLY(void) 
               
               
                 { 
               
               
                 } 
               
               
                 //===================== 
               
               
                 int POLY::deg(void) const 
               
               
                 { 
               
               
                 int i,deg; 
               
               
                 deg=n−1; 
               
               
                 for(i=0;i&lt;n;i++) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 if(c[i].symbl==0) deg−−; else break; 
               
               
                   
                 } 
               
             
          
           
               
                 return deg; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::operator+(const POLY &amp; q) const 
               
               
                 { 
               
               
                 int i; 
               
               
                 POLY tmp; 
               
               
                 for(i=0;i&lt;n;i++) tmp.c[i]=c[i]+q.c[i]; 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::operator*(const POLY &amp; q) const 
               
               
                 { 
               
               
                 POLY tmp,sum; 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;n;i++) tmp.c[n−1−i]=c[n−1−i]; 
               
               
                 for(i=0;i&lt;=q.deg( );i++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 sum=sum+tmp*q.c[(n−1)−i]; 
               
               
                   
                 tmp=tmp.lshift( ); 
               
               
                   
                 } 
               
             
          
           
               
                 return sum; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::operator*(const GF &amp; b) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;=deg( );i++) tmp.c[n−1−i]=c[n−1−i]*b; 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 bool POLY::operator==(const POLY &amp; q) const 
               
               
                 { 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;n;i++) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 if(c[i]==q.c[i]) continue; 
               
             
          
           
               
                   
                 else return false; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 return true; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::operator&lt;&lt;(const int &amp; j) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;n−j;i++) tmp.c[i]=c[i+j]; // the reset components are FGzero????? 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::operator&gt;&gt;(const int &amp; j) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;n−j;i++) tmp.c[n−1−i]=c[n−1−(i+j)]; // the reset components are FGzero 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::lshift( ) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 for(i=0;i&lt;n−1;i++) tmp.c[i]=c[i+1]; 
               
               
                 tmp.c[n−1]=c[0]; 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::rshift( ) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 tmp.c[0]=c[n−1]; 
               
               
                 for(i=1;i&lt;n;i++) tmp.c[i]=c[i−1]; 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::diff(void) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 for(i=n−1;i&gt;=0;i=i−2) tmp.c[i]=GFzero; 
               
               
                 for(i=n−2;i&gt;=0;i=i−2) tmp.c[i]=c[i]; 
               
               
                 tmp=tmp.rshift( ); 
               
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 POLY POLY::mod(const int &amp; a) const 
               
               
                 { 
               
               
                 POLY tmp; 
               
               
                 int i; 
               
               
                 tmp; 
               
               
                 for(i=0;i&lt;a;i++) tmp.c[n−1−i]=c[n−1−i]; 
               
               
                 //for(i=0;i&lt;n;i++) 
               
             
          
           
               
                 // 
                 { 
               
               
                 // 
                 j=(n−1)−((n−1−i) % a); 
               
               
                 // 
                 tmp.c[j]=tmp.c[j]+c[i]; 
               
               
                 // 
                 } 
               
             
          
           
               
                 return tmp; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 GF POLY::eval(const GF &amp; x) const 
               
               
                 { 
               
               
                 int i; 
               
               
                 GF sum; 
               
               
                 sum=c[n−1−deg( )]; 
               
               
                 for(i=deg( )−1;i&gt;=0;i−−) sum=sum*x+c[n−1−i]; 
               
               
                 return sum; 
               
               
                 } 
               
               
                 //====================== 
               
               
                 void POLY::disp(char* title) 
               
               
                 { 
               
               
                 int i; 
               
               
                 if(n&gt;15) return; 
               
               
                 cout.width(9);cout &lt;&lt; title; 
               
               
                 cout&lt;&lt;“:(”; 
               
               
                 for(i=0;i&lt;n−1;i++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 if(c[i].power==n) cout&lt;&lt;“−−”; 
               
               
                   
                 else 
               
             
          
           
               
                   
                 { 
               
               
                   
                 cout.width(2); 
               
               
                   
                 cout &lt;&lt; c[i].power; 
               
               
                   
                 } 
               
             
          
           
               
                   
                 cout &lt;&lt; “,”; 
               
               
                   
                 } 
               
             
          
           
               
                 if(c[i].power==n) cout&lt;&lt;“−−”; 
               
               
                 else 
               
             
          
           
               
                   
                 { 
               
               
                   
                 cout.width(2); 
               
               
                   
                 cout &lt;&lt; c[i].power; 
               
               
                   
                 } 
               
             
          
           
               
                 cout&lt;&lt;“)”&lt;&lt;endl; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // init : gen_GF, randomize? 
               
               
                 //======================================================================== 
               
               
                 void init(void) 
               
               
                 { 
               
               
                 if(n== 8−1) m=3; 
               
               
                 if(n== 16−1) m=4; 
               
               
                 if(n== 32−1) m=5; 
               
               
                 if(n== 64−1) m=6; 
               
               
                 if(n==128−1) m=7; 
               
               
                 if(n==256−1) m=8; 
               
               
                 gen_GF( ); 
               
               
                 T=POLYzero; 
               
             
          
           
               
                 //randomize( ); 
                 // seeding the random numbers 
               
             
          
           
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // generate the Galois field 
               
               
                 //======================================================================== 
               
               
                 void gen_GF( ) 
               
               
                 { 
               
               
                 int i; 
               
             
          
           
               
                 int tester; 
                 // overflow testing 
               
               
                 Prim[4]=0x13; 
                 //(  1 0011)=x{circumflex over ( )}4+x+1 
               
               
                 Prim[6]=0x43; 
                 //(  100 0011)=x{circumflex over ( )}6+x+1 
               
               
                 Prim[8]=0x11d; 
                 //(1 0001 1101)=x{circumflex over ( )}8+x{circumflex over ( )}4+x{circumflex over ( )}3+x{circumflex over ( )}2+1 
               
               
                 tester=1&lt;&lt;m; 
                 //(1 0000), for m=4, for testing if x{circumflex over ( )}4 exists 
               
             
          
           
               
                 //int sym_tab[16]={1, 2, 4, 8, 3, 6, 12,11, 5,10, 7,14,15,13, 9, 0}; 
               
               
                 int sym_tab[N]; 
               
               
                 sym_tab[0]=1; 
               
               
                 sym_tab[n]=0; 
               
             
          
           
               
                 for(i=1;i&lt;n;i++) 
                 // construct the sym table 
               
             
          
           
               
                   
                 { 
               
               
                   
                 sym_tab[i]=sym_tab[i−1]&lt;&lt;1; 
               
               
                   
                 if(sym_tab[i] &amp; tester) sym_tab[i]{circumflex over ( )}=Prim[m]; 
               
               
                   
                 } 
               
             
          
           
               
                 for(i=0;i&lt;=n;i++) Symbl_tab[i]=sym_tab[i]; 
               
               
                 for(i=0;i&lt;=n;i++) Power_tab[Symbl_tab[i]]=i; 
               
               
                 //for(i=0;i&lt;=n;i++) cout&lt;&lt;Power_tab[i]&lt;&lt;“ ”;cout&lt;&lt;endl; 
               
               
                 for(i=0;i&lt;=n;i++) alpha[i]=GF(i,Symbl_tab[i]); 
               
             
          
           
               
                 GFzero=alpha[n]; 
                 // zero in the field GF 
               
             
          
           
               
                 for(i=0;i&lt;=n;i++) POLYzero.c[i]=GFzero; // zero poly 
               
               
                 POLYone=POLYzero; POLYone.c[n−1−0]=alpha[0]; 
               
               
                 g=POLYzero; 
               
               
                 g.c[n−1]=alpha[0]; 
               
               
                 POLY tmp; 
               
               
                 tmp.c[n−2]=alpha[0]; 
               
               
                 for(i=1;i&lt;=d−1;i++) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 tmp.c[n−1]=alpha[i]; 
               
               
                   
                 g=g*tmp; 
               
               
                   
                 //g.disp(“genPOLY”); 
               
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // errata pattern generator 
               
               
                 // s, t, 
               
               
                 // erasure locator poly, 
               
               
                 // erasure, error and errata=erasure+error are generated 
               
               
                 //======================================================================== 
               
               
                 void gen_errata(void) 
               
               
                 { 
               
               
                 int i,j,loc[N],mag[N]; 
               
               
                 POLY tmp_poly; 
               
               
                 randomize( ); 
               
               
                 // random patters 
               
               
                 // random s and t 
               
               
                 if(t0==−1 &amp;&amp; s0==−1) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 s=65535;t=65536; 
               
               
                   
                 while((s+2*t)&gt;(d−1)) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 s=d*rand( )/RAND_MAX; 
               
               
                   
                 t=(d/2+1)*rand( )/RAND_MAX; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 else 
               
               
                 { 
               
             
          
           
               
                   
                 // looping s and t, random are not used 
               
               
                   
                 s=cnt_s; 
               
               
                   
                 t=cnt_t; 
               
             
          
           
               
                 } 
               
               
                 // gen the locations for errata, no repeated 
               
               
                 loc[0]=n*rand( )/RAND_MAX; // max returned is n−1 
               
               
                 for(i=1;i&lt;s+t;i++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 loc[i]=n*rand( )/RAND_MAX; 
               
               
                   
                 for(j=0;j&lt;i;j++) if(loc[j]==loc[i]) −−i; 
               
               
                   
                 } 
               
             
          
           
               
                 // erasure locator poly 
               
               
                 ers_lp=POLYzero; ers_lp.c[n−1]=alpha[0]; 
               
               
                 tmp_poly=POLYzero; 
               
               
                 for(i=0;i&lt;s;i++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 tmp_poly.c[n−1]=alpha[0]; 
               
               
                   
                 tmp_poly.c[n−1−1]=alpha[loc[i]]; 
               
               
                   
                 ers_lp=ers_lp*tmp_poly; 
               
               
                   
                 } 
               
             
          
           
               
                 Lambda=ers_lp; // tmp used erasure loc poly in if_BM_ee 
               
               
                 // generate the magnitudes for errata 
               
               
                 // BYTE-wise magnitude 
               
               
                 for(i=0;i&lt;s+t;i++) mag[i]=n*rand( )/RAND_MAX; // gen the magnitudes 
               
               
                 // BIT-wise magnitude a{circumflex over ( )}0,a{circumflex over ( )}1, . . . ,a{circumflex over ( )}7 
               
               
                 //for(i=0;i&lt;s+t;i++) mag[i]=m*rand( )/RAND_MAX; // gen the magnitudes 
               
               
                 // finally, the erasure, error and errata 
               
               
                 erasure=POLYzero; 
               
               
                 error=POLYzero; 
               
             
          
           
               
                 for(i=0;i&lt;s;i++) erasure.c[n−1−loc[i]]=alpha[mag[i]]; 
                 // the erasure 
               
               
                 for(i=s;i&lt;s+t;i++) error.c[n−1−loc[i]]=alpha[mag[i]]; 
                 // the error 
               
             
          
           
               
                 errata=erasure+error; 
               
               
                 // disp the errata pattern 
               
               
                 if(Report_flag) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 cout&lt;&lt;“erasure=”&lt;&lt;s&lt;&lt;“:”; 
               
               
                   
                 for(i=0;i&lt;s;i++) 
               
               
                   
                  cout&lt;&lt;“(“&lt;&lt;loc[i]&lt;&lt;”,“&lt;&lt;erasure.c[n−1−loc[i]].power&lt;&lt;”) ”; 
               
               
                   
                 cout&lt;&lt;endl; 
               
               
                   
                 cout&lt;&lt;“error =”&lt;&lt;t&lt;&lt;“:”; 
               
               
                   
                 for(i=s;i&lt;s+t;i++) 
               
             
          
           
               
                   
                 cout&lt;&lt;“(“&lt;&lt;loc[i]&lt;&lt;”,“&lt;&lt;error.c[n−1−loc[i]].power&lt;&lt;”) ”; 
               
             
          
           
               
                   
                 cout&lt;&lt;endl; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // compute the syndromes 
               
               
                 //======================================================================== 
               
               
                 void syndromes(void) 
               
               
                 { 
               
               
                 int j; 
               
               
                 S=POLYzero; 
               
               
                 for(j=1;j&lt;=d−1;j++) S.c[n−1−j]=r.eval(alpha[j]); 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // compute the Forney syndromes from Lambda and S 
               
               
                 //======================================================================== 
               
               
                 void Forney_syndromes(void) 
               
               
                 { 
               
               
                 ing i,j; 
               
               
                 GF sum; 
               
               
                 T=POLYzero; 
               
               
                 for(j=1;j&lt;=d−1−s;j++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 sum=GFzero; 
               
               
                   
                 for(i=0;i&lt;=s;i++) sum=sum+Lambda.c[(n−1)−i]*S.c[(n−1)−(j+s−i)]; 
               
               
                   
                 T.c[n−1−j]=sum; 
               
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // Chien&#39;s search 
               
               
                 // no GFzero roots, no repeated roots 
               
               
                 //======================================================================== 
               
               
                 void Chien(const POLY &amp; p, int *npt, GF *rtpt) 
               
               
                 { 
               
               
                 POLY ptmp,pdiv,pquot,prmnd; 
               
               
                 int i; 
               
               
                 *npt=0; 
               
               
                 Nor=0; 
               
               
                 for(i=0;i&lt;n;i++) Roots[i]=GFzero; 
               
               
                 for(i=0;i&lt;n;i++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 if(p.eval(alpha[i])==GFzero) 
               
               
                   
                 { 
               
               
                   
                 Roots[Nor++]=alpha[i]; 
               
               
                   
                 ///pdiv=POLYzero; 
               
               
                   
                 ///pdiv.c[n−1]=alpha[i]; 
               
               
                   
                 ///pdiv.c[n−2]=alpha[0]; 
               
               
                   
                 ///ptmp=p; 
               
               
                   
                 ///while(1) 
               
             
          
           
               
                   
                 ///{ 
               
             
          
           
               
                   
                 ///POLYdivide(ptmp,pdiv,pquot,prmnd); 
               
             
          
           
               
                   
                 ///if(prmnd==POLYzero &amp;&amp; pquot.eval(alpha[i])==GFzero) 
               
             
          
           
               
                   
                 /// 
                 { 
               
             
          
           
               
                   
                 /// 
                 cout&lt;&lt;“repeated roots ”&lt;&lt;endl; 
               
             
          
           
               
                   
                 /// Roots[Nor++]=alpha[i]; 
               
             
          
           
               
                   
                 /// 
                 ptmp=pquot; 
               
             
          
           
               
                   
                 /// 
                 } 
               
               
                   
                 /// 
                 else break; 
               
             
          
           
               
                   
                 ///} 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 //if(p.eval(alpha[0]).symbl==0) Roots[Nor++]=alpha[0]; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // the devision of 2 POLY, quotient and remainder are returned 
               
               
                 //======================================================================== 
               
               
                 void POLYdivide(const POLY &amp; p,const POLY &amp; q,POLY &amp; quotient,POLY &amp; remainder) 
               
               
                 { 
               
               
                 POLY tmpq; 
               
               
                 GF leadcoef; 
               
               
                 int deg,degp,degq; 
               
               
                 quotient=POLYzero; 
               
               
                 remainder=p; 
               
               
                 degp=p.deg( ); 
               
               
                 degq=q.deg( ); 
               
               
                 //cout&lt;&lt;“---dividing--------------------------------”&lt;&lt;endl; 
               
               
                 //cout&lt;&lt;“degp=”&lt;&lt;degp&lt;&lt;“ degq=”&lt;&lt;degq&lt;&lt;endl; 
               
               
                 if(degp&lt;degq) return; 
               
               
                 leadcoef=q.c[n−1−degq];  // make q monic 
               
               
                 //cout&lt;&lt;“leadcoef=”&lt;&lt;leadcoef.power&lt;&lt;endl; 
               
               
                 tmpq=q*leadcoef.inv( ); 
               
               
                 //quotient.disp(“quotient”); 
               
               
                 //remainder.disp(“remaind”); 
               
               
                 for(deg=degp−degq;deg&gt;=0;deg−−) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 // pick the leading coef as the devision since tmpq is monic 
               
               
                   
                 quotient.c[n−1−deg]=remainder.c[n−1−(deg+degq)]; 
               
               
                   
                 //((tmpq&lt;&lt;deg)*remainder.c[n−1−(deg+degq)]).disp(“shifted”); 
               
               
                   
                 remainder=remainder+(tmpq&lt;&lt;deg)*remainder.c[n−1−(deg+degq)]; 
               
               
                   
                 //quotient.disp(“quotient”); 
               
               
                   
                 //remainder.disp(“remaind”); 
               
               
                   
                 } 
               
             
          
           
               
                 quotient=quotient*leadcoef.inv( ); // Un-make the monic 
               
               
                 //(quotient*q+remainder+p).disp(“divcheck”); 
               
               
                 //cout&lt;&lt;“---divided--------------------------------”&lt;&lt;endl; 
               
               
                 return; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // the product of 2 POLY mod a 
               
               
                 //======================================================================== 
               
               
                 POLY pdtmoda(const POLY &amp; p,const POLY &amp; q) 
               
               
                 { 
               
               
                 POLY sum; 
               
               
                 int i,j; 
               
               
                 sum; 
               
               
                 for(i=0;i&lt;a;i++) 
               
             
          
           
               
                   
                 for(j=0;j&lt;a−i;j++) 
               
             
          
           
               
                   
                 sum.c[n−1−(i+j)]=sum.c[n−1−(i+j)]+p.c[n−1−i]*q.c[n−1−j]; 
               
             
          
           
               
                 return sum; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // the product of 2 POLY mod a 
               
               
                 //======================================================================== 
               
               
                 POLY pdtmod(const POLY &amp; p,const POLY &amp; q,const int a) 
               
               
                 { 
               
               
                 POLY sum; 
               
               
                 int i,j; 
               
               
                 sum=POLYzero; 
               
               
                 for(i=0;i&lt;a;i++) 
               
             
          
           
               
                   
                 for(j=0;j&lt;a−i;j++) 
               
             
          
           
               
                   
                 sum.c[n−1−(i+j)]=sum.c[n−1−(i+j)]+p.c[n−1−i]*q.c[n−1−j]; 
               
             
          
           
               
                 return sum; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // Compute the error polynominal, output is errfound 
               
               
                 // s_if_BM_e   : simplified if_BM_e, locator and evaluator are computed 
               
               
                 //          simultaneously. 
               
               
                 //======================================================================== 
               
               
                 void s_if_BM_e(void) 
               
               
                 { 
               
               
                 int i,j,kk; 
               
               
                 POLY Cb,Db,Ab,Bb; 
               
               
                 POLY Cb_1,Db_1,Ab_1,Bb_1;  // previous data 
               
               
                 POLY Cb_prime; 
               
               
                 int Lb,Lb_1; 
               
               
                 GF gammab,gammab_1; 
               
               
                 GF deltab; 
               
               
                 GF beta; 
               
               
                 POLY sigma,Omega; 
               
               
                 GF tmp,tmp_inv; 
               
               
                 POLY Y; 
               
               
                 //cout&lt;&lt;“Welcome to s_if_BM_e decoder!!!“&lt;&lt;endl; 
               
               
                 // the syndromes 
               
               
                 syndromes( ); 
               
               
                 // starting the BM 
               
               
                 ct1_alg=clock( ); 
               
               
                 //kk=0; 
               
               
                 Cb=POLYzero; Cb.c[n−1]=alpha[0]; 
               
               
                 Db=POLYzero;Db.c[n−1]=alpha[0]; 
               
               
                 Ab=POLYzero;Ab.c[n−1]=alpha[0]; 
               
               
                 Bb=POLYzero; 
               
               
                 Lb=0; 
               
               
                 gammab=alpha[0]; 
               
               
                 /* 
               
               
                 cout&lt;&lt;“k=“&lt;&lt;kk&lt;&lt;” “&lt;&lt;”deltabar=”&lt;&lt;deltab.power&lt;&lt;endl; 
               
               
                 Cb.disp(“Cbar”); 
               
               
                 Ab.disp(“Abar”); 
               
               
                 Db.disp(“Dbar”); 
               
               
                 Bb.disp(“Bbar”); 
               
               
                 cout&lt;&lt;“gammabar=“&lt;&lt;gammab.power&lt;&lt;” “&lt;&lt;“Lbar=”&lt;&lt;Lb&lt;&lt;endl&lt;&lt;endl; 
               
               
                 */ 
               
               
                 for(kk=1;kk&lt;=d−1−s;kk++) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 Ab_1=Ab; 
               
               
                   
                 Bb_1=Bb; 
               
               
                   
                 Cb_1=Cb; 
               
               
                   
                 Db_1=Db; 
               
             
          
           
               
                 Lb_1=Lb; 
               
               
                 gammab_1=gammab; 
               
             
          
           
               
                   
                 deltab=GFzero; 
               
               
                   
                 for(j=0;j&lt;=Lb_1;j++) deltab=deltab+Cb_1.c[(n−1)−j]*S.c[(n−1)−(kk−j)]; 
               
             
          
           
               
                 Cb=Cb_1*gammab+Ab_1.lshift( )*deltab; 
               
               
                 Db=Db_1*gammab+Bb_1.lshift( )*deltab; 
               
             
          
           
               
                   
                 if(deltab==GFzero || 2*Lb&gt;kk−1) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 Ab=Ab_1.lshift( ); 
               
               
                   
                 Bb=Bb_1.lshift( ); 
               
               
                   
                 Lb=Lb_1; 
               
               
                   
                 gammab=gammab_1; 
               
               
                   
                 } 
               
             
          
           
               
                   
                 else 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 Ab=Cb_1; 
               
               
                   
                 Bb=Db_1; 
               
               
                   
                 Lb=kk−Lb_1; 
               
               
                   
                 gammab=deltab; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 /* 
               
               
                 cout&lt;&lt;“k=“&lt;&lt;kk&lt;&lt;” “&lt;&lt;”deltabar=”&lt;&lt;deltab.power&lt;&lt;endl; 
               
               
                 Cb.disp(“Cbar”); 
               
               
                 Ab.disp(“Abar”); 
               
               
                 Db.disp(“Dbar”); 
               
               
                 Bb.disp(“Bbar”); 
               
               
                 cout&lt;&lt;“gammabar=“&lt;&lt;gammab.power&lt;&lt;” “&lt;&lt;”Lbar=”&lt;&lt;Lb&lt;&lt;endl; 
               
               
                 cout&lt;&lt;endl; 
               
               
                 */ 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 ct2_alg=clock( ); 
               
               
                 ct_alg+=(ct2_alg−ct1_alg); 
               
               
                 // using Chien&#39;s search to find the roots of sigma 
               
               
                 Chien(Cb,&amp;Nor,Roots); 
               
               
                 Noe=Nor; 
               
               
                 for(i=0;&lt;Noe;i++) Errloc[i]=Roots[i].inv( ); // inverse locations 
               
               
                 //cout&lt;&lt;“Chien&#39;s search : Nor=“&lt;&lt;Nor&lt;&lt;” : ”; 
               
               
                 //for(i=0;i&lt;Nor;i++) cout&lt;&lt;Errloc[i].power&lt;&lt;“ ”;cout&lt;&lt;endl; 
               
               
                 // the error values and the error polynominal Y 
               
               
                 Cb_prime=Cb.diff( ); 
               
               
                 for(i=0;i&lt;Nor;i++) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 tmp=Errloc[i]; 
               
               
                   
                 tmp_inv=Errloc[i].inv( ); 
               
               
                   
                 Y.c[n−1−tmp.power]= 
               
             
          
           
               
                   
                 Db.eval(tmp_inv)*(Cb_prime.eval(tmp_inv)*tmp_inv).inv( ); 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 errfound=Y; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // report 
               
               
                 //======================================================================== 
               
               
                 void report(void) 
               
               
                 { 
               
               
                 if(Report_flag) 
               
             
          
           
               
                   
                 { 
               
               
                   
                 info.disp(“Info”); 
               
               
                   
                 cw.disp(“Codeword”); 
               
               
                   
                 erasure.disp(“erasure”); 
               
               
                   
                 error.disp(“error”); 
               
               
                   
                 r.disp(“Received”); 
               
               
                   
                 Lambda.disp(“Lambda”); 
               
               
                   
                 S.disp(“Syndrome”); 
               
               
                   
                 T.disp(“Forney”); 
               
               
                   
                 cout&lt;&lt;endl; 
               
               
                   
                 errata.disp(“Errata”); 
               
               
                   
                 errfound.disp(“ErrFound”); 
               
               
                   
                 eccw.disp(“ErrCrrted”); 
               
               
                   
                 cout&lt;&lt;endl; 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 if((cw+eccw)==POLYzero) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 if(Report_flag) cout&lt;&lt;“Error corrected!!! ”&lt;&lt;endl; 
               
               
                   
                 } 
               
             
          
           
               
                 else 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 cout&lt;&lt;“Error NOT corrected ************************************”&lt;&lt;endl; 
               
             
          
           
               
                   
                 errata.disp(“Errata”); 
               
             
          
           
               
                   
                 S.disp(“syndrome”); 
               
               
                   
                 (cw+eccw).disp(“wrong?”); 
               
               
                   
                 } 
               
             
          
           
               
                 if(Report_flag) cout&lt;&lt;DELIMIT; 
               
               
                 } 
               
               
                 //======================================================================== 
               
               
                 // Dump some global data 
               
               
                 //======================================================================== 
               
               
                 void dump(void) 
               
               
                 { 
               
               
                 int i; 
               
               
                 GF tmp; 
               
               
                 //global parameters 
               
               
                 cout&lt;&lt;“n=“&lt;&lt;n&lt;&lt;” k=“&lt;&lt;k&lt;&lt;”  d=“&lt;&lt;d&lt;&lt;” m=”&lt;&lt;m&lt;&lt;endl; 
               
               
                 cout&lt;&lt;“Primitive”&lt;&lt;Prim[m]&lt;&lt;endl; 
               
               
                 // alpha 
               
               
                 for(i=0;i&lt;n+1;i++) cout &lt;&lt; alpha[i].power &lt;&lt; “ ” &lt;&lt;alpha[i].symbl &lt;&lt;“\n”; 
               
               
                 cout &lt;&lt; endl; 
               
               
                 //addition and multiplication table 
               
               
                 //for(j=0;j&lt;n+1;j++) 
               
             
          
           
               
                 // 
                 for(i=0;i&lt;n+1;i++) 
               
             
          
           
               
                 // 
                 { 
               
               
                 // 
                 tmp=alpha[i]+alpha[j]; 
               
               
                 // 
                 cout &lt;&lt; alpha[i].power &lt;&lt; “ + ” &lt;&lt;alpha[j].power &lt;&lt; “ = ” &lt;&lt; tmp.power &lt;&lt;“\t”; 
               
               
                 // 
                 cout &lt;&lt; alpha[i].symbl &lt;&lt; “ + ” &lt;&lt; alpha[j].symbl &lt;&lt; “ = ” &lt;&lt;tmp.symbl &lt;&lt;“\t”; 
               
               
                 // 
                 if ((i % 2) ==0) cout &lt;&lt; endl; 
               
               
                 // 
                 } 
               
             
          
           
               
                 //cout &lt;&lt;endl &lt;&lt; endl; 
               
               
                 //for(j=0;j&lt;n+1;j++) 
               
             
          
           
               
                 // 
                 for(i=0;i&lt;n+1;i++) 
               
             
          
           
               
                 // 
                 { 
               
               
                 // 
                 tmp=alpha[i]*alpha[j]; 
               
               
                 // 
                 cout &lt;&lt; alpha[i].power &lt;&lt; “ * ” &lt;&lt; alpha[j].power &lt;&lt; “ = ” &lt;&lt; tmp.power &lt;&lt;“\t”; 
               
               
                 // 
                 cout &lt;&lt; alpha[i].symbl &lt;&lt; “ * ” &lt;&lt; alpha[j].symbl &lt;&lt; “ = ” &lt;&lt; tmp.symbl &lt;&lt;“\t”; 
               
               
                 // 
                 if ((i % 2) ==0) cout &lt;&lt; endl; 
               
               
                 // 
                 } 
               
             
          
           
               
                 //cout&lt;&lt;endl; 
               
               
                 } 
               
               
                 int main(int argc, char * argv[ ]) 
               
               
                 { 
               
               
                 char method[80]; 
               
               
                 int start_s,end_s,start_t,end_t,start_b,end_b; 
               
               
                 POLY quotient,remainder; 
               
               
                 if(argc==1) 
               
             
          
           
               
                   
                 { 
               
             
          
           
               
                   
                 cout&lt;&lt;“ecc n k method  s t blocks Rpt”&lt;&lt;endl; 
               
               
                   
                 cout&lt;&lt;“ecc 255 239 s_if_BM_e 0 3 100 0”&lt;&lt;endl; 
               
               
                   
                 cout&lt;&lt;“Report_flag=0,1,2”&lt;&lt;endl&lt;&lt;endl; 
               
               
                   
                 exit(0); 
               
               
                   
                 } 
               
             
          
           
               
                 n=atoi(argv[1]); 
               
               
                 k=atoi(argv[2]); 
               
               
                 d=n−k+1; 
               
               
                 strcpy(method,argv[3]); 
               
               
                 s0=atoi(argv[4]); 
               
             
          
           
               
                   
                 start_ s=s0; end_s=s0; 
               
               
                   
                 if(s0==999) {start_s=0; end_s=d−1;}   // all 
               
             
          
           
               
                   
                 if(s0==−1) {start_s=0; end_s=0;}   // randomized 
               
             
          
           
               
                 t0=atoi(argv[5]); 
               
             
          
           
               
                   
                 start_ t=t0; end_t=t0; 
               
               
                   
                 if(t0==999) start_t=0;   // end_t=(d−1−s)/2; moved to the loops 
               
             
          
           
               
                   
                 if(t0==−1) {start_t=0; end_t=0;} 
               
             
          
           
               
                 b0=atoi(argv[6]); 
               
             
          
           
               
                   
                 start_b=1; end_b=b0; 
               
             
          
           
               
                 Report_flag=atoi(argv[7]); 
               
               
                 //======================================================================== 
               
               
                 init( ); 
               
               
                 cout&lt;&lt;DELIMIT; 
               
               
                 cout&lt;&lt;“RS(“&lt;&lt;n&lt;&lt;”,“&lt;&lt;kk&lt;&lt;”) “&lt;&lt;method&lt;&lt;” d=”&lt;&lt;d&lt;&lt;“ m=”&lt;&lt;m&lt;&lt;endl; 
               
               
                 cout&lt;&lt;DELIMIT; 
               
               
                 cout&lt;&lt;endl&lt;&lt;endl; 
               
               
                 cout&lt;&lt;“ s t Blocks GenErt Syndrm Algthm Chiens Magntd TotalT”&lt;&lt;endl; 
               
               
                 cout&lt;&lt;DELIMIT; 
               
               
                 //======================================================================== 
               
               
                 CK1=clock( );  // global timer 
               
               
                 for(cnt_s=start_s;cnt_s&lt;=end_s;cnt_s++) 
               
               
                 { 
               
               
                 if(t0==999) end_t=(d−1−cnt_s)/2; 
               
               
                 for(cnt_t=start_t;cnt_t&lt;=end_t;cnt_t++) 
               
               
                 { 
               
               
                 ck1=clock( ); 
               
               
                 for(cnt_b=start_b;cnt_b&lt;=end_b;cnt_b++) 
               
               
                 { 
               
               
                 //======================================================================== 
               
               
                 // get an info from the array image, which is from a file 
               
               
                 info=POLYzero; 
               
               
                 cw=POLYzero; 
               
               
                 POLYdivide(info,g,quotient,remainder); 
               
               
                 cw=info+remainder; 
               
               
                 //======================================================================== 
               
               
                 // add the errata pattern 
               
               
                 ct1_ert=clock( ); 
               
               
                 gen_errata( ); 
               
               
                 ct2_ert=clock( ); 
               
               
                 ct_ert+=(ct2_ert−ct1_ert); 
               
               
                 r=cw+errata; 
               
               
                 // RS decoder 
               
               
                 // output is errfound 
               
               
                 s_if_BM_e( ); 
               
               
                 // error corrected code word eccw = received + error found 
               
               
                 eccw=r+errfound; 
               
               
                 report( ); 
               
             
          
           
               
                 } 
                 // count the blocks 
               
             
          
           
               
                 ck2=clock( ); 
                 // block timing 
               
             
          
           
               
                 cout.width(3);cout&lt;&lt;s; 
               
               
                 cout.width(3);cout&lt;&lt;t; 
               
               
                 cout.width(8);cout&lt;&lt;b0; 
               
               
                 cout.width(8);cout&lt;&lt;ct_ert; 
               
               
                 cout.width(8);cout&lt;&lt;ct_Symd; 
               
               
                 cout.width(8);cout&lt;&lt;ct_alg; 
               
               
                 cout.width(8);cout&lt;&lt;ct_Chien; 
               
               
                 cout.width(8);cout&lt;&lt;ct_Mag; 
               
               
                 cout.width(8);cout&lt;&lt;(ck2−ck1)&lt;&lt;endl; 
               
               
                 ct_ert=0; 
               
               
                 ct_alg=0; 
               
               
                 ct_Symd=0; 
               
               
                 ct_Chien=0; 
               
               
                 ct_Mag=0; 
               
               
                 if(Report_flag) cout&lt;&lt;DELIMIT; 
               
             
          
           
               
                 } 
                 // count cnt_t 
               
               
                 } 
                 // count cnt_s 
               
             
          
           
               
                 CK2=clock( ); 
                 // global timing 
               
             
          
           
               
                 if(Report_flag==0) cout&lt;&lt;DELIMIT; 
               
               
                 cout&lt;&lt;“Total time=”;cout.width(5);cout&lt;&lt;(CK2−CK1)&lt;&lt;endl&lt;&lt;endl; 
               
               
                 return 0; 
               
               
                 }