High-radix divider

Abstract: A dividend or partial remainder (R (j) ) is stored in a partial remainder register (1). An output of the partial remainder register (1) is shifted to the left by a radix which uses the power of 2 and is larger than 2. A divisor (D) is stored in a divisor register (2). Comparison constants obtained by subjecting an output of the divisor register (2) to predetermined operations are stored in comparison constant registers (3-1, 3-2). Subtracters (5-1, 5-2) respectively receive outputs of the comparison constant registers as one input, receive upper bits of a bit number representing a precision required for conversion and included in the output of the partial remainder shifter (4) as another input, and compare the magnitudes of the two inputs with each other to derive partial quotients. A selector (6) shifts and selects an output of the divisor register (2) according to the signs of the remainder quotients output from the subtracters (5-1, 5-2) to create a factor having a value equal to the integer multiple of the divisor. An adder/subtracter (7) receives an output of the selector (6) and an output of the partial remainder shifter (4) and the addition or subtraction of the adder/subtracter is selectively specified by the sign bit of an output of the partial remainder shifter (4) to derive a partial remainder (R (j+1) ).

Description: This invention relates to a hardware divider used in an integrated floating processor unit (FPU), and more particularly to a high-radix divider. Recently, as one-chip microcomputers with highly sophisticated functions have been developed, the functions of FPUs are increasingly enhanced and the multiplication can be effected with doubled precision by 1 to 3 clocks by means of a hardware multiplier. In a case wherein a hardware divider whose operation is effected in parallel with the other operations is used, an algorithm of restoring, nonrestoring, SRT (Sweeney Robertson Tocher), high radix division or the like based on a repetition operation system and a convergence type division algorithm based on the Newton-Raphson method may be considered to be used. Fig. 1 schematically shows a conventional hardware divider utilizing the nonrestoring algorithm based on the repetitive operation system. A partial remainder register 41 stores a dividend in the initial period of the operation and then stores a partial remainder R (j) in the remaining period. A partial remainder shifter 42 shifts the output of the partial remainder register 41 to the left by the radix. A divisor register 43 stores a divisor D. An adder/subtracter 44 effects the addition of or subtraction between data input from the partial remainder shifter 42 and data input from the divisor register 43 to output a partial remainder R (j+1) . A control counter 45 controls the operation timing of the above respective circuits. In general, the conventional hardware divider utilizing the nonrestoring algorithm based on the repetitive operation system effects the division according to the following convergence equation when the radix is set to 2, the partial remainder in the preceding cycle is expressed by R (j) , the partial remainder in the current cycle is expressed by R (j+1) , the partial quotient is expressed by Q and the divisor is expressed by D. R (j+1) = 2R (j) - QD (when j in the partial remainder R (j) is 0, a dividend is R (0) ). The above division system has an advantage that each time the operation for the operation loop is effected by one cycle in response to one clock, one bit of the partial quotient Q can be determined and the quotient Q can be determined based on the sign of the partial remainder 2R (j) in the preceding cycle when the partial quotient Q is {-1, 1}. However, in the operation with doubled precision effected by the FPU and defined by the IEEE standard, a mantissa portion has as many as 54 bits (a mantissa of 53 bits and a sign of 1 bit) and at least 54 clocks are necessary for effecting the division. Therefore, the latency (latent time from the instruction input to the operation output) of the operation for requiring the result of division becomes long, thereby significantly increasing the processing time. Further, in order to effectively utilize the parallel operability of the divider using the above division system, a high technique is required for the arrangement of operation instructions and it is almost impossible to use the divider to the full extent if the machine language is created by use of the compiler. The convergence type division algorithm based on the Newton-Raphson method may be effective at an operation speed corresponding to the latency. However, since the algorithm requires two multiplications and one addition in the convergence equation and the initial value approximation, a read only memory having a certain amount of memory capacity is required. Further, in a general computation, since the number of operations of division is smaller than that of multiplication, the investment effect of the hardware divider using the convergence type division algorithm is small and the performance thereof becomes low since the multiplication and addition/subtraction cannot be effected while the division is being effected. As described above, since the conventional hardware divider utilizing the nonrestoring algorithm based on the repetitive operation system has a radix of 2, at least 54 clocks are necessary when the division with doubled precision is effected by the FPU. For this reason, the latency of the operation requiring the result of the division becomes long and the processing time becomes significantly long. Further, it is difficult to effectively utilize the parallel operability of the divider. The disclosure IRE TRANSACTIONS ON ELECTRONIC COMPUTERS vol. 7, no. 3, September 1958, NEW YORK, US, pages 218 - 222 by J.E. ROBERTSON entitled 'A NEW CLASS OF DIGITAL DIVISION METHODS' illustrates the mechanization of the high-radix division scheme using an iterative non-restoring algorithm. The document PROCEEDINGS OF THE IEEE, vol. 54, no. 12, December 1966, NEW YORK, US, pages 1910 - 1919, by A.AVIZIENIS entitled 'ARITHMETIC MICROSYSTEMS FOR THE SYNTHESIS OF FUNCTION GENERATORS' describes the implementation of a non-restoring radix-16 divider. Accordingly, an object of this invention is to provide a high-radix divider capable of effecting high-speed division by use of a small amount of hardware. The above object can be attained by a high-radix divider as defined in independent claim 1. This invention can be more fully understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram schematically showing a conventional hardware divider using a nonrestoring algorithm based on the repetitive operation system; Fig. 2 is a block diagram schematically showing a high-radix divider according to a first embodiment of this invention; and Figs. 3 and 4 are diagrams schematically showing high-radix dividers according to second and third embodiments of this invention. First, a principle of a division system using an algorithm of the high-radix SRT division based on the repetitive operation system used in this invention is briefly explained. Assuming that a radix which uses the power of 2 and is larger than 2 is represented by r, the partial remainder in the preceding cycle is represented by R (j) , the partial remainder in the present cycle is represented by R( j+1 ), the partial quotient is represented by Q and the divisor is represented by D, then the convergence equation can be expressed as follows: R (j+1) = rR (j) - QD (when j in the partial remainder R (j) is 0, a dividend is R (0) ). In the above division system, it is necessary to derive a partial quotient Q which permits the partial remainder obtained in the current cycle to be set within a convergence range by comparing (subtracting) the comparison constants obtained by subjecting the divisor D to the predetermined operations and the partial remainder R (j) obtained in the preceding cycle with each other. The divisor D is multiplied by a constant according to the sign of the partial quotient Q to create a factor having a value equal to the integer multiple of the divisor and an addition of or a difference between a number derived by shifting the partial remainder in the preceding cycle to the left by the radix and the factor having the value equal to the integer multiple of the divisor is derived according to the sign bit of the shifted number so as to obtain a partial remainder R (j+1) in the current cycle. A quotient expressed by a sign r-scale notation (sign digit (SD) of the high radix) can be obtained by selecting the sign of the number derived by shifting the partial remainder R (j) in the preceding cycle to the left by the radix and the sign of the partial quotient Q and sequentially storing the same into the shift register. When the radix is set to 4, the number of circuits for subjecting the divisor D to predetermined operations and the number of subtracters for comparing the outputs of the circuits with the partial remainder R (j) in the preceding cycle are respectively set to 2 and these numbers become larger as the radix becomes higher. Further, when the radix is set to 4, a set of numbers for the partial quotient Q becomes {-2, -1, 0, 1, 2}, and when a higher radix of 8 or 16 is used, a set of numbers for the partial quotient Q increases to {-4, -3, ---, 0, ---, 3, 4} or {-8, -7, - --, 0, ---, 7, 8} but the circuit for multiplying the divisor D by the constant according to the sign of the partial quotient Q can be obtained by a combination of a shifter and a selector. In order to enhance the operation speed of the adder/subtracter of the high-radix divisor according to the present invention, the circuit of a stage other than the final stage is constructed by a carry-save type adder (CSA) and the final stage circuit is constructed by a carry-look-ahead type adder (CLA) and/or a carry-select type adder to suppress the carry transfer, and it is preferable to use a 4-2 comparator (4-input adder) as an input circuit of the above adder/subtracter when the radix is set to 16. Further, in order to obtain the quotient represented by an ordinary binary notation, a circuit for creating positive and negative partial quotients according to the signs of outputs of a plurality of subtracters and two shift registers for shifting and storing the positive and negative partial quotients are provided and a circuit for permitting the values stored in the two shift registers after the completion of convergence of the division is provided, and an operation is effected by use of the above adder/subtracter to obtain a quotient represented by the binary notation. Next, a high-radix divisor according to a first embodiment of this invention is explained with reference Fig. 2. In Fig. 2, a hardware divider (high-radix divider) based on the repetitive operation system utilizing the nonrestoring algorithm of SRT division using a radix of 4 is schematically shown. A first register (partial remainder register) 1 stores a dividend or a partial remainder R (j) in the preceding cycle. A second register (divisor register) 2 stores a divisor D. Third registers 3-1 and 3-2 store comparison constants obtained by subjecting the output (divisor D) from the second register to predetermined operations. In this case, the above operations may be different according to the radix, the precision and bit width of the divisor D, but since the constant is permitted to have a certain range when a high radix is used, the operation may generally be an extremely simple multiplication (for example, x 1, x 1.5 or x 2). Further, in order to obtain a precision which is high enough to express the above range, the bit number of the comparison constant is not necessarily set to have the same bit width of the divisor D and, for example, the comparison constant may be set to have 6 bits when a division of 54 bits is effected. A shifter (partial remainder shifter) 4 shifts the output of the first register 1 to the left by the radix. Subtracters (magnitude comparators) 5-1 and 5-2 respectively receive outputs of the third registers 3-1 and 3-2 as one input and upper bits (in this example, 6 upper bits) of a bit number representing the precision necessary for convergence and included in the outputs of the shifter 4 as the other input and compare the magnitudes of the two inputs to output a signal determining the partial quotient Q. A first selector 6 shifts and selects the output (divisor D) of the second register 2 according to the signs of the quotients Q output from the subtracters 5-1 and 5-2 to create a factor having a value which is an integer multiple of the divisor D. An adder/subtracter 7 is supplied with an output of the first selector 6 and an output of the shifter (partial remainder shifter) 4. The addition or subtraction of the adder/subtracter 7 is selectively specified by a sign bit of the output of the shifter 4 so as to derive a partial remainder R (j+1) in the present cycle. A decoder 8 is supplied with a signal for determining the partial quotient Q and a sign bit of the output from the shifter 4 to output a high-radix sign digit SD. A control counter 9 controls the operation timing of the above circuits. With the high-radix divider according to the first embodiment of this invention, the division is effected based on the above-described principle and two bits of a partial quotient Q are determined each time one cycle of the operation loop is effected by one clock. Therefore, a high-speed division whose operation speed is twice (which is generally represented by log 2 r) as high as that of the conventional hardware divider utilizing the nonrestoring algorithm based on the repetitive operation system having a radix of 2 can be effected. Further, the comparison (subtraction) between the comparison constants obtained by subjecting a divisor to predetermined operations and the partial remainder in the preceding cycle is not necessarily effected for all of the bits, and if an error is limited within the redundancy range of the partial remainder, the error can be compensated for in the next operation cycle. More specifically, when a 54-bit division is effected, it is sufficient if, for example, 6 bits of the shifted partial remainder are selected as a bit number representing the precision necessary for convergence and subjected to the comparison (subtraction), and therefore an amount of hardware can be reduced. Fig. 3 schematically shows another example of the construction of a high-radix divider based on the repetitive operation system utilizing the algorithm of SRT division having a radix of 4. The high-radix divider is constructed so as to output a quotient represented by a normal binary notation. A positive sign shift register 21, negative sign shift register 22, decoder 23 (substantially the same as the decoder 8) and second selectors 24-1 and 24-2 are provided in addition to the divider having the radix of 4 shown in Fig. 2. The decoder 23 selects positive and negative partial quotients according to the sign of the outputs of the subtracters 5-1 and 5-2. The two shift registers 21 and 22 shift and store the positive and negative partial quotients selected by the decoder 23. The selectors 24-1 and 24-2 are controlled to permit the values stored in the two shift registers 21 and 22 to be input to the adder/subtracter 7 after the completion of convergence of the division. Then, the values are operated by the adder/subtracter 7 so as to be converted into a binary notation. The other basic operations are the same as those of the circuit shown in Fig. 2. Fig. 4 schematically shows a high-radix divider based on the repetitive operation system utilizing the algorithm of SRT division having a radix of 16. The high-radix divider is different from the divider having a radix of 2 and shown in Fig. 2 in that a different number of third registers (comparison constant registers) 3 and subtracters 5 are used, the first selector 6' of different construction is used and a 4-input adder 10 is used in the input circuit of the adder/subtracter 7, and is substantially the same as the latter in other respects. According to the high-radix divider having a radix of 16, high-speed division can be effected at a speed which is four (log 2 r, r=16) times as high as that of the conventional case by use of a small amount of hardware. More specifically, the operation with doubled precision by FPU defined by the IEEE standard can be effected only by use of 53 + 4 = 13.25 clocks, that is, 14 clocks. In contrast, in order to effect the operation with doubled precision by use of the convergence type division algorithm based on the Newton-Raphson method, three times of convergence (two multiplications and one addition/subtraction) must be effected when the initial value approximation of upper 10 bits is derived by use of a read only memory. In this case, the convergence equation can be expressed as follows: Q (i+1) = Q i *(2-Q (0) * D ) where Q i and Q (i+1) are partial quotients, Q (0) is an initial value approximation derived by use of a read only memory, and D is a divisor. As is clearly seen from the above equation, the calculation cannot be made by use of a pipe-line method because of the dependency of data, and if two clocks are necessary for the throughput of the multiplication and addition/subtraction, 6 clocks are used for one convergence. Therefore, 6 × 3 = 18 clocks are used to effect the above operation with doubled precision, and it is understood that the operation speed of the high-radix divider having a radix of 16 is higher than that in the above case by 18 - 14 = 4 clocks. Further, the high-radix divider of this invention has an advantage that an amount of hardware is small since no multiplier is used. As described above, according to this invention, since an algorithm based on the repetitive system having a radix which uses the power of 2 and is larger than 2 is used, a high-radix divider capable of effecting a division at a high speed by use of a small amount of hardware can be provided.

