The present invention relates to carry save adders and in particular but not exclusively to carry save adders which are able to reduce the number of partial products to two.
In digital arithmetic, partial products are obtained when two numbers are multiplied together. The number of partial products will depend on the method used for obtaining the partial products. In a conventional operation, the number of partial products may be equal to the number of bits in the multiplier. However, techniques such as Booth encoding make it possible to reduce the number of partial products obtained. For example Booth coding allows the number of partial products to be reduced by a factor of 2. The Booth encoding method is sometimes referred to as the Booth-MacSorley algorithm.
In the Booth coding method, a triplet of bits of the multiplier is input to a Booth coder which provides three outputs, the values of which depends on the input values. The outputs of the Booth coder are then used to modify bits of the number to be multiplied by the multiplier.
Carry save adders which reduce three partial products to two partial products are known. This type of carry save adder is sometimes referred to as a 3 to 2 carry save adder. Such a carry save adder is in fact a full adder. A full adder is a binary logic circuit which produces a two-bit sum where one bit represents the sum and the other bit represents the carry when three one bit binary numbers are added together. The three one bit numbers may be corresponding bits from three partial products.
Carry save adders which reduce four partial products to two partial products are also known. This type of carry save adder is known as a 4 to 2 carry save adder. One example of such a carry save adder is shown in the IEEE Journal of Solid State circuits, Vol 30, No 3, March 1995: “A 4.4 ns CMOS 54×54-b using pass-transistor multiplexer”, page 251 to 257, N Ohkubo et al. This structure generally yields faster partial product compression than the use of 3 to 2 carry save adders. The 4 to 2 carry save adder actually compresses five partial products into three and is therefore sometimes referred to as a 5 to 3 carry save adder. This carry save adder is connected in such a way that four of the inputs are corresponding bits from four partial products whilst the fifth input is fed from a neighbouring adder and is known as the “carry in”. The output of this carry save adder consists of one sum bet and two carry bits. One of these carry bits is input to a neighbouring carry save adder and forms one of the five inputs of that carry save adder.
It is an aim of embodiments of the present invention to provide a carry save adder unit which is capable of compressing more than five inputs to a smaller number of outputs.
According to one aspect of the present invention, there is provided a carry save adder for reducing the number of inputs to a lower number of outputs, said carry save adder comprising four carry save adders, said four carry save adders being arranged in two layers with the first and second carry save adders being arranged in a first of said layers and the third and fourth carry save adders being arranged in a second of said layers, said third and fourth carry save adders being arranged to provide said outputs, said third and fourth carry save adders each receiving at least one output from each of said first and second carry save adders and the first and second carry save adders being arranged to receive at least some of said inputs.
This arrangement permits a relatively short routing between the carry save adders to be achieved. This may also improve timing.
At least one of the inputs may be input to at least one of the third and fourth carry save adders.
The carry save adder circuit may be a 9 to 4 carry save adder circuit. The first carry save adder may be a 5 to 3 carry save adder and the second, third and fourth carry save adders may be 3 to 2 carry save adders. The first to fifth inputs may be input to the first carry save adder and the sixth to eighth inputs may be provided to the second carry save adder. The ninth input may be input directly to one of the third and fourth carry save adders.
The carry save adder circuit may alternatively be a 7 to 4 carry save adder circuit. The first to third carry save adders may be 3 to 2 carry save adders and the fourth carry save adder may be a half adder. The first to third inputs may be input to the first carry save adder and the fourth to sixth inputs may be provided to the second carry save adder. The seventh input may be input directly to one of the third and fourth carry save adders.
According to a second aspect of the present invention there is provided a carry save adder circuit for reducing nine inputs to four outputs, said carry save adder circuit comprising four carry save adders, the first carry save adder being a 5 to 3 carry save unit and the second, third and fourth carry save adders being 3 to 2 carry save adders.
According to a third aspect of the present invention there is provided a carry save adder circuit for reducing seven inputs to four outputs, said carry save adder circuit comprising four carry save adders, the first, second and third carry save adders being 3 to 2 carry save adders and the fourth carry save unit being a half adder.
According to a fourth aspect of the present invention there may be provided an arithmetic unit for processing a plurality of partial products, said unit comprising a plurality of carry save adder circuits as claimed in any preceding claim, wherein the inputs to each of said carry save adder circuits are provided by said plurality of partial products.
For a better understanding of the present invention and as to how the same may be carried into effect, reference will now be made by way of example to the accompanying drawings in which:
Reference will first be made to
The truth table for the carry save adder of
The carry save adder 4 of
Reference is now made to
The first carry save adder 22 receives the first five inputs l1–l5. These first five inputs represent bits from the first to fifth partial products. The second carry save adder 24 receives the sixth, seventh and eighth inputs l6, l7 and l8 representing bits from the sixth to eighth partial products.
The sum output S of the first carry save adder 22 provides the third output c of the fourth carry save adder 28. The first carry output C01 of the first carry save adder 22 provides the third input c of the third carry save adder 26. The second carry output C02 of the first carry save adder 22 provides the second input b of the third carry save adder 26.
The sum output S of the second carry save adder 24 provides the second input b of the fourth carry save adder 28. The carry output C01 of the second carry save adder 24 provides the first input a of the third carry save adder.
The third carry save adder 26 therefore receives all three of its inputs a to c from the outputs of the first and second carry save adders 22 and 24. The fourth carry save adder 28 thus has its second and third inputs b and c provided by the outputs of the first and second carry save adders 22 and 24. The first input a of the fourth carry save adder 28 is provided by the ninth input l9 from the ninth partial product.
The fourth carry save adder 28 provides a sum output S (significance 2i) and a first carry C02A of significance 2i+1. The third carry save adder 26 generates a second carry C02B of significance 2i+1 and a third carry C04 of significance 2i+2. This assumes that each of the inputs I1 to I9 have a 2i significance.
It should be appreciated that the interconnections described in relation to
The carry save adder 20 of
In preferred embodiments of the present invention, the carry save adder 20 can be laid out in such a way as to reduce the number of wires crossing large distances. This is because there are only four cells and they can be arranged next to each other in a compact arrangement. With this arrangement the routing problems can be reduced as compared to structures such as the Wallace tree.
Reference is made to
In the embodiment shown in
Each partial product P0 to P8 has n bits. One bit from each of the partial products is input to the carry save adder 20 of
The number of carry save adders 20 which are provided is defined by the following equation:
number of bits=n+2(p−1) where
As discussed above, there are not always 9 bits. For example column 5 only has three bits. In those circumstances it is not necessary to use the 9 to 4 adder. Instead, a 3 to 2 carry save adder can be used. Accordingly, the carry save adder for each column can be selected in accordance with the number of bits which are to be added.
Each carry save adder provides four outputs as discussed in relation to
These four partial products 34 to 40 which receive the outputs of the carry save adder 20 are input to respective 4 to 2 adders which reduce the number of partial products to two. These two partial products can then be summed to provide a single result.
Reference in now made to
The first carry save adder 52 receives the first to third inputs 11, 12 and 13. The second carry save adder 54 receives the fourth fifth and sixth inputs 14, 15 and 16. The sum output S of the first carry save adder 52 provides the first input a to the third carry save adder 56. The sum output of the second carry save adder 54 provides the second input b to the third carry save adder 56. The third input to the third carry save adder 56 is provided by the seventh input 17.
The fourth carry save adder 58 receives the carry output C01 of the first and the second carry save adders which provide the first and second inputs a and b respectively.
The output of the third carry save adder provides the output S as its sum output and the output C02A as its carry output. The sum output of the fourth carry save adder 58 provides the second carry output C02B output whilst the carry output of the fourth carry save adder 58 provides the carry output C04. These outputs have the same significance or weight as those outputs of the 9 to 4 carry save adder shown in
The seventh input l7 is faster than the other inputs in that it only has to pass through one of the carry save adders. The first and second carry save adders 52 and 54 receive the first six inputs l1 to l6. The first and second carry save adders 52 and 54 effectively provide a first layer. The third carry save adder 56 and the half adder 58 provide a second layer and receive the respective outputs from the first layer as well as the seventh input l7. In practice, the adders making up the carry save adder of
The carry save adder of
It should be noted that, as with the carry save adder of
Again a 4 to 2 carry save adder can be provided to reduce the number of partial products to two.
The arrangement of both the 9 to 4 and the 7 to 4 carry save adders allow short routings to be achieved between the carry save adders. This improves both timing and routing of these carry save adders. This is particularly advantageous when embodiments of the present invention are incorporated in an integrated circuit.
Reference is made to
This means that the carry propagation is only done from one carry save adder to the next. The respective inputs A to D to each of the carry save adders 6 may represent adjacent bits from four partial products. For example, the first carry save adder 6a receives the nth bit of first, second, third and fourth partial products with the second and third carry save adders 6b and c receiving the n+1 and n+2 bits respectively of those same partial products.
Reference will now be made to
The second exclusive OR gate 82 receives the second and third inputs B and C as its two inputs.
The first NAND gate 84 receives an input from the second and third inputs B and C. The second NAND gate 86 receives its input from the first and third inputs A and C whilst the third NAND gate 88 receives its inputs from the first and second inputs A and B. The output of each of the first to third NAND gates 84 to 88 provide the inputs to the fourth NAND gate 90, the output of which provides the carry output C.
Reference is made to
The 5 to 3 carry save adder 91 comprises six multiplexers 92, 93, 94, 96, 98 and 99 each of which has the construction shown in
The second multiplexer 93 receives the second signal 12 and its inverse. A second inverter 102 is provided for inverting the second input 12. The select signal is provided by the first input 11. The third multiplexer 94 receives the first and third inputs 11 and 13 and the output of the second multiplexer 93 provides its select signal. The output of the third multiplexer 94 is input to a first buffer 104. The output of the first buffer 104 provides the second carry output C02.
The fourth multiplexer 96 receives the output of the first multiplexer 92 and its inverse. A third inverter 106 is provided for inverting the output of the first multiplexer 92. The output of the second multiplexer 93 provides the select signal for the fourth multiplexer 96.
The fifth multiplexer 98 receives the carry input Ci and the fourth input 14 as inputs and the output of the fourth multiplexer 96 as the select signal. The output of the fifth multiplexer 98 is input to a second buffer 108, the output of which provides the first carry output C01.
The final multiplexer 99 receives the carry input Ci and its inverse. A fourth inverter 110 is provided to provide the inverse of the carry input Ci. The select signal is provided by the output of the fourth multiplexer 96. The output of the sixth multiplexer is input to a third buffer 112, the output of which provides the sum output S.
The arrangement of
Reference is made to
In the first pair of transistors 150, the p-type transistor 120 receives the select signal Z whilst the n-type transistor 128 receives the inverse of the select signal Z. This arrangement also applies to the third pair of transistors 154 comprising of the third p-type transistor 124 and the third n-type transistor 132.
The second and fourth pairs of transistors 152 and 156 are such that the n-type transistors 130 and 134 receive the select signal Z whilst the p transistors 124 and 126 respectively receive the inverse of the select signal Z.
The circuitry for the carry save adders is by way of example only and any other suitable circuitry can be used.
Embodiments of the present invention may be incorporated in a digital signal processor. Embodiments of the present invention may be incorporated in an integrated circuit.
Having thus described at least one illustrative embodiment of the invention, various alterations, modifications, and improvements will readily occur to those skilled in the art. Such alterations, modifications, and improvements are intended to be within the spirit and scope of the invention. Accordingly, the foregoing description is by way of example only and is not intended as limiting. The invention is limited only as defined in the following claims and the equivalents thereto.
Number | Date | Country | Kind |
---|---|---|---|
00410092.1 | Aug 2000 | EP | regional |
Number | Name | Date | Kind |
---|---|---|---|
4604723 | Burrows | Aug 1986 | A |
4769780 | Chang | Sep 1988 | A |
4901270 | Galbi et al. | Feb 1990 | A |
5343416 | Eisig et al. | Aug 1994 | A |
5347482 | Williams | Sep 1994 | A |
5497342 | Mou et al. | Mar 1996 | A |
5808928 | Miyoshi | Sep 1998 | A |
5978827 | Ichikawa | Nov 1999 | A |
6018758 | Griesbach et al. | Jan 2000 | A |
6442582 | Hale | Aug 2002 | B1 |
6615229 | Vijayrao et al. | Sep 2003 | B1 |
20020073127 | Hossain | Jun 2002 | A1 |
Number | Date | Country | |
---|---|---|---|
20020038327 A1 | Mar 2002 | US |