US 4584563 A Abstract In a residue number system defined by the moduli set {p1=2
^{n} -1, p2=2^{n}, p3=2^{n} +1}, a method of converting residue number signals {m1,m2,m3} to associated analog signals r(m1,m2,m3), and that does not require memory devices, comprises the steps of generating a pair of binary signals that are the sum and difference of the residue numbers m1 and m3, bit shifting these sum and difference signals by inserting 2n-1 and n-1 binary 0's as less significant bits thereof, and summing these bit shifted signals modulo p1*p3 to produce a two dimensional binary signal r(m1,m3). A correction signal is generated by modulo p2=2^{n} summing the n less significant bits of the signal r(m1,m3 ) and the negative of the residue signal m2 to produce a second difference signal, bit shifting this second difference signal by inserting 2n binary 0's as less significant bits thereof and subtracting the second difference signal from this bit shifted signal to produce the correction signal. The signal r(m1,m3) and the correction signal are summed for producing a binary representation r(m1,m2,m3) of a given residue number {m1,m2,m3} . This binary signal is converted to the corresponding analog signal in a standard D/A converter. In a preferred embodiment, apparatus for performing the modulo p1*p3 summation is implemented with combining circuits that may be all standard binary adders so that all of the combining is done with standard binary adders and that no memory devices are required to perform the desired residue to binary conversion.Claims(19) 1. The method of converting a binary representation of a residue signal {m1,m2,m3} in a prescribed residue number system that is defined by the moduli set {p=2
^{n} -1, p2=2^{n}, p3=2^{n} +1}, where n is an integer, to an associated binary output signal r(m1,m2,m3), comprising the steps of:first producing first and second digital output signals that are binary representations of the sum and difference of the residue digit signals m1 and m3; second producing a third binary signal corresponding to the product of the first signal and the constant (2
^{2n-1});third producing a fourth binary signal corresponding to the product of the second signal and the constant (2 ^{n-1});fourth producing a fifth signal which is a binary representation of the sum of the third and fourth signals, taken modulo p1*p3 and which corresponds to the modulo p1*p3 sum of the products of the residue digit signals m1 and m3 and associated constants S3 and S1, where S1=p1*p2/2 and S3=p2*p3/2; fifth producing a sixth signal which is the modulo p2 difference between bits of the fifth signal and the residue digit signal m2; sixth producing a seventh binary signal which is the product of the sixth signal and the constants p1 and p3; and seventh producing the binary output signal r(m1,m2,m3) which is the sum of the fifth and seventh signals and which corresponds to the residue signal {m1,m2,m3}. 2. The method according to claim 1 wherein said seventh producing step is accomplished with a first binary adder that takes into consideration any overflow of a carry that is produced during operation thereof.
3. The method according to claim 2 wherein said fifth producing step takes into consideration the n less significant bits of the fifth signal for producing the prescribed modulo p2 difference signal.
4. The method according to claim 3 wherein said fifth producing step is accomplished with a second binary adder which operates as a modulo 2
^{n} adder.5. The method according to claim 4 wherein said first producing step comprises first combining m1 and m3 so as to produce the first digital signal and second combining m1 and m3 so as to produce the second digital signal, said first and second combining steps being accomplished with third and fourth binary adders, respectively.
6. The method according to claim 5 wherein said second producing step comprises first inserting binary 0's as the 2n-1 less significant bits ahead of the first signal for making up the third signal which is a first bit shifted signal.
7. The method according to claim 6 wherein said third producing step comprises second inserting binary 0's as the n-1 less significant bits ahead of the second signal for making up the fourth signal which is a second bit shifted signal.
8. The method according to claim 7 wherein said sixth producing step comprises third inserting 2n binary 0's as less significant bits ahead of the sixth signal for producing an associated third bit shifted signal.
9. The method according to claim 8 wherein said sixth producing step further comprises eighth producing the seventh signal which is a binary representation of the difference between the third bit shifted signal and the sixth signal.
10. The method according to claim 9 wherein said eighth producing step is accomplished with a fifth binary adder.
11. The method according to claim 10 wherein said fourth producing step comprises:
summing the third and fourth signals for producing an eighth binary signal; operating on bits of the eighth signal for producing a ninth binary signal which is proportional to the product of the constant 2 ^{2n} and the integer part of the eighth signal divided by 2^{2n} ;third combining the ninth signal and said bits of the eighth signal for producing a tenth binary signal which is proportional to the difference between the ninth signal and the integer part of the eighth signal divided by 2 ^{2n} ;fourth combining the eighth signal and the tenth signal for producing an eleventh binary signal that is proportional to the difference therebetween; first generating a twelfth binary signal that is proportional to a constant (2 ^{2n} -1);first comparing the eleventh signal with the twelfth signal and passing the twelfth signal as a thirteenth binary signal only when the eleventh signal is greater than or equal to said constant (2 ^{2n} -1), respectively; andfifth combining the eleventh signal and the thirteenth signal for producing the fifth binary signal which is proportional to the difference therebetween. 12. The method according to claim 11 wherein said summing step is accomplished with a sixth binary adder.
13. The method according to claim 12 wherein said third combining step is accomplished with a seventh binary adder.
14. The method according to claim 13 wherein said bits of the eighth signal comprise a prescribed number of the more significant bits of the eighth signal, which correspond to the integer part of the eighth signal divided by 2
^{2n}.15. The method according to claim 14 wherein said operating step comprises third inserting 2n binary 0's as less significant bits ahead of said more significant bits of the eighth signal to produce the ninth signal that is a third bit shifted signal that corresponds to a product signal.
16. The method according to claim 15 wherein said fourth combining step is accomplished with an eighth binary adder.
17. The method according to claim 16 wherein said fifth combining step is accomplished with a ninth binary adder.
18. The method according to claim 11 wherein said third, fourth and eighth signals comprise 3n+1, 2n and 3n+2 binary bits, respectively.
Description This invention relates to patent applications Ser. No. 653,422 filed Sept. 24, 1984, Ser. No. 653,402 filed Sept. 24, 1984, and Ser. No. 653,423 filed Sept. 24, 1984. This invention relates to the residue number system (RNS) and more particularly to improved method for converting residue number signals to binary number signals which are readily converted to analog representations of decimal number signals. It is becoming increasingly popular to design electrical equipment such as filters, CODECS and echo cancellers to perform necessary processing functions in a digital manner in order to obtain the advantages of high reliability and reproducibility of results. This requires converting an analog input signal to a digital signal, performing the necessary processing operations on the digital signal in a digital manner, and then translating the processed digital signal back into an associated analog output signal. In a digital filtering operation, for example, a series of multiplications and a long summation of product terms may be required. Since there are carries involved with basic arithmetic operations such as multiplication and addition in weighted number systems such as the decimal and binary (base 10 and base 2) number systems, time is required to accommodate all of the necessary carry operations. By way of example, there is a single carry from the units column to the 10's column when adding the numbers 9 and 5 to get the number 14 in the base 10 number system. This also applies to multiplication. And where 2 each 16 digit numbers are multiplied together to obtain a 32 digit number, it may be necessary to propagate a carry from the least significant digit in the units column all the way up to the last digit that corresponds to the most significant digit. This can be very time consuming. One technique for overcoming this time limitation that is called pipelining involves generation, in the same time, of different future product (or addition) terms corresponding to different bits and delaying them accordingly, so that all bits of a result will appear on outputs at the same time. This normally requires considerable hardware which can be costly in terms of both economics and real estate in an integrated circuit structure. Another technique for overcoming this time limitation is to perform such operations as multiplication and addition in a non-weighted number system which is called the residue number system (RNS). A residue signal processor has advantage over a conventional binary-digital processor in that results are exact, a smaller amount of hardware is required, shallower pipelining is possible, operation time may be decreased, and no carries are involved. During recent years there has been considerable interest in and development of techniques for performing digital computing and digital signal processing with hardware based on the RNS. This interest stems at least partially from the fact that operations can be performed quickly in the RNS because of the separability of operations on each RNS digit and the elimination of carries. Residue signal processor means must sample analog input signals and convert the samples to residue signals, perform the necessary processing on the residue signals, and convert the resultant residue signals back to analog output signals. Although techniques are readily available for efficiently converting analog/decimal or binary/digital signals to residue number signals, it is much more difficult to convert residue number signals back into analog signals. Since the RNS is not a weighted number system, its direct conversion to decimal/analog is not practical. One approach is to convert residue number signals to digital/binary signals and use one of the well known digital to analog conversion schemes to obtain the requisite analog/decimal signals. Residue to analog conversion is described in the articles: "Techniques for Residue-to-Analog Conversion for High Data Rate Digital Filtering" by W. K. Jenkins, 1978 IEEE International Conference on Acoustics, Speech and Signal Processing, pages 804-807; "An Efficient Residue-to-Decimal Converter" by F. J. Taylor and A. S. Ramnarayanan, IEEE Transactions on Circuits and Systems, Vol. 28, No. 12, December 1981, pages 1164-1169; "An Improved Residue Number System Digital-to-Analog Converter" by M. A. Soderstrand, et al, IEEE Transactions on Circuits and Systems, Vol. 30, No. 12, December 1983, pages 903-907; and "Techniques for Residue-to-Analog Conversion for Residue-Encoded Digital Filters" by W. K. Jenkins, IEEE Transactions on Circuits and Systems, Vol. 25, No. 7, July 1978, pages 555-562. Prior art residue to binary/digital converters generally require considerable hardware and/or have relatively slow execution times and/or require considerable surface area, which is undesirable in an integrated circuit structure or implementation. Also, many of the prior art residue to analog converters require memories that store look-up tables and/or modulo adders, both of which are generally hardware intensive, slow in terms of overall execution time and/or are magnitude limited in that memory size dictates the maximum number of bits and thus the largest number that can be handled. The execution time of RNS to binary converters which require memory is normally dictated by the access time of the memory, (i.e., the time that it takes to obtain information from a memory location) which may be for CMOS ROMS in the order of 100 nanoseconds. Memory systems having much shorter execution times are very expensive and are even more magnitude limited (i.e., memories with short execution times normally have fewer bytes of memory). Stated differently, memories having larger storage capacity normally have longer execution times and require considerably more real estate, which is a disadvantage in an integrated circuit structure. This can be a significant limitation since the advantages of the RNS increase with the number of bits of memory that are available. By way of example, multiplication of 2 each n-bit numbers is n times faster in the RNS than in the binary number system without pipelining. Additionally, modulo adders are normally more complex than and require more surface area in integrated circuit implementations than do conventional binary adders. An object of this invention is the provision of improved method and apparatus for converting residue number signals to binary number signals. In accordance with this invention, a method of converting a binary representation of a residue signal {m1,m2,m3} in a prescribed residue number system that is defined by the moduli set {p=2 This invention will be more fully understood from the following detailed descriptions of preferred embodiments thereof, together with the drawings in which: FIG. 1 is a diagrammatic representation of a 3-dimensional RNS signal vector r(m1,m2,m3). FIG. 2 is a tabulation of values of residue digits m1, m2, and m3 of the signal vector in FIG. 1 which define associated decimal numbers 0 through 59 for a prescribed RNS. FIG. 3 is a diagramatic representation of a sectionalized cube illustrating values of the residue digits defining the prescribed RNS signal vector in FIG. 1 for the prescribed RNS. FIGS. 4A-4D are tabulations of combinations of values of m1 and m3 in FIG. 3 for m2=0, 1, 2, and 3, respectively. FIGS. 5A-5D are alternate representations of associated FIGS. 4A-4D. FIG. 6 is a tabulation which summarizes the contents of FIGS. 5A-5D. FIG. 7 is a mapping table which summarizes the information in FIGS. 5A-5D. FIG. 8 is a schematic circuit diagram of signal processor circuitry including a medium moduli RNS to binary converter 14 that requires only a pair of memory devices and binary adders. FIG. 9 is a schematic circuit diagram of an alternate embodiment 54 of the converter 14 in FIG. 8 that requires only a single memory device and binary adders. FIG. 10 is a large moduli memoryless converter 57 which is an alternate embodiment of the converter 54 in FIG. 9 and which employs a modulo adder. FIG. 11 is a schematic circuit diagram of a modulo adder 70 which has particular utility in the converter 57 in FIG. 10 for providing a large moduli memoryless converter in which the adders are all binary adders. FIG. 12 is a tabulation of values of various terms in equations (25)-(32). FIGS. 13 and 14 are schematic circuit diagrams illustrating alternate embodiments of circuitry in FIG. 11. The circled numerals in ones of the figures designate equations defining signals on associated lines. Residue arithmetic and residue number systems are defined in the literature such as "Residue Arithmetic and Its Applications to Computer Technology" by N. S. Szabo and R. I. Tanaka, McGraw Hill Book Company; "The Residue Number System" by H. L. Garner, IRE Transactions on Electronic Computers, June 1959, pages 140-147; and "A Survey of Modern Algebra" by G. Birkhoff and S. MacLane, the McMillan Company. Residue number systems are of particular interest in digital signal processing. Each designated or selected or prescribed RNS is essentially defined by an N-tuple moduli set P that is representable as
P={p1,p2,pi, . . . , pN} (1) where i has integer values from 1 to N and each pi designates a particular modulus. The modulus may be thought of as being similar to the base b of the binary and decimal weighted number systems where b=2 and b=10, respectively. In these weighted number systems, a carry may be propagated between columns and must be taken into consideration in defining the value of the number. The residue representation of a natural or decimal number X in a selected RNS is a sequence of integer residue digits and takes the form of an N-tuple
X={m1,m2,mi, . . . , mN} (2) where the residue number or digit mi is
mi=|X| is the ith residue of X modulo pi and pi is the ith modulus in the selected RNS. Stated differently, mi is the smallest or least positive integer residue or remainder after X is divided by pi (i.e., X/pi). By way of example, if X=13 and pi=2, then
mi=|13| where * designates multiplication and [ ] designates the integer value (i.e., 6 in this example) of the quotient X/pi=13/2. Stated differently, 13 divided by 2 is 6 plus a smallest integer remainder of mi=1. If all of the moduli pi are relatively prime, there is a unique representation for each decimal number X in the range ##EQU2## where π designates an arbitrary product; N is the number of the modulus in a prescribed or selected or designated RNS; and M is the product of all of the moduli in the selected RNS, is one more than the largest decimal number X that can be uniquely represented in the selected RNS, and is referred to as the dynamic range of the selected RNS. The prime integers Q are those that are divisable only by ±1 and ±Q. The relatively prime integers are those integers that have no non-trivial common divisors. Thus, the set of relatively prime integers includes, but is not limited to, the set of prime integers. By way of example, 10 and 14 are not relatively prime since both numbers are divisable by 2 (which is not a trivial divisor), but 3 and 14 are relatively prime numbers. Two other important operations or functions in the RNS are congruence which is represented by the symbol ≃ here, and the multiplicative inverse which is represented by the symbol = in a modulo ratio. Two integers R and S are said to be congruent modulo pi if they differ only by an integral multiple of pi. Thus, 7 and 19 are congruent modulo 12 since they differ by 12. This congruence is expressed as 7≃19 modulo 12. This is expressed more generally as R≃S modulo p which holds if and only if p|(R-S) which means that R-S is divisable by p, that R-S is in the set of all multiples of p, and that R and S leave the same least integer remainders when they are divided by p. Also, G is the multiplicative inverse of H modulo p, which is designated as ##EQU3## if 0≦G≦p and |GH| A well known single moduli RNS, in which the modulus p=12, is the number system that is used to keep track of time (hours) on a clock which only displays hours in integer values. In such a system, the face of the clock might show 10 minutes past both 11 A.M. and 11 P.M. as 11:10. Similarly, it would show 10 minutes past both 1 A.M. and 1 P.M. as 1:10. In such an RNS where time starts at midnight on day one, the clock registers 12:00, then 1:00, 2:00, . . . 11:00. These times are, of course, A.M. But at noon and thereafter of day one, the clock again registers or repeats the number sequence 12:00, 1:00, 2:00, etc. There is no indication, however, as to whether time is A.M. or P.M. and there is no carry operation when the clock runs out of unique numerals at 11 and starts counting over again with 12:00. And when day two arrives, the clock again repeats the sequence of residue number digits without taking into account a carry. This is a particular advantage of the RNS in that there are no carry operations which require time to implement. There may, however, be carries between bits in digital (binary) representations of residue digits. There are no carries between residue digits. Representations in the so-called military time in which a day has 24 hours are readily converted to residue digits in the previously described modulo 12 number system by a simple modulo operation of dividing the military time (in hours) by the number 12 and taking the remainder. Thus, when 13:00, 15:00 and 23:00 hours in military time are divided by 12, the normal representations of time are found to be the well known remainders of 1:00, 3:00, and 11:00 O'clock, respectively. A particular RNS is selected by designating a particular moduli set (1) for defining the residue digits in (2) and FIG. 2. The invention here is restricted to an RNS defined by a 3-tuple moduli set of the form
P={p1,p2,p3}={2 where n is an integer, p1≠p2≠p3, and the 3 moduli may occur in any order and for any n. This RNS has gained much popularity in signal processing since residue numbers in it can be efficiently scaled by any one of the chosen modulus, (i.e., divided by those moduli. The corresponding residue representation of the natural or decimal integer number X (which can be represented in binary form) is then
X={x1,x2,x3}={m1,m2,m3} (9) For purposes of illustration only, the variable n has a value of 2 here such that p1=3, p2=4, and p3=5 (see equation (8)) and M=60=p1*p2*p3. This means that the largest decimal integer number that can be uniquely expressed in this particular selected RNS where n=2 is 59 (i.e., M-1). Also, each modulus (i.e., 3, 4 and 5) defines the period for the associated residue digits (see FIG. 2). The residue digits m1,m2, and m3 are ordinary decimal numbers expressed in binary form. The residue digits m1,m2 and m3 are defined by 2,2 and 3 bits, respectively, for n=2. In this 3-tuple RNS, the 3 digit residue number for each decimal equivalent may be represented as the 3-dimensional discrete vector r(m1,m2,m3) as is shown in FIG. 1. The decimal numbers and associated sets of residue numbers or digits in this 3 moduli RNS are tabulated in FIG. 2. It is readily seen that this vector r(m1,m2,m3) has 60 possible values (the dynamic range of this RNS with n=2), where each value of the vector may be represented as a unit cube as is shown in FIG. 3. The architecture or makeup of the large cube in FIG. 3 is more clearly seen by slicing it with cuts that are parallel to the m1-m3 plane in FIG. 3 as is illustrated in FIGS. 4A-4D for the four possible residue digit values m2=0, 1, 2, and 3. These tabulations can be simplified by rewriting them in modulo p1*p3=modulo 15 form as is shown in FIGS. 5A-5D. Consideration of the representations there and the modulo p2=4 values of the modulo p1*p3 remainders there (i.e., 0, 6, 12, 3, 9 for m1=m2=0 and m3=0 through 4) reveals that decimal numbers in squares of these four FIGS. 5A-5D satisfy the representations in FIG. 6 such that the four FIGS. 5A-5D may be represented by a single mapping in FIG. 7 containing only the modulo p1*p3 remainders in FIGS. 5A-5D. This is accomplished by realizing that addition constants 0d, 1d, 2d and 3d are congruent modulo p2=4 to the remainder values above them in these tables multiplied by the constant d=p1*p3=15 and by utilizing substitutions from FIG. 6. Thus, these four tables in FIGS. 5A-5D reduce to the single FIG. 7 which contains all of the information necessary to uniquely describe the mapping between decimal numbers X and the corresponding-selected 3-moduli set of RNS numbers. Consideration of the mapping table in FIG. 7 reveals that in general a two dimensional m1,m3 structure is described here with values following a well ordered diagonal pattern such that for a prescribed two dimensional RNS (p1=2 The requisite three dimensional mapping is obtained by adding an appropriate constant S2 which accomplishes the substitution of FIG. 6 and which is defined as ##EQU5## where nlsb designates the n less significant bits and m2'(m2) is an element of the set (0,p2-1)=(0,3) in the example here where n=2. The values of m2'(m2) are shown in FIG. 6 for the selected RNS in this example where n=2. The desired three dimensional representation of a decimal number may therefore be expressed as
r(m1,m2,m3)=r(m1,m3)+S2 (24) Referring now to FIG. 8, an analog signal on line 10 is applied to a residue signal processor 12 which produces unique digital signals on pluralities of output lines 21, 22 and 23. Each of these digital signals defines a binary number designating an associated one of the residue digits m1, m2 and m3 of residue numbers in the selected RNS. The residue number represented or defined by m1,m2 and m3 is applied to the residue to binary converter 14 embodying this invention which converts it to a binary signal on lines 16. This is signal converted back to an associated analog signal by the D/A converter 18. The processor 12 here typically comprises a circuit for sampling the analog signal, in response to a clock signal on line 11, at a prescribed rate as is well known in the art. The analog samples are converted to representative residue number signals in an analog to residue converter and are then operated on to accomplish some prescribed function such as digital filtering, with the resultant digital residue signal being defined by the residue number digit signals m1, m2 and m3 on lines 21-23. The residue digits m1 and m2 are defined by n=2 (in this example) binary bits on associates pairs of lines 21 and 22. The residue digit m3 requires n+1=3 lines since the modulus p3=2 The residue to binary converter 14 comprises a pair of memory devices 26 and 36 which may be read only memories (ROMs) and a pair of binary adders 34 and 44 which may be standard binary adders. ROM 26 contains a look-up table for effectively performing multiplication of m1 and m3 by associated constants S3 and S1, and addition modulo p1*p3=15 of associated product signals as is specified by equation (12). Individual memory locations are addressed by the residue digits m1 and m3 which are combined on lines 25 to make up a single 2n+1 bit digital address word. The ROM 26 requires at least p1*p3=15 memory locations, each being 2n=4 bits long where n=2, for storing all possible values of r(m1,m2) as given by equation (12). The output signal of ROM 26 is a 2n=4 bit word defining the two dimensional vector representation r(m1, m3) of the binary equivalent of the residue number {m1,m2,m3}, where lines 28 contain the n less significant bits and lines 29 contain the n more significant bits thereof, and the 2n lines 30 contain the combined signals on lines 28 and 29. The two dimensional digital output signal r(m1, m3) on lines 30 is applied to one input of binary adder 44. The correction signal S2 must be generated and applied to the other input terminal of adder 44 in order to produce an output signal on lines 16 which satisfies the equation (24). Recognizing that the n less significant bits of r(m1,m3) on lines 28 and 32 correspond to r(m1,m2) modulo p2=2 The ROM 36 contains a look-up table for effectively multiplying the variable m2'(m2) on lines 35 by the constants p1 and p3, i.e., by 2 Although this residue to binary converter 14 requires memory elements, it has particular advantage in that the adders are all conventional binary adders which are relatively straightforward to design and implement and which are relatively fast. The limitation on speed here is dictated by the access time of the memories. The memories also require considerably more surface area of an integrated circuit chip than do binary adders. Currently the practical limit for implementing a single integrated circuit residue to binary converter 14 is for n=6. Then the size of ROM 36 is 49,152 bits, which is possible to implement with a 64k bit ROM. The binary adders 34 and 44 are then 6 bit and 18 bit devices. The period M=p1*p2*p3 for this converter is M=63*64*65=262,080=2 Alternatively, ROMs having greater than 64k of memory may be employed as smaller IC geometries become available. This allows n to be larger and thus the period to be increased. By way of example, with a 256k ROM (where 229,362 bits are actually needed), n can be increased to 7 so that the total period is increased to 2,097,024≃2 An alternate embodiment of this invention in which the second ROM 36 is replaced by a conventional binary adder 46 and a bit shift means 48 is illustrated in FIG. 9. As stated previously, the adder 34 produces a digital signal on lines 35 satisfying the relationship (21) which must be multiplied by the constant p1*p3=2 A preferred embodiment of this invention which does not require any memory devices is illustrated in FIG. 10. Recognizing that equation (14) can be rewritten as equation (15) reveals that the two dimensional residue signal r(m1,m3) may be obtained by multiplying the sum and difference of m1 and m3 by powers of two and combining them modulo p1*p3. The desired sum and difference signals are obtained with binary adders 60 and 64 which may be implemented with less than the standard n+2 binary output bits where it is confirmed that there will be no overflow produced during operation thereof. Otherwise standard binary adders here take into account any overflow resulting from an internally generated carry operation. If the adders 60 and 64 employ more output lines than are actually required to define the output signal thereof, ones of the more significant bits thereof are merely stuffed with binary 0's so that they are effectively ignored or out of the circuit. The desired multiplications are accomplished in FIG. 10 by connecting 2n-1 lines 61 and n-1 lines 65 to ground and inserting the binary 0 bits on these lines as the less significant bits of the binary signals on lines 62 and 66 from the adders 60 and 64, respectively. This bit shifting of the output signals of the adder gives binary signals on the 3n+1 and 2n lines 63 and 67 which represent the 2 terms within equation (15). These signals are summed in a modulo p1*p3=2 Consideration of the operation of the modulo adder 70 in FIG. 10 as defined by equation (15) reveals that the latter is of the form ##EQU6## which can be written as ##EQU7## where |S| Since it is easier to implement a division operation in hardware by powers of 2 that involve only a shift towards the least significant bit, equation (25.3) can be rewritten as ##EQU8## which may be rewritten as ##EQU9## This is possible because ##EQU10## where k is a positive integer. Substituting ##EQU11## into equation (26.1) one gets ##EQU12## Omitting the quantity -1 in the denominator of equation (25.2) so as to only divide by 2 For the selected RNS system where p1=2
(|a+b| By subtracting the modulus and adding k times the modulus to each side of equation (33), the expression
(R-(2 is obtained. Now dividing both sides of equation (34) by the modulus (which modulus here is taken as greater than (0), one obtains the expression ##EQU14## which shows that R An alternate evaluation of the k term and the maximum value thereof will now be presented. From the definition of an RNS representation it is known that
|S| since S can only take on values from 0 to W-1 where the explanation point means "by definition." Therefore equation (26.4) can be written as
|(a+b)| or
R-W<k*W (40) Since W is >0, both sides of equation (40) can be divided by W without changing the inequality sign, i.e., ##EQU17## This states that the smallest possible value of k (which must be an integer) must be larger than the R, which corresponds to a given (a+b) as expressed by equation (26.3). Since k must be an integer it follows from equation (41) that the smallest possible value of k is ##EQU18## since k must be an integer. By substituting R from the equation (26.3) into equation (42) then equation (42) becomes ##EQU19## where [ ] denotes the integer part of the quantity therein. It will be remembered that R here is a function of both a and b and thus k is a function of these variables. The quantity R is given by equation (26.3) and can be rewritten as ##EQU20## Since the largest I occurs for (a+b) Thus
a
b Substituting these values of a If a and b are chosen such that (a+b)/2
(a+b) and
W*I1=W*(I This means that the positive part of equation (44) is only 1 less than the maximum and the negative part of equation (44) is W times smaller than the maximum. Hence, from equation (44) one obtains ##EQU24## Substituting in equation (53) from equations (47), (48) and (49) gives
R in this instance. Substituting this value of R Referring now to FIG. 11, the digital signals a and b (which corresponds to the first and second terms in equation (15)) on the 3n+1 and 2n lines 63 and 67 are combined in the binary adder 71 which takes into consideration any overflow caused by a carry that is generated during operation thereof. The output of adder 71 is comprised of 2n less significant bits and n+2 more significant bits on associated pluralities of lines 81 and 82, respectively, which are combined on the 3n+2 lines 83. This signal on lines 83 corresponds to the first term on the right in equation (26.1). The n+2 more significant bits on lines 86 corresponds to the integer value of (a+b)/2 The comparator circuit 77 has a binary representation of the constant (2 When the limits for a+b in FIG. 11 are much higher than 2 Another embodiment of the modulo p=p1*p3=2 Although this invention is described in relation to preferred embodiments thereof, variations and modifications thereof are possible. By way of example, the operation time of the residue to binary converters and the modulo adder may be decreased by pipelining various ones of the adders and/or memory devices, and by employing time shared and/or carry-look ahead binary adders. Also, various ones of the adders and/or memory devices of the converters and modulo adder may be clocked in a manner which is well known in the art, although this is not essential to the operation thereof. The scope of this invention is therefore to be determined from the appended claims rather than from the aforementioned detailed descriptions of preferred embodiments thereof. Typically, n is positive and is between 7 and 12 for a medium moduli RNS here. The value of n may be greater than 12 for a large moduli RNS here. Non-Patent Citations
Referenced by
Classifications
Legal Events
Rotate |