Claims: A high-radix divider in a hardware divider utilizing a non-restoring algorithm based on a repetitive operation system, comprising first register means (1) for storing a dividend or each of carry and sum components of a partial remainder (R (j) ); shift means (4) for shifting an output of said first register means (1) to the left by a radix which uses the power of 2 and is larger than 2, second register means (2) for storing a divisor (D); a plurality of third register means (3-1, 3-2) for storing comparison constants obtained by subjecting an output of said second register means (2) to predetermined operations; a plurality of magnitude comparator means (5-1, 5-2) for respectively receiving outputs of said plurality of third register means (3-1, 3-2) as one input, receiving upper bits of a bit number representing a precision required for conversion and included in the outputs of said shift means (4) as another input, and comparing the magnitudes of the respective two inputs with each other to derive partial quotients; selector means (6) for shifting and selecting the output of said second register means (2) according to the signs of the partial quotients output from said plurality of magnitude comparator means (5-1, 5-2) to create a factor having a value equal to the integer multiple of the divisor; and adder/subtracter means (7) for receiving the outputs of said selector means (6) and shift means (4), characterized in that the addition or subtraction of said adder/subtracter means (7) being selectively specified by a sign bit of the output of said shift means (4) to derive a partial remainder (R (j+1) ), said adder/subtracter means (7) comprising a carry-save type adder at a stage other than a final stage and one of a carry-look-ahead type adder and a carry-select type adder at the final stage. A high-radix divider according to claim 1, wherein said magnitude comparator means (5-1, 5-2) includes a subtracter. A high-radix divider according to claim 1 or 2, further comprising partial quotient creating means (23) for creating a positive partial quotient and a negative partial quotient based on the signs of outputs of said plurality of magnitude comparing means (5-1, 5-2); first and second shift registers (21, 22) for shifting and storing the positive partial quotient and the negative partial quotient created by said partial quotient creating means (23); and switch means (24-1, 24-2) for permitting values stored in said first and second shift registers (21, 22) to be selectively input to said adder/subtracter means (7) after the completion of convergence of division. A high-radix divider according to claim 3, wherein said partial quotient creation means (23) includes a decoder. A high-radix divider according to claim 3 or 4, wherein said switching means (24-1, 24-2) includes two selectors.

Inventors: MORI JUNJI, MORI, JUNJI, Mori, Junji, c/o Intellectual Property Div.
Applicants: TOSHIBA KK, KABUSHIKI KAISHA TOSHIBA
Application year: 1991
Main classification: G06F7
IPC codes: G06F7