1. Field of Invention
The present invention relates to a multiplier and an algorithm thereof, and particularly to an asynchronous signed multiplier and an algorithm thereof.
2. Description of the Related Art
The multiplier plays a significant role in many applications, such as in microprocessor, digital signal processing, discrete cosine transformation and so on. In fact, a multiplier consumes the most operation time in a chip for computation. Therefore, the multiplier running time determines the overall efficiency of a chip. So far, a number of approaches in the synchronous circuit design have been provided, and a few approaches in the asynchronous circuit design have also been proposed. In general, the asynchronous method has some advantages over the synchronous circuit, such as low power consumption, low average computation time, adaptability to different manufacturing process and environment. In particular, these advantages are vital to solve the problems encountered by some VLSIs (very large scale integrated circuits).
Today, the types of multipliers can be divided into a right-to-left (R-L) array multiplier, left-to-right (L-R) array multiplier, a partitioned array multiplier and a multiplexed array multiplier.
It known that either a bit of a multiplier or a multiplicand is 0, the corresponding partial product should be “0”. For a conventional multiplier, however, even on a “0” bit, the partial product operation is still redundantly implemented, which is time-wasting. Besides, for an operation member, the regular significant bit length thereof is much shorter than the designed bit length in a system. That is, the values of higher bits often are “0”, and computation on these 0 bits simply waste too much time.
Based on the above described, an object of the present invention is to provide an asynchronous signed multiplier having a faster multiplication operation.
Another object of the present invention is to provide an algorithm of asynchronous signed multiplication for computing signed data.
The asynchronous signed multiplier provided by the present invention is suitable for signed multiplication operation on a multiplier and a multiplicand, wherein the multiplier and the multiplicand have N-bit and M-bit, respectively. The N and M are positive integers larger than zero, and all of the multiplier, the multiplicand and the product are represented by 2's complement. The asynchronous signed multiplier of the present invention includes N pieces of partial product generators (PPGs) used for generating a partial product result according to a multiplier and a multiplicand, wherein the partial product is indicated by Di and Di represents in the i-th PPG a partial product obtained by means of timing every bit number of the multiplicand by a i-th bit number of the multiplier. Moreover, i is an integer smaller than or equal to N but larger than or equal to 1. Each partial product result includes M pieces of partial products and all output from the partial product generators are sent to an operation module to implement the following computation:
From the computation, a first operation result is obtained. Afterwards, the operation module adds DN to the first operation result for obtaining a second operation result. The operation module is further coupled to a leading-zero-bit-detector, which checks multipliers and multiplicands in a sequence bit-by-bit, from the MSB (most-significant-bit) to the LSB (least-significant-bit). During the checking, any “0” bit prior to the first “1” bit is counted as a void bit and the corresponding partial product value takes “0” for output. All bits from the first “1” bit to the LSB are called effective bits.
In the embodiment of the present invention, the asynchronous signed multiplier further includes a completion detector, coupled to the operation module for deciding the above-described second operation result.
On the other hand, the present invention provides an algorithm for the asynchronous signed multiplier, suitable for signed multiplication operation on a multiplier and a multiplicand, wherein the multiplier and the multiplicand have N-bit and M-bit, respectively. The N and M are positive integers larger than zero. The highest bit of the multiplier or the multiplicand is a sign bit. According to the present invention, the multiplicand is timed by each bit number of the multiplier sequentially from the i-th bit number to the first bit number for obtaining a plurality of first partial product values. Afterwards, the obtained first partial product values are summed up for obtaining a first operation result. Further, the multiplicand is timed by the N-th bit number of the multiplier for obtaining a plurality of second partial product values. The first operation result is then added by the second partial product values for obtaining a second operation result. For any “0” bit in the multiplier and multiplicand, the operation related to the “0” bit is exempted and the related partial produce value is directly set as “0”.
Since the partial product value related to the highest bit of the multiplier is scheduled in the end of the entire sum-up operation to add for the final sum, the present invention is capable of implementing operation on a signed number and saving computation time.
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve for explaining the principles of the invention.
However, for signed numbers of multiplicand M1 and multiplier M2, the situation is different from the above described, wherein the highest bits of multiplicand M1 and multiplier M2, y4 and x4, are sign bits. It can be seen from
In addition, it can be seen further that the effective bit length is usually not long, so that it is highly possibly for the partial product values of the first row, for example in
To resolve the above-described problem, the present invention provides, for example, a 5×5 L-R signed multiplication algorithm as shown in
The multiplier 500 includes a plurality of partial product generators (PPGs) C1˜C8. In the present invention, the PPG number is specified as the same as the bit number of the multiplier. The multiplier 500 further includes an operation module 510, a leading-zero-bit-detector 540 and a completion detector 550.
Referring to
The operation module 510 includes adder modules 512, 514, 516, 518 and 520. Each adder module includes a plurality of first adders and a plurality of multiplexers, for example, a first adder 528 and a multiplexer 530. Wherein, each first adder receives the output from a corresponding PPG; that is the corresponding partial product values. For example, the first adder 528 receives a first partial product value from the PPG C1. Besides, each multiplexer has a first input end and a second input end. Wherein, the first input end of the multiplexer receives the output from a corresponding adder, while the second input end receives a constant of “0” (as shown in
One of the input ends in the multiplexer 530 and one of input ends in the multiplexer 531 receive the output from the sum-up output end and the output from the carry output end of the first adder 528, respectively. Another ends of the multiplexers 530 and 531 receive constants of “0”. The multiplexers 530 and 531 have one more end, a selection end Z, respectively. The selection end Z is coupled to, for example, the leading-zero-bit-detector 540 in
Referring to
wherein N is equal to 8 in the embodiment.
As the adder modules 512, 514, 516, 518, 520 and the second adder module 522 conduct a computation of the formula (1), if the leading-zero-bit-detector 540 finds a leading-zero-bit either in the multiplier or the multiplicand, all the related outputs of partial products are set to “0”. In the embodiment, if the leading-zero-bit-detector 540 detects a leading-zero-bit either in the multiplier or the multiplicand, a control signal is generated and sent to the selection end Z of the multiplexers, so that the multiplexers directly output constants “0” without any operation of the first adder.
The third adder module 524 also includes a plurality of third adders, which receive the partial product values generated by the eighth, i.e. N-th, PPG C8, respectively. The third adder module 524 and the last-stage adder 526 will add D8 to the first operation value, i.e. adding the first operation value to the partial product result generated by the PPG C8, to obtain a second operation value. The second operation value is just the final product value by a multiplication operation on the multiplier and the multiplicand.
In the embodiment, The output from the last-stage adder 526 needs to be sent to the completion detector 550 to complete a detection on the second operation value by using the completion detector 550.
From the above described, it can be seen that the present invention puts back the partial products of the N-th bit in a multiplier for computation at the last stage, therefore the present invention still can save the operation time when conducting a signed multiplication.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the specification and examples to be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims and their equivalents.