The present invention relates to an arithmetic circuit for binary digits, and more particularly, to an improved multi-input adder which receives plural binary digits and adds the binary digits.
Further, the present invention relates to a synthesis device for automatically synthesizing the improved multi-input adder, a synthesis method, a synthesis program, and a synthesis program storage medium.
A multi-input adder which performs addition of plural input data is indispensable as a fundamental arithmetic circuit for digital signal processing. Further, there are cases where a fundamental arithmetic circuit such as an adder determines the performance of the whole system, and therefore, a small-sized and high-speed multi-input adder has been demanded.
Up to now, various patent applications for constructions of adders have been filed (for example, refer to Patent Document 1, Patent Document 2, and Patent Document 3).
For example, the inputted data of the plural binary digits correspond to partial products that are calculated when a multiplication result is obtained in a multiplier.
In order to obtain a multiplication result by adding the partial products shown in
The half adder shown in
In the example of
To be specific, when a digit having a certain weight comprises 1 bit, neither the half adder nor the full adder is allocated (MSB and LSB),
when it comprises 2 bits, a half adder is allocated (HA1 at the 2nd bit or HA4 at the 10th bit),
when it comprises 3 bits, a full adder is allocated (FA1 at the 3rd bit or FA8 at the 9th bit),
when it comprises 4 bits, a full adder is allocated to 3 bits (FA2 at the 4th bit or FA7 at the 8th bit),
when it comprises 5 bits, a full adder and a half adder are allocated (FA3 and HA2 at the 5th bit or FA6 and HA3 at the 7th bit), and
when it comprises 6 bits, two full adders are allocated (FA4 and FA5 at the 6th bit).
In this example, four stages of operation blocks are required.
In
In the example of
In
In the construction of
As described above, in the circuit construction shown in
On the other hand, in the circuit construction shown in
Hereinafter, a description will be given of the manner of constituting the second-stage operation block with reference to
In
In this specification, it is called as “constitution” to determine inputs to the next-stage operation block as shown in the center of
Further, the least significant bit of the second-stage operation block has a register R211 which stores one bit that is outputted from the register R111 of the first-stage operation block. The second bit of the second-stage operation block has a register R221 which stores a sum outputted from the half adder HA1 of the first-stage operation block. The third bit of the second-stage operation block has a register R231 which stores a carry outputted from the half adder HA1 of the first-stage operation block, and a register R232 which stores a sum outputted from the full adder FA1 of the first-stage operation block. The constitutions of the bits higher than the third bit will be omitted in description.
By the way, in the fourth-stage operation block (2d) shown in
When this final stage is constituted such that addition is carried out inside the final stage by using a CLA (Carry Look Ahead) method, a final sum of the multi-input adder can be obtained.
As shown in
Thereafter, similar processing is repeated, and a sum obtained at the twelfth bit is assigned as an addition result at the twelfth bit, and a carry thereof is assigned as a most significant bit of the addition result to the heads of the addition results from the twelfth bit to the least significant bit, thereby obtaining a final addition result.
Patent Document 1: Japanese Published Patent Application No. Hei.5-6262 (Page 2,
Patent Document 2: Japanese Published Patent Application No. Hei.5-233226 (Pages 2-3,
Patent Document 3: Japanese Published Patent Application No. Hei.6-348457 (Pages 5-7,
By the way, in the conventional multi-input adder, it is not easy to realize miniaturization and speeding-up of the circuit simultaneously, and as shown in
The present invention is made to solve the problems in the above-mentioned prior arts and has for its object to provide a multi-input adder which can simultaneously achieve miniaturization and speeding-up of the circuit, and can simultaneously reduce the number of stages of operation blocks and the number of half adders and full adders, and furthermore, a synthesis device for such multi-input adder, a synthesis method, a synthesis program, and a synthesis program storage medium.
An adder according to claim 1 of the present invention is an adder having plural stages of operation blocks, each operation block including at least either of half adders and full adders and having inputs of plural digits, wherein, in an operation block which is three stages prior to a final-stage operation block, a half adder is provided at a digit which is located by one digit upper than a digit having two carries of a full adder, and has five inputs.
According to the adder relating to claim 1 of the present invention, the number of inputs to the particular bits of the operation block that is two stages prior to the final stage, eventually, the number of stages of the operation blocks, are reduced, thereby providing a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up.
Further, according to claim 2 of the present invention, in the adder defined in claim 1, the inputs of plural digits are signed integers or signed decimals.
According to the adder relating to claim 2 of the present invention, it is possible to obtain a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up even when the adder receives signed integers or signed decimals.
Further, according to claim 3 of the present invention, in the adder defined in claim 1, the inputs of plural digits are outputs from a partial product operation circuit which calculates partial products of inputs of multipliers.
According to the adder relating to claim 3 of the present invention, it is possible to obtain a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up even when the adder receives partial products.
Further, according to claim 4 of the present invention, in the adder defined in claim 3, the inputs of the multipliers are signed integers or signed decimals.
According to the adder relating to claim 4 of the present invention, it is possible to obtain a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up even when the adder receives partial products of signed integers or signed decimals.
Further, according to claim 5 of the present invention, in the adder defined in claim 1, the inputs of plural digits are outputs of a partial product operation circuit which calculates partial products of multipliers disposed in an input stage of an FIR (Finite Impulse Response) filter.
According to the adder relating to claim 5 of the present invention, it is possible to obtain a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up even when the adder receives partial products from the respective multipliers in an input stage of an FIR filter.
Further, according to claim 6 of the present invention, in the adder defined in claim 5, the inputs of the FIR filter are signed integers or signed decimals.
According to the adder relating to claim 6 of the present invention, it is possible to obtain a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up even when the adder receives signed integers or signed decimals as partial products from the respective multipliers in an input stage of an FIR filter.
Further, according to claim 7 of the present invention, in the adder defined in claim 5, the FIR filter has signed integers or signed decimals as factors.
According to the adder relating to claim 7 of the present invention, it is possible to obtain a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up even when the adder receives signed integers or signed decimals as partial products from the respective multipliers in an input stage of an FIR filter.
Further, according to claim 8 of the present invention, in the adder defined in claim 1, in each stage of the operation block, a half adder is provided at a digit which is positioned at the least significant side and has inputs the number of which is not one, and has two inputs.
According to the adder relating to claim 8 of the present invention, the number of inputs to the particular bits in the next-stage operation block, eventually, the number of stages of the operation blocks are reduced, thereby providing a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up.
Further, according to claim 9 of the present invention, in the adder defined in claim 8, a half adder is provided in an operation block which is one stage prior to a final-stage operation block.
According to the adder relating to claim 9 of the present invention, the number of inputs to the particular bits in a final-stage operation block, eventually, the number of stages of the operation blocks are reduced, thereby providing a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up.
Further, according to claim 10 of the present invention, in the adder defined in claim 9, in an operation block which is one stage prior to a final-stage operation block, a half adder is provided at a digit which is lower than a digit that is positioned at the most significant side and has inputs the number of which is one.
According to the adder relating to claim 10 of the present invention, since a half adder is provided at a bit that is lower than the most significant bit where the number of inputs is one, the number of inputs to the particular bits in the final-stage operation block, eventually, the number of stages of the operation blocks can be reduced, thereby providing a multi-input adder that can achieve simultaneous pursuit of circuit scale reduction and speed-up.
Further, according to claim 11 of the present invention, there is provided a synthesis device for an adder having plural stages of operation blocks, each operation block including at least either of half adders and full adders and having inputs of plural digits, wherein, in an operation block which is three stages prior to a final-stage operation block, a half adder is allocated to a digit which is located by one digit upper than a digit having two carries of a full adder, and has five inputs.
According to the adder synthesis device relating to claim 11 of the present invention, a synthesis device for automatically synthesizing a multi-input adder which can reduce the number of inputs to the particular bits of the operation block two stages prior to the final stage, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
Further, according to claim 12 of the present invention, in the adder synthesis device defined in claim 11, in each stage of the operation block, a half adder is allocated to a digit which is positioned at the least significant side and has inputs the number of which is not one, and has two inputs.
According to the adder synthesis device relating to claim 12 of the present invention, a synthesis device for automatically synthesizing a multi-input adder which can reduce the number of inputs to the particular bits of the next-stage operation block, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
Further, according to claim 13 of the present invention, in the adder synthesis device defined in Claim 12, a half adder is allocated to an operation block which is one stage prior to a final-stage operation block.
According to the adder synthesis device relating to claim 13 of the present invention, a synthesis device for automatically synthesizing a multi-input adder which can reduce the number of inputs to the particular bits of the final-stage operation block, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
Further, according to claim 14 of the present invention, in the adder synthesis device defined in claim 13, in an operation block that is one stage prior to a final-stage operation block, a half adder is allocated to a digit which is lower than a digit that is positioned on the most significant side and has inputs the number of which is one.
According to the adder synthesis device relating to claim 14 of the present invention, a synthesis device for automatically synthesizing a multi-input adder which reduces the number of inputs to the particular bits of the final-stage operation block, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
Further, according to claim 15 of the present invention, there is provided a synthesis method for an adder having plural stages of operation blocks, each operation block including at least either of half adders and full adders and having inputs of plural digits, and the method includes a process of allocating a half adder to a digit which is located by one digit higher than a digit having two carries of a full adder, and have five inputs, in an operation block which is three stages prior to a final-stage operation block.
According to the adder synthesis method relating to claim 15 of the present invention, a synthesis method for automatically synthesizing a multi-input adder which can reduce the number of inputs to the particular bits in the operation block two stages prior to the final stage, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
Further, according to claim 16 of the present invention, there is provided an adder synthesis program which makes a computer perform the adder synthesis method defined in claim 15.
According to the adder synthesis program relating to claim 16 of the present invention, a synthesis program for automatically synthesizing a multi-input adder which can reduce the number of inputs to the particular bits in the operation block two stages prior to the final stage, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
Further, according to claim 17 of the present invention, there is provided an adder synthesis program storage medium in which the adder synthesis program defined in claim 16 is stored.
According to the adder synthesis program storage medium relating to claim 17 of the present invention, an adder synthesis program storage medium for automatically synthesizing a multi-input adder which can reduce the number of inputs to the particular bits of the operation block two stages prior to the final stage, eventually, the number of stages of the operation blocks, thereby achieving simultaneous pursuit of circuit scale reduction and speed-up, can be obtained.
According to an adder of the present invention, since places where half adders are to be used are restricted when constituting a multi-input adder, a compact and high-speed multi-input adder can be realized.
Further, according to an adder synthesis device, synthesis program, and synthesis program recording medium of the present invention, since places where half adders are to be used are restricted when synthesizing a multi-input adder, it is possible to provide a synthesis device, a synthesis program, and a synthesis program recording medium which can synthesize a compact and high-speed multi-input adder.
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
Initially, a multi-input adder according to a first embodiment of the present invention will be described with reference to
Next, the operation will be described. The partial product operation circuit 3 receives two pieces of multi-bit data a and b as shown in
Next, a description will be given of construction of operation blocks.
With reference to
The half adders and the full adders are used under the following conditions.
i) First of all, the full adders are used in all the positions where the full adders can be used. For example, in the first-stage operation block (2a) shown in
ii) Next, a half adder is used only in a position of a bit on the least significant bit side, where the half adder can be used.
For example, in the first-stage operation block (2a) shown in
iii) Next,
a) In an operation block that is three stages prior to the final-stage operation block,
b) at a bit position where the number of input bits is five, and
c) where the number of carry data from the lower bit is two, the full adder is used and thereafter the half adder is used in the position where the half adder can be used.
For example, in the case of
d) Further, in a stage that is one stage prior to the final-stage operation block, half adders are used in all positions where the half adders can be used.
e) However, in the case of d), no half adder is used at a digit where there is no carry from the lower bit.
In the case of
The reason why the half adder HA204 is used for the fourth bit in the third-stage operation block (2c) is based on the rule of ii) mentioned above.
As a result, in the case of
When the constitutional example shown in
The reason is as follows. By allocating a half adder to a position having five inputs in the first-stage operation block (2a) shown in
As described above, according to the first embodiment of the present invention, in the multi-input adder having plural stages of operation blocks, full adders are used in all positions in each operation block where the full adders can be used, and a half adder is used only in a position on the least significant bit side in each operation block, and furthermore, a half adder is used in a position which has five inputs and corresponds to a digit one digit higher than a digit having two carries of a full adder in an operation block that is three stages prior to the final operation block, and a half adder is used at a digit having a carry from the lower bit in an operation block that is one stage prior to the final operation block. Therefore, the number of stages of operation blocks is reduced and thereby the delay time can be reduced, and furthermore, the numbers of full adders and half adders constituting the circuit can be reduced, resulting in a multi-input adder which can achieve simultaneous pursuit of reduction in operation time and reduction in circuit scale.
While in the first embodiment a multi-input adder having six bits of inputs is described as an example, even when the number of input bits becomes larger than six bits, a small-sized and high-speed circuit can be realized by using the same rules as the above-mentioned conditions i) to iii) as the usage conditions of half adders and full adders. This effect increases with an increase in the number of input bits, and the circuit scale can be significantly reduced to, for example, ⅓ of the conventional circuit scale with an increase in the operation speed.
In this case, since the later-stage operation block has smaller number of input bits, the stage where the number of input bits becomes six and the subsequent stages may be constituted like the operation blocks (2a) to (2d) shown in
Further, the constitution of the multi-input adder according to the first embodiment of the present invention can be applied to multi-input adders in circuits shown in
The circuit shown in
However, since a part 1 comprising the adders 5a, 5b, and 5c is a multi-input adder, when this multi-input adder is constituted in like manner as the multi-input adder shown in
Furthermore, while in this first embodiment the inputs to the multi-input adder are positive binary numbers (integers), the inputs may be signed integers, decimals, or signed decimals.
Hereinafter, a description will be given of an automatic circuit synthesis device for automatically synthesizing a multi-input adder which can realize simultaneous pursuit of reduction in circuit scale and increase in operating speed.
The flowcharts shown in
The reason why the two-pass method is adopted is as follows. That is, in the condition iii) described in the first embodiment, reduction in the number of operation stages is achieved by using the half adders also in positions other than the positions where the half adders are allocated in
In
In
Hereinafter, a flow of processes to be executed by the automatic circuit synthesis device will be described with reference to the flowcharts shown in
Initially, the first pass is executed according to the flowchart shown in
The partial product operation unit 103 calculates a partial product of n×m (refer to step 202), and collects partial products having the same bit weight for each digit as shown in
As this data structure, a vector such as (i, j, k) may be used. Here, i indicates the i-th stage operation block, j indicates the j-th bit in the i-th stage operation block, and k indicates the number of inputs at the j-th bit in the i-th stage operation block.
Next, the control unit 101 sets i=1 (refer to step 204), and the full adder allocatable position search unit 105 and the half adder allocatable position search unit 104 search for positions where full adders and half adders can be allocated, from the data structure corresponding to the multi-input addition shown in
Next, the control unit 101 sets j=i+1(=2) (refer to step 208), and the operation block constitution unit 109 constitutes a state before allocation of full adders and half adders, which state will be the second-stage operation block (refer to step 209).
The judgment unit 111 judges whether or not a position having three or more inputs exists in the portion to be the second-stage operation block (refer to step 210). Since positions having three or more inputs exist in the portion to be the second-stage operation block, the control unit 101 sets i=j (refer to step 211) and returns the control to step 205, and then performs allocation of full adders and half adders to the portion to be the second stage in like manner as that for the first stage, thereby constructing the second stage.
Thereafter, third and subsequent stages are constituted and constructed in like manner as mentioned above. When it is judged in step 210 that there exists no position having three or more inputs, the final stage construction unit 112 constructs the final-stage operation block as shown in
Thus, the first pass for judging what number stage the final stage of the multi-input adder corresponds to, has been completed. The respective stages of operation blocks that are constructed in this first pass are not used as actual automatic synthesis outputs.
Next, the second pass is executed according to the flowchart shown in
In steps 213 to 215, the same processings as those performed in steps 203 to 205 are performed. Next, under control of the control unit 101, the half adder allocatable position search unit 104 allocates a half adder to only a position having two inputs on the least significant bit side in the first-stage operation block, in contrast to the first pass (refer to step 216).
Next, the judgment unit 111 judges whether i is equal to k−3 or not (refer to step 217). In the case of the first-stage operation block, since i is equal to k−3, the half adder allocatable position search unit 104 allocates a half adder to a position having five inputs and two carries from the lower bit, in the first-stage operation block (refer to step 218). When i is not equal to k−3, the control goes to step 219.
In step 219, the judgment unit 111 judges whether i is equal to k−1 or not. In the case of the first-stage operation block, since i is not equal to k−1, the control goes to step 221. When is equal to k−1, the half adder allocatable position search unit 104 allocates half adders to all the positions where the half adders can be used, except for the digits where no carry exists in the corresponding stage of the operation block (refer to step 220). In step 221, the operation block corresponding stage construction unit 108 constructs the first-stage operation block on the basis of the above-mentioned allocation.
Next, in steps 222 to 225, the same processings as those performed in steps 208 to 211 in the first pass are carried out.
Thereafter, the second and subsequent stages are constituted and constructed in like manner as mentioned above. When it is judged in step 224 that there exists no position having three or more inputs, the final-stage construction unit 112 constructs the final-stage operation block as shown in
As described above, according to the second embodiment of the present invention, in the automatic circuit synthesis device for synthesizing a multi-input adder comprising plural stages of operation blocks, full adders are allocated to all positions where the full adders can be used in the respective operation blocks, thereby to automatically derive as to what number stage the final stage corresponds to. Thereafter, when constituting the plural stages of operation blocks again, the respective operation blocks are constructed by automatically applying the rules of the above-mentioned i) to iii), i.e., the rules including using full adders in all the positions where full adders can be used in each operation block, using a half adder at only the least significant bit side in each operation block, using a half adder in a position having five inputs at a digit that is one digit higher than a digit having two carries of a full adder in the operation block three stages prior to the final operation block, and using a half adder at a digit having a carry from the lower bit in the operation block one block prior to the final operation block. Therefore, it is possible to automatically synthesize a multiplier having a multi-input adder which can achieve simultaneous pursuit of reduction in operation time and reduction in circuit scale, without performing a manual work which is complicated, requires long time, and easily causes errors.
While in this second embodiment an automatic circuit synthesis device for automatically synthesizing a multi-input adder is described, a method identical to the synthesis method executed by this device may be provided, or a program in which this method is described or a medium in which this program is recorded may be provided.
Further, while in this second embodiment a method of constructing the operation blocks shown in
As described above, a multi-input adder, a synthesis device thereof, a synthesis method, a synthesis program, and a synthesis program storage medium according to the present invention can realize a compact and high-speed multi-input adder by restricting positions where half adders and full adders are used, and thus obtained adder is useful as a multi-input adder in a multiplier or a FIR filter. Further, the multi-input adder can be utilized in an optical recording information device or a communication device, or as a fundamental operation device for various digital signal processings.
Number | Date | Country | Kind |
---|---|---|---|
2005-041372 | Feb 2005 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2006/302720 | 2/16/2006 | WO | 00 | 8/14/2007 |