The invention relates to error detection and correction and in particular to residue number systems and methods for arithmetic error detection and correction.
Error detection and correction is a well-known topic in science, mathematics and engineering. Error detection and correction is often used to detect and possibly correct errors in the storage and transmission of data. For example, Hamming codes are used to detect errors in data transmission, while parity codes are used to detect and correct bit errors in storage of data.
From the discussion that follows, it will become apparent that the present invention addresses the deficiencies associated with the prior art while providing numerous additional advantages and benefits not contemplated or possible with prior art constructions.
This disclosure introduces a new and novel approach to error detection and correction of arithmetic which uses the residue number arithmetic instead of binary arithmetic. The specific residue number system (RNS) used is a carry free number system that supports signed fixed-point arithmetic. This new version of RNS fixed-point arithmetic is disclosed in U.S. Pat. No. 9,081,608, which is incorporated herein by reference.
One area of error detection and correction not as well-known is the error detection and correction of arithmetic. Error detection and correction (EDAC) of arithmetic has some theoretical basis and has been studied in the prior art, but very few implementations are known to exist in the marketplace. The reason is that the process of arithmetic manipulates the data that is applied, and therefore the error code itself must undergo a similar or exact manipulation as well, so that the result and the error code have equivalence, i.e., they share some amount of redundancy before and after an arithmetic transformation. Thus, the redundancy of the arithmetic result and error correction code form the basis for EDAC. Such methods have not flourished in the prior art because of the complexity and limitations of prior art circuitry required to perform EDAC of binary arithmetic.
To attempt to avoid this complication, one alternative prior art approach for performing error detection and correction of arithmetic is so called “triplication” of computer systems. In a basic triplication example of
While a triplication scheme sounds simple, it is typically not trivial to implement. For example, once an error is detected, it may be necessary to reboot the computer in error and re-synchronize it with the other two. This is not trivial in real-time applications. But the main drawback of triplication is the need for three independent ALU or computer systems; this makes error detection and correction of arithmetic expensive and it increases the delay, resources and latency of the ALU, thus significantly penalizing the performance of the ALU in high-speed applications.
One prior art approach to error detection and correction of arithmetic uses the residue number system (RNS) to perform arithmetic. There are several unique properties of RNS which allow for unique opportunities to perform error detection and correction of arithmetic. For one, unlike conventional EDAC schemes such as Hamming codes or parity codes, there is no difference between a single bit error in an RNS digit or multiple bit errors in the same digit; in both cases, the RNS digit is incorrect. Therefore, in RNS based error detection and correction, it is more common to discuss “digit errors”, and the number of digits in error for any given representation.
For another, since RNS arithmetic is carry free, single bit errors in one digit do not propagate to other RNS digits. For the case of binary arithmetic, it is likely that an error in a single bit position will affect bits of other significance or position. In the case of basic RNS arithmetic, a single digit modulus in error will remain isolated since there is no transmission of information from one RNS digit modulus to another during the operations of addition, subtraction and multiplication. Therefore, there are distinct differences between binary error detection and RNS error detection, and fundamentally, RNS EDAC solutions involve the detection and correction of RNS digits in error, not singular bits.
There are other distinct differences between an EDAC solution utilizing a binary data representation versus an RNS data representation. In the case of binary Hamming codes for example, there is the concept of “distance”, called Hamming distance, which is the minimum number of errors that could have transformed one string of bits to another. Also, there is the prior art notion of Hamming weight, which is the number of 1's that transform a zero value to a data value. These notions are vital in the case of binary representation EDAC but have less meaning in RNS based EDAC systems.
For example, with RNS EDAC it is feasible to perform integer arithmetic indefinitely with one digit in error while retaining the full integrity of the arithmetic. Therefore, the concept of “error detection distance” differs significantly. In practice, there is some limit typically placed on a series of integer additions, subtractions and multiplications. After any such length of integer arithmetic operations, an EDAC cycle can be performed afterwards on the arithmetic result to detect and correct digit errors.
When fixed-point arithmetic is performed, a normalization operation is performed which allows information from one digit to affect other digits. However, the process of the arithmetic normalization is completely linear in arithmetic, and it's result is expected to be in a valid range, so that the result of fixed-point normalization may also be checked and corrected by an RNS based EDAC unit.
To summarize, with RNS arithmetic, it is possible that a lengthy series of integer arithmetic operations result in a single digit in error, but this error can be detected and even corrected. Furthermore, in RNS fixed-point arithmetic, a normalized fixed-point arithmetic result is testable by the EDAC, and if a single digit error is detected, it is can be corrected. This type of performance appears not possible or at least very difficult using binary arithmetic and represents a significant break-through in computer science and mathematics.
One of the chief advantages of RNS over binary arithmetic is the RNS representation itself may be fully redundant. In fact, it is possible to devise redundant RNS representations, called RRNS for short. In an RRNS, there are more RNS digits then necessary to represent a given data word. Because RNS is not a weighted number system, this allows the RRNS the property that any one or more digits can be ignored without affecting the value of the data represented. This provides a significant type of redundancy not present in a weighted number system, like binary. Moreover, the redundancy is “built in”, and not simply attached as a separate code, as is the case with many EDAC schemes.
Other systems, methods, features and advantages of the invention will be or will become apparent to one with skill in the art upon examination of the following figures and detailed description. It is intended that all such additional systems, methods, features and advantages be included within this description, be within the scope of the invention, and be protected by the accompanying claims.
The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention. In the figures, like reference numerals designate corresponding parts throughout the different views.
In the following description, numerous specific details are set forth in order to provide a more thorough description of the present invention. It will be apparent, however, to one skilled in the art, that the present invention may be practiced without these specific details. In other instances, well-known features have not been described in detail so as not to obscure the invention.
RNS EDAC
Theoretically, it has been shown that detection of arithmetic errors will require the use of arithmetic codes (AR-codes), or residue (remainder) codes. A prior art proof illustrates this concept. However, there are several approaches to utilizing AR codes or residue codes in the prior art. While it is not the intent to fully describe each type, it is necessary to discuss a few basic residue-based EDAC's to establish a basis for a thorough discussion of the inventions and novel methods described herein.
RNS EDAC methods of the prior art typically belong in one of two primary categories, 1) EDAC's with non-separate codes, which are further characterized as non-systematic as shown in
An example of a non-systematic RRNS EDAC system for arithmetic of positive integers is shown as a basic block diagram in
There are many other attributes of a prior art EDAC system that will be briefly mentioned. For example, the EDAC system of
The block diagram of
The block diagram of an auto-correcting ALU 510 of
Another preferred embodiment of the methods of the present invention are illustrated in the block diagram of
The ability to organize RRNS product summation as illustrated in
The RNS based hardware matrix multiplier example of
The partitioning of RRNS digits results in many advantages including fast operation since each digit matrix multiplier is synthesized using narrow, high-speed modular multipliers and accumulators. However, for the purpose of error detection and correction, the physical separation of each RRNS digit into its own matrix multiplier has significant advantages. Consider if a clocking error occurs in a single digit matrix multiplier, it may alter many dot products of a matrix product result; however, because the error remains isolated to a single RRNS digit modulus, the entire matrix product result can be recovered.
In space-based applications of AI acceleration, the impact of high-energy neutrons may adversely affect a single dot product of a single digit matrix multiplier of
Referring to
In
The significance of hardware matrix multiplication of
Theoretical Basis of EDAC in RRNS
There are numerous methods and studies of RRNS error detection and correction in the prior art. One of the major limitations in this body of work is the lack of efficient detection and correction of arithmetic errors in a signed RRNS representation. There are several reasons for this. For one, some EDAC of the prior art is based on methods that rely on a consistency check, and this definition of consistency check is partially based on concepts of binary EDAC and have not provided a general enough framework to develop a practical, fully signed RRNS EDAC solution. Another reason is likely due to incomplete efforts regarding the formal reasoning of error detection and correction of RRNS arithmetic.
The novel methods and apparatus for EDAC of the present invention are based on a new understanding of the mathematics of RRNS arithmetic processing and includes a new solution to implementation of EDAC apparatus which can seamlessly process positive and negative values represented in an RRNS. Moreover, the methods of the present invention preserve the notion that all redundant digits of an RRNS are operated upon in the same manner, and that any valid combination of RRNS digits that complete a valid range can be used to recover any data value, be it a positive value or negative value. However, in order to disclose these new methods, it is necessary to briefly review prior art understanding of redundancy and EDAC in an RRNS.
Consider the use of an RNS word Y representing a positive integer value x consisting of four digits,
x≡Y={d1,d2,d3,d4} (1)
having corresponding pair-wise prime digit moduli,
(m1,m2,m3,m4) (2)
then the RNS number system range M of the RNS word Y is given by,
M=m1*m2*m3*m4 (3)
and the total range of positive integers x that are conventionally encoded in Y is,
0≤x<M (4)
Where the range M of (n) number of non-redundant digits of Y limit the integer values that may be represented and in general is given by,
The RNS of (1) can be expanded by adding more digits. Normally, when more digits are added to the definition of Y, the range M will increase accordingly, and a larger value x may be represented according to (3); however, if we choose (by design) to limit our numeric range of x while we increase the range M by one or more digits, we define an RRNS system. For example, consider a new RRNS word Y′ which is created by adding two additional digits to Y thereby increasing the word-size to six digits,
Y′={Y,d5,d6}={d1,d2,d3,d4,d5,d6} (6)
and consider that range M is increased to M′ by adding two pair-wise prime moduli m5 and m6, each associated with digits d5 and d6 respectively,
M′=M*m5*m6=m1*m2*m3*m4*m5*m6 (7)
To further develop notation, a range function is defined to denote a range M without reference to each modulus mi of a word Y,
M=range(Y) (8)
In Y′, the digits d5 and d6 are so called redundant digits in the prior art. This means that the values for d5 and d6 must be set so that,
Y′=Y=x (9)
The redundant digits d5, d6 have additional requirements when working with error detection and correction systems. In particular, it is necessary to define redundant digits with a moduli having a larger range than any moduli (2) of the original RNS system Y (1). Therefore, the magnitude of each digit modulus is chosen such that,
m1<m2<m3<m4<m5<m6 (10)
This is an important condition since for our example we require any product of any four distinct moduli mi to be greater than or equal to M, so that,
Πmi≥M, any four distinct i (11)
To develop these notions further, it is desirable to adopt notation to indicate when a digit is invalid, or “undefined”; the notation below specifies that digit position of d5 and d6 are undefined which is shown as an asterisk with the specified digit subscript. Thus, the RRNS word with undefined digits (Y′*) could be formed by the concatenation of the RNS word Y and two undefined digits as shown in Eq. 9 and equivalently in short notation as,
Y′*={Y,*5,*6}={d1,d2,d3,d4,*5,*6} (12)
The function which sets the digit values d5 and d6 to the correct value to satisfy Equation (9) above is called a base extend (BE) function, which accepts as its input all “valid” digits of an RNS word having one or more invalid digits, and produces as output a larger RRNS word where all digits are valid. The base extend function BE( ) acts on the word size Y′, and sets the value of undefined digits d5 and d6 so that (9) is satisfied. Various notation is developed to convey the base extend operation,
Y′=BE(Y′*)=BE({Y,*5,*6})={Y,d5,d6}={d1,d2,d3,d4,d5,d6} (13)
Notice the equivalency in the expressions provided by the notation above. A more concise notation essentially performing the same function is,
Y′=BEM′(Y) range(Y)≤M′ (14)
In Equation (14) above, the notation for the BE( ) function specifies the RRNS word Y′ be assigned the value of the RNS word Y; furthermore, the BE( ) notation specifies the target number range of Y′ by use of the suffix M′. The specification of the target range is useful; it describes all moduli that must be base extended if they are undefined, such as digits d5 and d6 in our example. This notation is particularly useful for error correction since any smaller set of RNS digits can be extended into any larger size RRNS word size. The notation preserves the concept that different RNS digit sets represent different RNS number systems having different numeric ranges M.
In order to discuss error detection and correction of RRNS data in more detail, it is necessary to establish variable symbols for common RRNS metrics and relate them to established restrictions. In this disclosure, the total number of residue digits of an RRNS word Y′ is p digits, and the total number of non-redundant digits is n and the total number of redundant digits is r, so that,
Y′={d1,d2, . . . ,dn,d(n+1), . . . ,d(n+r)} (15)
m1< . . . <mn<m(n+1)< . . . <m(n+r) (16)
p=n+r (17)
where,
p=total number of residue digits of the RRNS machine word Y′
n=number of non-redundant digits in Y′
r=number of redundant digits in Y′
If we restrict error detection and correction to RNS integer values, then all redundant digits are (assumed) present to serve the function of error detection and/or correction. In this case, it is well established in the prior art that every detectable digit error of an RRNS word requires a single independent redundant digit be present in Y′. Therefore, we introduce a variable d for the maximum number of detectable errors, so that,
d=r (18)
Where,
d=maximum number of detectable digit errors in Y′
Moreover, in this disclosure the total number of correctable digits is denoted by s. It is well established in the prior art that two redundant digits are required for every digit in error that can be corrected in an RRNS representation. Therefore,
r=2*s (19)
So, when correcting s digits of an RRNS word Y′, we have a total number of RRNS digits p equal to,
p=n+2s (20)
where,
Exemplary RRNS Integer System
It is helpful to show RRNS concepts of error detection and correction using an example RRNS. The example integer RRNS is expressed using notation introduced earlier. Starting first with a non-redundant RNS integer value Y expressed in minimal digit form as,
Y={d1,d2,d3,d4} (21)
with associated digit modulus,
m1=125,m2=128,m3=131,m4=137,m5=139,m6=149 (22)
and an RRNS Y′ word derived from Y (22) by adding two redundant digits d5, d6,
Y′={d1,d2,d3,d4,d5,d6} (23)
with associated digit modulus,
m1=125,m2=128,m3=131,m4=137,m5=139,m6=149 (24)
the following variables are defined for our example integer RRNS system,
p=6,n=4,r=2,s=1 (25)
For the example at hand, the total range of the valid integers M is,
M=125*128*131*137=287152000 (26)
Therefore, our example integer RRNS system supports unsigned values as large as 287152000-1 (<M). And for the example at hand, the total range of the extended RRNS word Y′ is,
M′=125*128*131*137*139*149=5947205072000 (27)
Assuming the range of the valid data representation is <M, Y′ can allow us to detect as many as two digits in error with 100% confidence and allows us to recover at most one digit in error. As an example of a typical value encoded in the example RRNS, the decimal value 123456789 is encoded as,
Y′={39,21,31,61,47,8}=12345678910
where according to well defined definition for RNS digits di of an RRNS word Y′,
di=|Y′|m
Various Ways of Detecting RRNS Digits in Error
To recover an RRNS digit in error, there are several approaches that have been suggested or used in the prior art. Some of the earliest methods for error detection and correction of residue arithmetic was published in the 1960's by Svoboda and Valach, and Watson and Hastings.
In a prior art method proposed by Watson, error detection is based upon the use of redundant digits to act as a consistency check. Furthermore, Watson suggests the use of specially selected modulus that meet certain properties so that a LUT can be used to store both an indication of which digit is in error and provide a correction constant to correct the digit in error. Briefly described, the LUT is indexed by the difference of the two redundant moduli to determine which digit is in error. If the LUT indicates an error, a correction value is returned by the LUT to provide a value to correct the digit in error.
There are many issues with the approach of Watson for a practical design. For one, the scheme relies on specially selected moduli which limits the range and usefulness of RNS arithmetic. The approach also works on positive integers in a straightforward manner but is much more complicated when considering signed values, i.e., values that may be positive or negative.
Another method of detecting and correcting residue digits is attributed to Jenkins and Barsi. In Jenkins and Barsi's approaches, comparison of trial digits sets is used to determine if an unsigned integer is in error or not, however, the subject and methods of error detection of negative numbers using this scheme is not complete.
In a recent scheme developed by Deng and Srikanth, RRNS error detection of negative and positive RRNS numbers is based on a so called “Excess-M/2” number representation which forces the range of the negative values to be located to allow conventional error detection principles of the prior art; moreover, the work leverages off the work of Watson, such that specialized moduli are required. More significantly, this scheme requires that the results of arithmetic be modified so that a redundant range according to prior art understanding of numeric redundancy in RRNS is maintained; because of this approach, the arithmetic algorithms and results for most basic arithmetic operations of the ALU must be modified. Altering the arithmetic results by adding extra ALU operations slows the ALU, and furthermore, the resulting excess-M/2 representation complicates the design of a practical, flexible ALU by altering the natural arithmetic result of most every basic arithmetic operation. This makes the use of the Excess-M/2 representation impractical for high-speed matrix multipliers, such as the matrix multiplier illustrated in
For reference sake,
RRNS EDAC Using Comparison
Mixed radix conversion can be used to detect if an RRNS residue digit is in error by using the ability of mixed-radix format to compare numbers directly. There are several variations in the prior art noted above.
Intuitively, if we assume that at most one digit is in error in Y′ of the example above, then the value of Y may be recovered by ignoring or skipping the digit in error. Therefore, if we know what digit is in error, we can simply ignore that digit, since it is known the five remaining digits have enough range to represent Y. In fact, if there are two digits in error, and we know which two digits are in error, we can still recover Y from Y′ since the four valid digits have enough range to represent Y. In these cases, all we have done is ignore redundant digits and reduce the range of our number system under test, and this did not change the value of Y′ according to Equation (9).
The problem in most applications is we do not know which RRNS digit is in error. To determine which digit is in error, it is observed that a single incorrect RRNS digit in Y′ will always transform a value that lies in a legal range to a value that lies in an illegal range. The reason is due to the uniqueness of RNS values. For example, for any value represented by any combination of the first n non-redundant digits, there is one and only one digit value that is defined for any redundant digit such that the RNS value Y remains unchanged in Equation (9) and the value remains less than the value M as in Equation (4). This is due to Equation (28). Therefore, any other value for the redundant digit must bring the value of Y′ into the illegal range, i.e. greater than M.
Thus, a comparison can be used to act as a consistency check on Y′ for a single digit in error, and a plurality of comparisons is needed to determine which combination of digits is valid if more than one digit is in error.
By means of example, if one digit is in error, a single comparison may establish this fact since Y′>M. On the other hand, if two digits is in error in the example RRNS, this can be determined by taking all possible sets of five (5) digits and determining if the number represented by each digit set is valid or not. If all sets of five (5) digits are invalid, then at least two digits are in error. If only one set is valid, then one digit is in error, and if all sets are valid there is no error.
Similarly, when performing error correction, it is necessary to establish a valid set of five (5) digits for which a base extend function can be applied to correct the digit that is skipped. Therefore, when using comparison for implementing error correction, and/or detection of more than one digit in error, there is a need to generate basic combinations of RRNS digit sets for purpose of range comparison.
In the methods of the present invention, an error detection and correction (EDAC) unit is designed so that errors are not only detected but corrected, so the combinations of RRNS digits are required for comparison testing; each digit combination being a unique set of five (5) digits from a total of six (6) digits of Y′ by means of the present example. In general, for an RRNS word of p digits total and s number of digits to recover, the total number of trial digit sets (t) will not exceed p choose (p−s) digits
or 6 total sets in our example system above where,
t=the (maximum) number of trial digit sets.
To assemble digit sets for double digit error correction, if we assume two digits in error, then the total number of RRNS digits required will be p=8 in our example, and total digits to skip for each trial set is s=2, so the total number of trial digit sets is 8 digits choose 6, or 28 trial sets,
Consider the case for single digit correction of RRNS arithmetic which has the property of having the least number of trial digit sets to test. In Table 1, the example six-digit RRNS indicates the d4 digit is in error using the symbol ‘e’ and illustrates each trial digit set as having a different skipped digit position denoted by an asterisk. When an MRC procedure is used to convert each trial digit set to mixed radix format, it is only the value of the digits of Trial Set 4 that is less than the range M, and so the digit in error is known to be digit d4, and furthermore, the value of Y is also known.
If we base extend the RRNS digits of trial set 4, the d4 digit is recovered to its original state since there is only one value for the digit d4 such that Y′<M which preserves the digit as redundant.
Base extension hardware may also support a comparison function as shown in the prior art. The mixed-radix digits corresponding to the range value M may also be stored to make comparison more efficient, thus the comparison is performed entirely in mixed-radix format and typically least significant digit first in high-speed applications.
Error Correction of Positive Numbers
In the new methods presented in this disclosure, we refer to each trial set of digits under test as a derived RNS number system. Moreover, each digit set Yi represents a reduced number system, having been reduced by a single digit modulus. Therefore, the terminology favored in this disclosure is to refer to each digit set Yi as being reduced by a single modulus. This point might seem subtle, but its description maintains the underlying mathematics of each transformation of Y′ to Yi.
When a value represented by a derived number system Yi is converted to mixed-radix format, such a number is referred to as a “projection” in the prior art. This value can be shown to be greater than or equal to M if a digit in Y′ is still in error. The range Mi of each projection Yi can be described by,
Each projection Yi is formed using distinct ‘trial’ digit sets. For the case of correcting a single digit in error, the value of each projection Yi can be stated mathematically as,
Yi=|Y′|M
A weighted representation for each projection is obtained by converting each Yi to mixed radix format, Ai, given in functional notation as,
Ai=MRC(Yi) (33)
and given in the mixed-radix digit set nomenclature herein as,
Ai=<a1,a2, . . . ,a(p−1)> (34)
Where mixed-radix digits are written least significant digit first, i.e., in a reverse significance notation.
According to the prior art, and assuming only one digit in error, an error is detected in digit di when one and only one digit set Yi is less than the range M. In practice this check can be implemented using a direct comparison of Ai versus M for all i, and in some preferred embodiments, is performed in mixed-radix format. Using a mixed-radix equivalent value, if only one Ai is less than M, the Yi digit set is deemed to have no error but the “skipped” digit is known to be in error. Base extending the digit set Yi to restore the digit di corrects the di digit.
The operation of the error correction unit can be described in conditional form as,
An error status may also be generated by the error detection and correction unit. In the case of an EDAC unit designed to correct single digit errors in p total digits, the status can be defined as,
In practice, the value of M is stored as a constant in mixed-radix format and comparison proceeds least significant digit first. However, because each comparison involves a value Ai of a unique number system with unique range Mi, a different set of mixed-radix digits is required to represent the constant M in each case; for this system to work, the digit order of mixed-radix conversion is pre-determined or fixed.
Example of Positive Value Error Detection and Correction
In the row 825 of the table of
Values for each trial set Yi is indicated in rows 840 through 865. For example, trial set Y1 is the RRNS digit set created by ignoring the first digit, d1, and processing only digits d2 through d6 by means of comparison against the legal range M of row 825. As shown in row 855 of the table of
In the example at hand, if error correction is required, the digits of trial set Y4 are base extended so that the d4 digit is returned; i.e., the skipped digit in position d4 is set back to the value 61 by a base extend operation.
Method of Error Detection and Correction of Negative Numbers
The detection and correction of errors in residue numbers having a signed representation is more problematic. According to a recent study, three methods are known, yet only two methods have a solution in the prior art. The third un-solved method is only proposed because it represents an ideal solution. This disclosure will show several methods for performing the ideal solution to implementing error detection and correction of RRNS values having a signed representation. In a later section, this disclosure will introduce the extension of these EDAC methods to signed, fractional representations.
Negative Value RRNS Representation
Negative numbers are often represented in RNS using a number system of M states by dividing the M states into two numeric ranges, one for positive integers and the other for negative integers. For even RNS systems (M is even), one method is to divide the two ranges to support the method of complements. In this case, we define a sign(x) function,
For method of complements, we also define a complement function as,
The primary issue with a complement representation of the prior art is when the RNS word Y is extended to an RRNS word Y′ for the purpose of error detection. Because the range of the overall machine word Y′ is now M′, the complement equation (38) is modified to,
It might seem a simple solution to maintain redundant digits in such a manner as to preserve the method of complements with range M. Such a scheme is called “complement-M signed RRNS representation” and is illustrated using 9c.
The problem with complement-M signed RRNS representation is that redundant digits do not follow the same arithmetic functions as non-redundant digits of range M. For example, decrementing the number zero by decrementing all digits of the RRNS word Y′ will land its magnitude (state) to a value of M′−1. Clearly, this is out of the range M indicated in
A recent solution proposes the use of an RRNS number system referred to as “Excess-M/2 signed representation”. A number line representation of the Excess-M/2 representation is shown in
However, there are many similar issues with Excess-M/2 signed representation as with complement-M signed RRNS representation of
Prior to this disclosure, there is no known solution to the use of “standard method of complements” representation as shown in
As shown in
Furthermore, consider a non-zero positive value x is represented in a complement-M′ RRNS representation of
Clearly, the RRNS representation of a positive value x lies within the positive integer range of
But we also observe other facts. The complement of a valid positive value lies in the negative integer range as indicated in
Or treating the integer x as a signed quantity according to the rules of Equation (37) then,
Recall the case when x is positive, the redundant range is at the end of the number line of
Using the notion of complements leads us to revise the range for which numbers are valid during the error detection stage. In the prior art, much attention is paid to the value of M, that is, Y′ should be less than M, or Y′<M. However, for the method of complements, recall the sign of a value less than M is provided by the sign(x) function of (37), but this can only be analyzed directly using the first n digits, or non-redundant digits. By applying the MOD M function to Y′, the arithmetic of the non-redundant digits is captured, and the total range of the underlying complement arithmetic in RRNS is seen to be M, but for signed values this is only valid if we apply a range check using a constant of M/2 as in the sign(x) equation of (37). The application of the MOD M function to the arithmetic of Y′ in RRNS makes it possible to see the underlying arithmetic number line within Y′ is continuous as in
In the final analysis it doesn't matter that a value Y is <M for error detection and correction. Instead, it only matters that there is one and only one unique mapping of M number of states of Y′ that constitute valid arithmetic, and that for any of the other M*(m5*m6−1) number of states as in the example, the resulting value of Y′ can be detected to lie outside the unique (legal) mapping of M states. Since the unique mapping of M arithmetic states adheres to the method of complements and follows a linear arithmetic progression of positive and negative integers, any value Y′ is validated using comparison versus the legal integer ranges M/2 and ˜M/2.
In one method of the present invention, it follows that both the value Y′ and its complement (˜Y′) undergo trial testing using a comparison function against the value M/2 as discussed. This doubles the number of trial comparisons that must be performed but allows an unparalleled level of error detection and correction of arithmetic.
Formally, we can write the novel error detection and correction strategy which uses a complement operation to recover the redundant range when a value is negative in the form of a conditional equation,
These revelations motivate a new form of error detection and correction in RRNS using method of complements representation as indicated by the number line of
A couple of points are worth explaining in the flow diagram of
In
In
It is obvious to those who study the disclosure that many variations are possible from the basic flowchart of
The data flow from the input value port 1100 is diverted to block 1105 where it might be delayed remaining in synchronization with the same input data undergoing a complement operation in block 1110. In block 1115, a trial digit set Yi are tested to be less than M<2, and if so, a positive error flag is set in an error pipeline unit 1120. In block 1125, trial digit set complements are tested to be less than M/2, and if so, a negative error flag is set in error pipeline unit 1120. Both blocks 1115 and 1125 detect errors and correct digits in error. If a negative value is in error, the value is corrected as it exits block 1140 but must be complemented so that it is returned to a negative value;
Depending on the synchronized state of the error flag delay line 1135, the state of the corresponding error code, associated with a positive and negative value in synchronization and produced by block 1130, 1140, controls which one of the two values is to be selected by selector 1150 and transmitted as a corrected result 1160. An error code status signal 1155 is generated to ascertain the status of each arithmetic result or signed value passed through the dual pipeline EDAC of
One issue with the new EDAC method is the need to generate two groups of trial digit sets since both positive values Yi and the negative values ˜Yi must be compared against the value of M/2.
This results in more latency and more hardware for the EDAC unit.
A new improved method of the present invention which eliminates the need to form or generate a second group of trial values ˜Yi is disclosed next. This new method treats the redundant range of the RRNS number system in an entirely new and novel manner. It is noted during base extension of a negative representation for x that the resulting RRNS increases the number system range from M to M′, such that,
Equation (44) tells us that the base extend function increases the number system range to M′ but does not affect the magnitude of ˜x as in required by Equation (9). Therefore, the BE function does not preserve the negative value representation for x in the new RRNS of range M′. In fact, it is possible the representation is now an illegal value within the RRNS number line representation of
The quantity on the left side of Equation (45) is the correct representation for negative x in an RRNS of range M′, and the value on the right is the base extended value of a negative x in a number system of range M plus a correction constant C. The correction constant is therefore,
In our derivation, the correction constant C is added to the base-extended complement ˜x to restore it to the legal range of negative values in the RRNS range M′ as provided by representation of
In an alternate interpretation of Equation (47), it is noted the correction constant C is a negative representation for M in the extended RRNS system in Equation (46) so a subtraction of M modulo M′ can be used for correction for convenience (since the value of M is needed to derive the negative range constant later). The subtraction causes an under-flow but results in a valid representation for the negative value x in the extended RRNS system. This is described by combining (46) and (47),
Moving backwards, a valid negative representation ˜Y′ for a positive, non-zero value x in an RRNS representation of range M′ may undergo digit truncation so that (i) number of derived RRNS digit sets ˜Yi are generated. Thus, substituting (40) into (32) we have,
Surprisingly, the truncation of a valid negative representation Y′=−x by a redundant digit produces a valid negative value for x in the new representation Yi. To visualize this case, the number line of
Understanding that a valid representation for negative values is preserved by truncation of a redundant digit provides a means to perform error detection and correction directly on Yi regardless of the sign of Yi and without requiring a second set of trial values ˜Yi as required by the method of
However, regardless of the reduced number system, the positive value range check (Ri) for each trial digit set Yi is always M/2, so we have,
On the other hand, the upper negative range value (˜Ri) is different for each number system with range Mi. Taking the complement of M/2 for each different number system of range Mi using (49) provides a specific upper range value ˜Ri used for each trial digit set Yi and is given by,
In a similar manner, replacing Mi for M in equation (46) a correction constant Ci is defined for each trial set Yi,
Ci=M′−Mi (52)
We are now able to define the new method for detecting and correcting errors directly in an RRNS complement-M′ arithmetic providing for un-precedented error correction of arithmetic capability. First, a generalized equation describing the recovery of a base extended trial digit set Yi representing a negative value x is provided by substituting Yi for x, and Ci for C in (47),
|M′−Yi|M′=BEM′(Yi)+Ci (53)
The recovery of positive values is the same as discussed for unsigned values except the valid range is reduced from M to M/2. Therefore, the basic operation of an EDAC unit capable of processing both positive and negative representations in RRNS can be described in conditional form as,
Consider if Y′ is in error by a single digit, then only one trial digit set Yi is valid; therefore, either its mixed-radix equivalent Ai is less than M/2, or Ai is greater than ˜Ri. All other trial sets will lie in an invalid number range of the number line of
In practice it is acceptable to base extend the first trial digit set Yi that lies in a valid range. If the valid range is the negative value range, then the base extended value Yi is corrected by adding the correction constant Ci. If there are any inconsistencies, then either the assumption that one digit in error is incorrect, or there is an error in the EDAC unit itself, and so YR is returned invalid, or at least without confidence. For example, if there is a trial digit set Yi<M/2 and another trial set Yi>˜Ri, there is an un-recoverable error and the correction result YR is not known to be valid. Other variations of the error correction unit using the concepts and methods developed herein are possible, such as an EDAC state machine that handles all error cases in a specific and predictable manner.
It is noted that if a trial digit set Yi is determined to be equal to M/2 or equal to ˜M/2, the trial digit set is in error, and the error is not correctable. In this case, the trial digit set Yi is not correctable due to the fact it requires at least two RRNS digits to be in error to transition any legal value <M/2 to a value equal to M/2.
A basic flow chart is provided in
In
Like the flowchart of
Moreover, the flow chart of
Exemplary Negative Value Error Detection and Correction
In this example, the RRNS digit moduli m1 column 1300 through m6 column 1305 are shown above each RRNS digit d1 through d6 respectively. The magnitude of each RRNS value is shown in column 1310 and a description column 1315 is provided for most important parameters for the EDAC trial testing of signed integers. Furthermore, column 1320 provides an (upper or) negative range value ˜Ri for each trial set Yi and column 1325 provides a correction constant Ci 1325 associated to each trial set Yi of row 1335 through row 1340. In the example RRNS system of
In the example of
Because the value of a single Yi is greater than its associated negative range constant ˜Ri, the value of Y′ is negative and a correction constant Ci is applied to the final result as in (53). Therefore, when the value of RRNS magnitude Y4 and C4 of the table of
The decimal values for the example of
In
Apparatus of the Present Invention
In earlier sections of the present disclosure, a formal method is disclosed for performing error detection and correction of a value in a standard complement representation of full redundant range (M′) but the value limited to a range of −M/2 and +M/2, i.e. a complement-M′ RRNS representation. This section will disclose high-performance pipelined EDAC circuit designs and apparatus and will disclose one or more preferred embodiments of the present invention and by means of example only.
Continuing with the present example, the circuit of
In
Each major pipelined apparatus comprising the single digit EDAC of
Mixed-Radix Converter Unit
The basic architecture of a pipelined mixed-radix converter 1410 is known in the prior art and has been studied by Jenkins and others. As a brief review, the pipelined mixed-radix converter consists of a plurality of modular subtract-then-multiply processing elements designated by its symbol (|sm|), such as |sm| processing elements, 1413, 1417. Each |sm| processing element is associated with a multiplicative constant mi−1, such as constant m11 1412a, which represents the multiplicative inverse of each digit modulus (acting as a divisor) with respect to each other digit modulus.
To relieve clutter in the diagram of
The symbol and function of the |sm| element is shown in
For example, at STAGE-11425 of
In one preferred embodiment of the EDAC of the present invention, regarding the operation of the mixed-radix converter 1410 of
The order of RNS digit conversion during the process of converting an RNS value to an associated mixed-radix number affects the format of the mixed-radix number system but does not change its range. However, the format of the mixed-radix number system affects the values for mixed-radix constants, and therefore it is advantageous to fix the order of RNS digit conversion for that reason in many preferred embodiments.
Digit Recombination Unit
During processing of pipeline STAGE-11425, the first mixed-radix digit (R1=d1) is transmitted using digit data bus 1411 to the digit recombination unit 1430. In recombination unit 1430 at STAGE-11425, the first stage of recombination value R4 1431 is simply to store the value of the first trial set digit d1. During processing of pipeline STAGE-21426, mixed-radix digit R2 is transmitted using digit bus 1432 to the input of modular multiply-then-add processing unit 1434 where it is multiplied by mixed-radix power constant p2 and this product is summed to value R4 1431 from STAGE-11425 and this modular sum is stored in register R4 1435.
At each successive stage of digit recombination unit 1430, a mixed-radix digit Ri is received and multiplied by an associated power constant pi; this modular product is then summed with the recombination digit processed from the previous stage of the same modulus. Taken together, all stages of the recombination circuit 1430 perform a “base extend” of the skipped digit di by computing a value for a skipped digit di; mathematically the digit base extend function is defined as,
di=|apΠj=1p−1mj+ . . . +a3m2m1+a2m1+a1|m
so that each power factor constant is defined by,
pi=Πj=0i−1mj (56)
where m0=1 by definition, and each radix mj is associated to each digit of the number system Ai provided by Eq. (34), and where Ai is further related to the modulus of the derived RRNS number system Yi using the decomposition relation below describing mixed-radix conversion by circuit 1410 which skips conversion by the modulus mi,
((((((|Yi|M
A modular multiply-then-add processing element 1513 is defined in more detail in the block diagrams and equations of
The |ma| symbol may be synthesized from various means, and various methods and circuit topologies. For example, the |ma| symbol may be synthesized using look-up tables, RAM or dedicated circuitry and logic gates. The |ma| symbol in the context of the pipeline digit recombination unit 1430 typically indicates the |ma| element is pipelined itself.
After the processing at STAGE-41428 of the digit recombination pipeline 1430, the last |ma|element 1438 performs the last modular multiply-then-add operation using the last mixed-radix digit R6 1420 generated, power constant p5 1437 and the prior recombination result R4 1436, and the modular result of the last |ma|element 1438 is stored in register R4 1439. The result stored in register R4 1439 is a base extended value for the RRNS digit d4 derived from the input trial digits Y4 1401.
By means of example, the digit R4 1480 is initialized to zero at start in table row 1481 and in STAGE-1 transitions to value of 39 shown in table row 1482. The product of the previous power pi=1 at table row 1481 and the previous mixed-radix digit, R1=39, equals the value of thirty-nine (39) in table row 1482. In the next stage, the value of the power constant p2=125 multiplied by the value of the previous mixed-radix digit R2=6 equals (750) plus the previous value of (39) modulo m4(=137) 1463 equals the value (104) shown in table row 1483. By STAGE 5 of table row 1487, the value of the recombined digit R4=61 is shown as a final answer. The example calculation of the complete digit re-combination is shown in the calculations enclosed in dotted lines 1490.
Comparator Unit
In
Note the asterisk in row 1484 and column 1478 of the table of
During each stage of processing of the pipelined comparator 1440, a mixed radix digit is generated by the mixed-radix circuit 1410 and is transmitted to the comparator pipeline 1440 for purpose of performing the comparison step of 1215 of
In one preferred embodiment, logic for comparing numbers least significant digit first is required in comparator 1440. For example, if the comparison between a mixed-radix digit generated by converter 1410 and mixed-radix digit of constant M/2 is equal, the prior state Sin 1521 of the comparison is passed by comparator element 1523 to the next comparison output stage S 1524 as shown in
The pipelined comparator 1440 includes a plurality of comparator elements, such as comparator element 1442 and element 1450 of
An example of a mixed-radix comparison performed least significant digit first is indicated in the example comparator status (cs) column 1477 of the table of
For the example illustrated in
By pipeline STAGE-51487, the mixed-radix digit R6=0 of row 1485 is detected equal to the mixed-radix constant a5=0 resulting in a “less than” symbol at row 1487 and column 1477 since during an equal condition, the comparator element 1449 of
Single Signed Digit EDAC
The methods and apparatus of the present invention for error detection and correction of signed values, developed formally and described using equations (37) through (54), are disclosed herein in the form of a preferred embodiment and by means of example. However, many other embodiments are possible, and this is clear to those skilled in the art of error detection and correction circuits.
A novel and unique improvement to the unsigned value, single-digit EDAC pipeline 1400 of
The operation of the signed EDAC 1600 of
The enhanced comparator pipeline 1640 of the EDAC 1600 of
At STAGE-51626 of the enhanced comparators 1640, and for each value processed by the EDAC 1600, a final determination is stored in negative result error code S− 1648 and positive result error code S+ 1659. When the negative result flag error code S− indicates a legal negative value, (and the positive error flag S+ 1659 simultaneously indicates an invalid positive value), the correction circuit 1660 is activated and the value of the recombination digit, R4 1638 in the case of the example of
When the positive result error flag S+ 1659 indicates a valid positive value, (and in some embodiments the negative error result flag S− is tested for an invalid negative value for the same operand Yi) the modular adder 1664 adds the value of zero to the recombination digit value R4 1638 before storing the base extended result in register R4 1665. In some embodiments, an error function look-up table or logic f(x) circuit 1666 implements the decision to apply a negative correction constant using correction circuit 1660 or not and implements error signals indicating whether the result was valid 1668 or not, and if valid, the sign valid flag 1667 indicates the sign of the correctable operand Yi in some embodiments.
An example error detection and calculation processing cycle for the single digit, signed EDAC unit 1600 is illustrated using the data table of
As mixed-radix conversion proceeds, the d4 digit recombination proceeds as indicated in column R4 1682, and table rows 1685 through row 1691 of
Because the trial value Yi of row 1684 is determined to be a legal negative value in the example of
Signed Word EDAC Unit
An EDAC unit which accepts an entire RRNS word Y′, and tests each trial digit set Yi, and corrects the word if it is in error by no more than one RRNS digit, can be assembled using a plurality of single digit signed EDAC units, like the signed value EDAC 1600 of
Details of an example digit selector circuit 1780a of
In order to design different outcomes for the output Y′ upon each different error case, and in order that all cases of error detection and potential error correction be discerned, an error function 1855 is typically present within the signed word EDAC 620c and may be part of the digit selector unit 1780b by means of example. The error function 1855 may consist of a look-up table or dedicated logic to implement a logic function like the error logic table shown in
In the row 1935 of the table of
Similar cases indicating the correction of a negative input value Y′ is also present in rows 1945, 1950 of the table of
In order that the digit selector 1780b be modified so that an original delayed value of Y′ output from delay line 1710 be output when no error condition exists (i.e., all es codes indicate a legal range value of the same sign) the logic condition as shown in rows 1935, 1945 of the table of
The signed word EDAC 620c of
Streamlined Signed Word EDAC
The signed word EDAC 620c of
Consider the block diagram of
Like-wise, other digit sets, such as digit set Y(p-1) can derive a significant portion of its mixed-radix digits from the main mixed-radix conversion path 2005 up to the second to last digit is converted, at which point the conversion branches to its own path 2037, since the second to last digit of the main branch is skipped, and only the last digit is converted by the mixed radix branch 2037. This last step is unique and is not repeated by another mixed-radix conversion branch, so this must be supported in a high-speed pipelined design.
In sharing arithmetic operations among mixed-radix conversion data flows indicated by
The EDAC 1702b of
In
Each secondary mixed-radix data flow, as illustrated in
Unique to the connections for each single digit EDAC of
The first digit d1 EDAC processing is an exception as it requires circuitry for a full single digit EDAC, since there is no common, over-lapping mixed-radix conversion. As the primary mixed-radix proceeds, more over-lapping operations may be performed. The last two remaining EDACs with outputs D5 2197 and D6 2195 swap position as being the last digit converted from the last section 2185 of the primary mixed-radix converter. The digit recombination and word compare functions for each single digit EDAC function of
After analysis of the table of
Note that while the value of the positive number range is always M/2, its mixed-radix representation differs for each trial digit set Yi, as shown in each row of the range constant M/2 column 2220 of
Upon analysis of the values in the table of
No other trial digit set Yi of the table of
Because a single trial digit set Y4 is detected as a value in a legal range as indicated by the number line of
Further note that negative range constants ˜Ri of column 2275 of the table of
Error Correction of More than One Digit
It is noted that the techniques and method of the present invention as disclosed may be extended to EDAC systems correcting more than a single digit in error. Intuitively, the single digit methods and apparatus disclosed herein are modified to allow trial digits sets to skip more than one digit, thereby dramatically increasing the number of trial digit sets to test. In this case, each trial digit set Yi skips more than one digit.
To understand how the ranges Mi of each Yi are affected by an EDAC correcting two digits, the relation for the trial digit range is modified as,
Therefore, each trial digit set notation Yi,j includes two indexes, i and j, for which 1≤i≤p, 1≤j≤p, and i≠j.
In the example herein, to enable correction of two digits out of four non-redundant digits in Y′, four redundant digits are required for a total of p=8 digits. The total number of distinct sets Yi,j of six (6) digits is therefore given by,
Other schemes are available for decreasing the number of trial sets Yi,j, such as creating a smaller number of digit “sub-groups” for example, but come at the cost of increased redundant digits or other tradeoffs and are not explained herein. Experts familiar with the design and optimization of testing combinations in the context of error correction, and using the material presented herein, can effectively extend the techniques and apparatus for an EDAC supporting single digit error correction to an EDAC supporting multiple error correction.
Error Detection and Correction of Fixed-Point Arithmetic
Error detection of fixed-point arithmetic of the format described in
For example, the TPU of
In order that the dot products produced using the 8-digit machine word 770 support detecting and correcting a single digit in error, two additional redundant digits are extended to the machine word 770 resulting in a 10-digit machine word (p=10) not shown. In practice, the value of the additional redundant moduli must be greater than the existing moduli of
Provided that two additional digits (ea., two additional digit matrix multipliers 642) are extended to the machine word 770 of the TPU of
It is noted the addition of two additional digit matrix multipliers increases TPU circuit resources by approximately 20%, which is less than the 300% resources required using the triplication scheme of
While various embodiments of the invention have been described, it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible that are within the scope of this invention. In addition, the various features, elements, and embodiments described herein may be claimed or combined in any combination or arrangement.
Number | Name | Date | Kind |
---|---|---|---|
4281391 | Huang | Jul 1981 | A |
4588980 | Bernardson | May 1986 | A |
4910699 | Capps | Mar 1990 | A |
4948959 | Houk | Aug 1990 | A |
4963869 | Falk | Oct 1990 | A |
4996527 | Houk | Feb 1991 | A |
5050120 | Houk | Sep 1991 | A |
5107451 | Houk | Apr 1992 | A |
5117383 | Fujita | May 1992 | A |
7489705 | Sachs | Feb 2009 | B2 |
7523151 | Mellott | Apr 2009 | B1 |
8051124 | Salama et al. | Nov 2011 | B2 |
8195735 | Hansen | Jun 2012 | B2 |
8219865 | Murakami | Jul 2012 | B2 |
8607112 | Roh | Dec 2013 | B2 |
9081608 | Olsen | Jul 2015 | B2 |
9311050 | Olsen | Apr 2016 | B2 |
9395952 | Olsen | Jul 2016 | B2 |
9712185 | Olsen | Jul 2017 | B2 |
20060010190 | Shimbo | Jan 2006 | A1 |
20060184600 | Maruo | Aug 2006 | A1 |
20090024906 | Calderbank | Jan 2009 | A1 |
20090202067 | Michaels | Aug 2009 | A1 |
20100174960 | Suzuki | Jul 2010 | A1 |
20110231465 | Phatak | Sep 2011 | A1 |
20130311532 | Olsen | Nov 2013 | A1 |
20140129601 | Olsen | May 2014 | A1 |
20140139365 | Vun | May 2014 | A1 |
20150106414 | Olsen | Apr 2015 | A1 |
20150339103 | Olsen | Nov 2015 | A1 |
20160342891 | Ross | Nov 2016 | A1 |
Number | Date | Country |
---|---|---|
2868833 | Nov 2013 | CA |
1068565 | Sep 2009 | EP |
2761432 | Aug 2014 | EP |
2318238 | Feb 2008 | RU |
WO2013176852 | Nov 2013 | WO |
Entry |
---|
Thu Van Vu, Efficient Implementations of the Chinese Remainder Theorem for Sign Detection and Residue Decoding, IEEE Transactions on Computers, vol. C-34, No. 7, Jul. 1985, pp. 646-651, XP011291045, IEEE Service Center, Los Alamitos, CA, ISSN: 0018-9340, section III. |
Cardarilli G C et al, RNS Realization of Fast Fixed-Point Multipliers with Large Wordlengths, ISCAS 1989, vol. 1 of 3, May 1989, pp. 212-215, XP000131600, IEEE, New York, NY, p. 212, right col. para. 1, section 3. |
Arnold M G, The Residue Logarithmic Number System: Theory and Implementation, IEEE Symposium on Computer Arithmetic, ARITH-17, Jun. 2005, pp. 196-205, XP010817723, IEEE, Piscataway, NJ, DOI: 10.1109/ARITH.2005.44, ISBN: 978-0-7695-2366-8, p. 198, left col. last para., right col. para. 3. |
Taylor F J, The Application of RNS Arithmetic to Data Processing, Electronic Engineering, vol. 61, No. 750, Jun. 1989, pp. 101, 103, 104, XP000033123, Morgan-Grampian Ltd., London, GB, ISSN: 0013-4902, figs. |
Number | Date | Country | |
---|---|---|---|
20200235751 A1 | Jul 2020 | US |