The present invention generally relates to the computation of binary numbers, and more particularly to the efficient conversion of binary numbers into sign-digit redundant form.
In order to build compact binary multipliers, the sign-digit representation of a binary number is used in the hardware design. If a digit of the binary number is made wider, then the total number of digits is reduced. Accordingly, certain radix digits are chosen for the desired numbering system. The most popular system uses sign-digit numbers with radix 4. Accordingly, each two bits of a number are substituted by a digit which has a value from the set of {−2, −1, 0, 1, 2}. An advantage of this radix system is that a partial product generated by multiplying the digit by a second argument involves only simple logic operations to produce. For instance, the partial product may be generated by masking, shifting by one and inversion. Accordingly, instead of generating n partial products for a n-bit binary number, only n/2+2 partial products are generated.
After all the partial products have been generated during multiplication, then the partial products are added together using the well-known Wallace Tree. The Wallace Tree reduces the number of partial products at each stage without full carry propagation. The Wallace Tree functions as a “carry-save” adder (CSA) and does not make use of full carry propagation. The output of the CSA is a carry save-number which contains the partial sum of the number and all of the carries. In order to compute the final value, a carry propagation adder (CPA) is used to add the carries. Typically, the CPA has a larger delay by comparison to the CSA.
Referring to
The present invention addresses the above-mentioned deficiencies in computation of binary numbers by providing a system and method that reduces circuit complexity and latency in the computation. Specifically, the present invention provides a method whereby the gate count for the computational circuit is reduced compared to the circuit of
In accordance with the present invention, there is provided a method for partial adding and converting two numbers having binary digits into a redundant sign-digit format. The method uses partial propagation of the carry of the sum regarding the desired radix of the Booth encoder. The radix is used as a bias for interim results. The binary digits of each number are added together with a first adder in order to generate a first result with a first carry. A second adder adds the first result to a first input carry of a previous digit. A value equal to the radix of the binary digits is subtracted from the first result with the second addition block if the first result is greater than an initial threshold such that an intermediate result and a second carry is generated. A third adder adds the intermediate result to a second input carry of the previous digit. With the third adder, the value of the radix is subtracted from the intermediate result if the intermediate result is greater than a prescribed value in order to generate a final output in redundant sign-digit format. The method is continued for all sets of binary digits.
In accordance with the present invention, there is also provided a system for multiplying the sum of a first number A and a second number B by a third number C. The system has a first adder configured to add the binary digits of A and B together and generate a first result with a first carry. The system also includes a second adder block configured to add the first result to the first input carry of a previous digit. Furthermore, the second adder is configured to subtract the value of the radix from the first result if the first result is greater than an initial threshold in order to generate an intermediate result with a second carry. The system includes a third adder configured to add the intermediate result to a second input carry of a previous digit and subtract the value of the radix from the intermediate result if the intermediate result is greater than a prescribed value. In this regard, the first, second, and third adders are configured to add and convert the numbers A and B into sign-digit redundant format. The system further includes a multiplier configured to multiply the redundant sign-digit format of the addition of A and B from the third adder by the value of C in order to generate the final result.
In addition to the foregoing, there is provided a method for multiplying the sum of a first number A having binary digits and a second number B having binary digits by a third number C. The binary digits of A and B are added together in order to generate the first result with the first carry. The first result is added to the first input carry of the previous digit. Then, the value of the radix is subtracted from the first result if the first result is greater than an initial threshold in order to generate the intermediate result with the second carry. The intermediate result is added to the second input carry of the previous digit and the radix is subtracted from the intermediate result if the intermediate result is greater than a prescribed value. This result is the sum of A and B expressed in sign-digit redundant format. Then, the sign-digit redundant format of the sum of A and B is multiplied with C in order to generate the final result.
These, as well as other features of the present invention, will become more apparent upon reference to the drawings wherein:
Referring now to the drawings wherein the showings are for purposes of illustrating a preferred embodiment of the present invention only, and not for purposes of limiting the same,
The CSA to booth encoder 22 provides a novel manner to convert the sum of A and B into sign-digit redundant form for multiplication by C in multiplier 24.
Di=a1i·2+a0i+b1i·2+b0iDiε{0 . . . 6} (1)
wherein a1i, a0i, and b1i, b0i are the respective two bit binary digit representations for A and B on the digit position i.
Next, a threshold value nt is declared to be:
nt: ntε{2 . . . 5} (2)
Accordingly, then the output carry signal C1out is determined with comparator 42 to be:
After adding the input carry from the previous digit C1in with adder 44, the value of an intermediate result D1i is:
D1i=Di+C1in−C1out·r (4)
D1iε{min(nt−4,0) . . . (nt, 2)} (5)
Wherein the bias r=4 is the radix of the binary system used.
At this stage the output carry C2out can be declared to be with comparator 46:
The value of the final digits converted into redundant sign-digit format D2i after adding the input carry from the previous digit C2in with adder 48 becomes:
D2i=D1i+C2in−C2out·rD2iε{−2,−1,0,1,2} (7)
wherein the bias r=4 is the radix of the binary system used.
As will be recognized, D2i is in sign digit format because it is an element of the set {−2, −1, 0, 1, 2}. This is the digit representation that reduces multiplication steps in the multiplier 24.
Referring back to
Referring to Table 1, an example showing the conversion of two binary numbers into sign-digit redundant format is shown. In this example, the threshold value n, is selected to be nt=4. Table 1 shows the resultant values of D and C using the method of the present invention. As can be seen, the method converts the two binary numbers into sign-digit redundant form while adding their values together to achieve the result: D2=111−11=333. As previously discussed, the resultant values can then be multiplied by multiplier 24 with the value of C to achieve the final result.
More specifically, Table 1 describes the situation wherein:
a=162=(10100010)2 (8)
b=171=(10101011)2 (9)
a+b=162+171=(10100010)2+(10101011)2=333 (10)
wherein, A3=(10)2, A2=(00)2, A1=(10)2 and A0=(10)2 (16)
Further define Aj:
Aj=(a1j·21+a0j·20)=(a1j·2+a0j) (17)
Because A3=(10)2, then a13=1 and a03=0.
Similarly:
a12=1, a02=0 (18)
a11=0, a01=0 (19)
a10=1, a00=0 (20)
wherein, B3=(10)2, B2=(10)2, B1=(10)2, B0=(11)2,
Further define Bj:
Bj=(b1j·21+b0j·20)=(b1j·2+b0j) (27)
Accordingly:
b13=1, b03=0 (28)
b12=1, b02=0 (29)
b11=1, b01=0 (30)
b10=1, b00=1 (31)
And thus:
According to Eq. (1):
D0i=(a1i·2+a0i)+(b1i·2+b0i) (35)
D0i=(Aj+Bj); and (36)
D03=(1·2+0)+(1·2+0)=4 (37)
D02=(1·2+0)+(1·2+0)=4 (38)
D01=(0·2+0)+(1·2+0)=2 (39)
D00=(1·2+0)+(1·2+1)=5 (40)
As stated previously, in equation (3), C1i=1 if D0i≧nt, otherwise C1i=0 if D0i<nt where ntε{2 . . . 5}. In this example, nt=4. Accordingly:
=C13=1 (41)
C12=1 (42)
C11=0 (43)
C10=1 (44)
Therefore:
Accordingly:
D14=D04+(C13−C14·4)=0+1−0·4=1 (47)
D13=D03+(C12−C13·4)=4+1−1·4=1 (48)
D12=D02+(C11−C12·4)=4+0−1·4=0 (49)
D11=D01+(C10−C11·4)=2+1−0·4=3 (50)
D10=D00+(0−C10·4)=5+0−1·4=1 (51)
As previously described, C21=1 if D1i≧2, otherwise C2i=0 such that:
C24=0 (52)
C23=0 (53)
C22=0 (54)
C21=1 (55)
C20=0 (56)
Therefore:
D2i=Dli+C2i-1−C2i·r (57)
Accordingly:
D24=D14+(C23−C24·4)=1+0−0·4=1 (58)
D23=D13+(C22−C23·4)=1+0−0·4=1 (59)
D22=D12+(C2i−C22·4)=0+1−0·4=1 (60)
D21=D11+(C20−C21·4)=3+0−1·4=−1 (61)
D20=D10+(0−C20·4)=1+0−0·4=1 (62)
Therefore, arranging this information into Table 2:
The previous example show the multiplication of binary numbers in radix 4, however it is possible to compute numbers in other radixes such as radix 8 and 16, etc. . . . . Additionally, the bias r for D1i and D2i depends on the radix chosen. Specifically, in the examples for equations (4) and (7) the bias r is chosen as 4 as the radix of the number system used. However, r would be 8 or 16 for number systems with radixes 8 or 16 respectively. Furthermore, in order to further optimize the system, the value of nt may be varied. By changing the value threshold value of propagation nt at the first stage of propagation, it is possible to optimize the hardware of the system.
The following equations illustrate the general case for computing the output result D2i. If there is an N-bit digit of a binary CSA number such as N>1, then:
For this N-bit digit the radix r is 2N. A threshold value nt is declared to be:
Then the output carry signal is:
After reading the input carry from the previous digit C1i-1, the value of D1i is:
D1i=Dis+Ci−C1i·r
D1iε{nlow . . . nhigh}
Where:
Accordingly, the lower boundary nlow cannot exceed the desired range even considering any possible carry. The upper boundary nhigh is chosen to fit the digit into the desired range after the second carry. The threshold value range nt is actually determined by both boundaries such that:
The output carry at this second stage is declared to be:
After adding the input carry from the previous digit C2i-1, the value of the output D2i becomes:
which is in the sign-digit representation for radix 2N.
Additional modifications and improvements of the present invention may also be apparent to those of ordinary skill in the art. Thus, the particular combination of parts described and illustrated herein is intended to represent only a certain embodiment of the present invention, and is not intended to serve as a limitation of alternative devices within the spirit and scope of the invention.
Number | Name | Date | Kind |
---|---|---|---|
5113363 | Orsino et al. | May 1992 | A |
6754689 | Bhushan et al. | Jun 2004 | B1 |
20010016865 | Goto | Aug 2001 | A1 |