High speed dividers

Abstract: An apparatus for performing the division of a first operand by a second operand by iteratively producing a series of partial remainders and predicted quotient bits includes means for generating multiples of the second operand and means for selecting one of the generated multiples. The second operand is first selected as a first partial remainder. A first quotient bit is predicted from the first and second operands and a next quotient bit is predicted from the partial remainder and the second operand. One of the generated multiples is selected for producing a next partial remainder based upon the next quotient prediction. A next partial remainder is then produced from the produced partial remainder and the selected one of the multiples of the second operand.

Description: The present invention relates to a floating point processor for a computer system and, more particularly, to a high speed divider which performs non-restoring iterative division in radix 4. The present invention further relates to a high speed divider which performs non-restoring iterative division in radix 4 and square root calculations in radix 2. Related inventions are described in our copending applications EP-A-0 450 755, EP-A-0 450 752 and EP-A-0 450 751. Many computer programmes require a large number of floating point arithmetic operations. Consequently, a large number of the instructions executed by a computer in which such programmes are run are floating point instructions. For such programmes, the greater the number of floating point arithmetic instructions that can be executed per cycle, the faster the machine speed of operation. Accordingly. numerous efforts have been made to speed up floating point processing time. For example. U.S. Patent 4,683,547 to DeGroot discloses a floating point arithmetic unit which allows two floating point results to be produced each cycle. That same patent discusses prior art teachings of arithmetic units which allow multiple arithmetic operations to be executed at once. Yet another approach is shown in U. S. Patent 4,075,704 to O'Leary. In O'Leary, the floating point adder and the floating point divider are pipelined circuits which include a plurality of stages with intermediate temporary storage means for catching partial results computed during one clock period for presentation to a next stage during a next clock period. Approaches such as those disclosed in DeGroot and O'Leary concentrated primarily on speeding up the capability of a floating point arithmetic unit to do repeat operations and were not directed towards increasing the speed at which a floating point arithmetic unit could perform a specified operation. As division is the most complex of the arithmetic operations and has typically required more hardware and computational time than the other arithmetic operations such as addition or multiplication, the speed at which a division calculation can be performed by a divider is of particular importance. For example, as the number of digits included in the operands for which a division operation is to be performed increases, an exceedingly long time is required for a divider to perform the desired arithmetic operations. Further by example, large-size computers having high-speed multipliers often employ multiplication type division in which division is performed by repetition of multiplication. However, implementation of such multiplication-type division by combinational circuitry requires large numbers of hardware elements and is therefore impractical. Division techniques may be divided into "restoring" division techniques and "non-restoring" division techniques. In non-restoring division, a series of quotient digits having the values: -((Beta) -1), ..., -2, -1, 1, 2, ..., ((Beta -1)) where: (Beta) is the radix of the divisor, k is the redundancy factor; are previously determined and each digit of the quotient is selected from the set of quotients in an iterative method which also produces a series of partial remainders utilized in selecting the next quotient digit. A variant of non-restoring division is generally referred to as "SRT" division which is characterized by the prior determination of a series of quotient digits in the range of: -(k((Beta)-1)), ..., -2, -1, 0, 1, 2, ..., (k((Beta)-1)) where: (Beta) is the radix of the division; from which each quotient digit is selected. A characteristic feature of nonrestoring type dividers is the use of a negative number as well as a positive number in the partial remainder which is produced from a previous operation in which a digit of the quotient is determined. One such nonrestoring type divider is disclosed in U. S. Patent No. 4,722,069 to Ikeda. Ikeda discloses a nonrestoring type divider which includes a divisor register for storing a divisor, a partial remainder register for storing a dividend or a partial remainder, a predictor for predicting a partial quotient, a multiplier for multiplying the contents of the divisor register, a first adder for subtracting the output of the multiplier from the contents of the partial remainder register and for calculating the partial remainder in such a manner that the predictor predicts the partial quotient from upper digits of the divisor register and upper digits of the partial remainder. The use of multipliers and multiple adders in the Ikeda divider, however, would likely add significant increases in both the cost and space requirements of the divider due to its relatively hardware intensive design. Another non-restoring type divider is disclosed in U. S. Patent No. 4,724,529 to Irukulla, et al. While the Irukulla et al. divider includes an adder/subtractor which calculates a partial remainder according to the relationship P j+1 = (Beta)P j - q j D' Irukulla, et al., however, utilizes cost and space expensive multiplication circuitry to produce q j D. Finally, the article to Birman et al. entitled "Developing the WTL3170/3171 Sparc Floating-Point Coprocessors", IEEE Micro , pgs. 55-64 (February, 1990) discloses a floating point arithmetic operation unit for performing a non-restoring. radix 4 mantissa division and square root computations. However. the device disclosed in the Birman et al. article shares first division/square root logic and "times-three" generation with a multiplier. thereby preventing the floating point processor to perform multiplication operations during a divide operation. Furthermore, the device disclosed in the Birman et al. article is configured to require the generation of three times the divisor using multiplication circuitry before any quotient bits are determined. thereby slowing the calculation of the quotient. IBM technical disclosure bulletin, volume 30, number 6, 11/87, pages 415 to 419 "Radix 16 Divider" discloses a further known radix divider. "An article by Milos D. Ercegovac and Tomas Lang, "On-The-Fly Conversion of Redundant into Conventional Representations." IEEE Transactions on Computers, Vol. C-36. No. 7, July, 1987, discloses a known radix 2 divider." The present specification describes a high speed divider which performs non-restoring iterative division in radix 4. The divider also performs square root calculations in radix 2. The divider minimises the amount of logic circuitry required while speeding the divider to operate at the rate of an iteration of the division operation per clock pulse phase. The present invention provides a divider comprising a pair of parallel quotient registers for storing a quotient prediction for output and for storing the quotient prediction minus one for correcting erroneous quotient predictions before output. In one aspect, there is described a divider for performing a division of a first operand by a second operand to produce a result which includes means for iteratively producing a series of partial remainders, means for iteratively predicting a series of quotient values (alternatively to be called : quotient bits), means for generating multiples of the second operand and means for selecting one of the generated multiples. The means for producing a series of partial remainders selects the second operand as a first partial remainder. The quotient predictor means predicts a first quotient bit based upon the first and second operands and a next quotient bit based upon the produced partial remainder and the second operand. The selection means selects one of the generated multiples for producing a next partial remainder based upon the next quotient prediction. A next partial remainder is then produced from the produced partial remainder and the selected one of the multiples of the second operand. In another aspect, there is described an apparatus for dividing a dividend by a divisor to produce a result which includes a partial remainder register connected to receive and store partial remainders, a divisor register connected to receive and store the divisor, quotient prediction logic connected to receive the divisor from the divisor register and a series of partial remainders from the partial remainder register, a first quotient register connected to receive and store a series of quotient bits predicted by the quotient prediction logic, means for generating multiples of the divisor, and a special carry save adder connected to the means for generating multiples of the divisor and to the quotient prediction logic. The carry save adder selects multiples of the divisor based upon the predicted quotients and determines a next one of the series of partial remainder based upon the partial remainder stored in the partial remainder register and the selected divisor multiple. The quotient prediction logic then receives the next partial remainder to determine a next one of the series of quotient bits. In the accompanying drawings, by way of example only:- FIG. 1a is a block diagram of a first embodiment of a high speed divider for performing non-restoring iterative division in radix 4 constructed in accordance with the teachings of the present invention; FIG. 1b is a block diagram of the quotient register illustrated in FIG. 1a; FIG. 1c is a block diagram illustrating additional details of the quotient register illustrated in FIGS. 1a-b; FIG. 2 is a graphical representation of the first quotient prediction logic of the divider of FIG. 1; FIG. 3 is a graphical representation of the quotient prediction logic of the divider of FIG. 1; FIG. 4 is a block diagram of a second embodiment of a high speed divider for performing non-restoring iterative division in radix 4; FIG. 5 is a block diagram of the high speed divider of FIG. 4 modified to further perform square root calculations in radix 2; FIG. 6 is a graphical representation of the square root prediction logic of the divider of FIG. 5; and FIG. 7 illustrates per phase logic. Referring first to FIG. 1, a high speed divider 100 for performing non-restoring iterative division in radix 4 shall now be described in detail. It is contemplated that the divider disclosed herein be used as a component of a floating point processor unit such as any one of the floating point processor units disclosed in co-pending European Patent Application. Publication numbers EP-A-0 450 755, EP-A-0 450 752 and EP-A-0 450 751 all filed in the name of the present Applicant. As was set forth in detail in the above-referenced applications. a floating point processor is comprised of a plurality of floating point arithmetic operation units such as an adder. multiplier and divider for performing arithmetic operations on input operands. When a pair of input operands, for example. operand A and operand B, are input to a floating point arithmetic operation unit, the floating point arithmetic operation unit performs the desired arithmetic operation on the input operands and outputs the result on a result bus. Typically, a floating point processor may process both floating point and integer numbers. Various floating point formats may be supported, including 32 bit (single precision) and 64 bit (double precision). Additionally, the floating point processor may handle conversion of integers to floating point, and the reverse. In a division operation, a dividend is divided by a divisor to produce a quotient. In the present invention, a dividend is supplied to the divider 100 along an A bus. a divisor is supplied to the divider 100 along a B bus and the quotient is output by the divider 100 along a RESULT bus. As to be described in greater detail below, the divider 100 is controlled by a divider controller 110 which receives instructions from an I bus and, based on the received instructions, generates control signals to the various elements of the divider 100, i.e. a first quotient predictor 102, a partial remainder register 106, a divisor register 108, a first quotient register 114a, a second quotient register 114b, a 3X divisor register 116, a zero detect means 122 and a remainder sign detect means 123, during a divide operation. The A bus is connected to a first quotient predictor 102, and a partial remainder register 106. Similarly, the B bus is connected to the first quotient predictor 102, a shifter 103, a first input of adder 104 and a divisor register 108. To commence a divide operation, the divider controller 110 receives an instruction from the I bus to commence divide operations. The first stage of a division operation, generally referred to as the "pre-overhead" stage, commences when a dividend, for example, the operand A, is then supplied to the first quotient predictor 102 and the partial remainder register 106 along the A bus and a divisor, for example, the operand B, is supplied to the first quotient predictor 102 and the divisor register 108 along the B bus during a first phase of a two phase oscillating clock pulse generated and distributed by the system. During the first phase of the clock pulse, the dividend A is latched in the partial remainder register 106 and the divisor B is latched in the divisor register 108. In addition, the dividend A and the divisor B are input the first quotient predictor 102 where a first bit q 1 of the quotient Q to be produced by dividing the dividend A by the divisor B is determined. The first quotient predictor 102 is comprised of combinational logic circuitry configured such that, depending on the dividend A and the divisor B input into the first quotient predictor 102, a first quotient bit q 1 will be determined. Referring next to FIG. 2, a graphical representation of the combinational logic circuitry which comprises the first quotient predictor 102 may now be seen. More specifically, FIG. 2 illustrates a logic PD plot which may be used to derive the combinational logic for the first quotient predictor 102. In FIG. 2, possible values for the divisor A input into the first quotient predictor 102 are set forth along the horizontal axis and possible values for the dividend B input into the first quotient predictor 102 are set forth along the vertical axis. Accordingly, each point on this plot is a divisor and dividend pair. Since numbers arriving at the divider 100 must be normalized, and because the dividend is initially divided by 4, and finally because the first quotient predictor 102 receives only the top couple of bits from each input operand, the only points that are used in the plot are: (1.00, .010), (1.00, 0.01), (1.01, .010), (1.01, .011), (1.10, .010), (1.10, .011), (1.11, .010) and (1.11, .011). However, since the real value of the divisor may lay in the interval [1.00, 10), and the real dividend may lay in the interval [.01, .1), the first quotient predictor 102 of the divider 100 suffers from a quantitization error. Accordingly, in FIG. 2, the lower dashed line represents the lower boundary upon which a first "guess" quotient of two may be chosen without being wrong by more than one too big. Similarly, the upper dashed line represents the lower bound in which the guess quotient of three may be chosen without being more than one too big and the upper boundary for which the quotient of one may be guessed. Finally, the upper and lower straight lines represents a quantized decision threshold which may be easily implemented in combinational logic. It should be readily apparent to those skilled in the art to which the invention pertains that, if the lower straight line represents the threshold on or above for which a quotient one is guessed, and the upper line represents the threshold on or above for which a quotient of two is guessed, that no matter what the real dividend and divisor are, the quantized guesses will be valid. In FIG. 2, all points will cause a quotient guess of 1, except (1.00, .011) and (1.01, .011) which will cause a quotient guess of 2. Returning now to FIG. 1, the first quotient predictor 102 is connected to a quotient predictor 112 and the quotient register 114 such that, after the first quotient predictor estimates q 1 , the estimate of q 1 is sent to the quotient predictor 112. In turn, the quotient predictor 112 sends a q1 value, which may be either 0, 1, 2, 3, and the corresponding sign bit to the quotient register 114. In addition, the first quotient predictor 112 sends a signal to the quotient register 114 to indicate the beginning of divide. Referring next to FIG. 1b, the quotient register 114 illustrated in FIG. la shall now be described in greater detail. The quotient register 114 includes a first quotient (or "Q') register 114a for storing the current estimate of the final quotient Q, a second (or "Q-1") quotient register 114b for storing the current estimate of the final quotient Q minus 1 from the current bit position, j, a shift register 114c for generating current bit pointers 1000, a "divide start" control signal from the first quotient predictor 112, a "divide end" control signal 1016 output to the divider controller 110, a q decode block 114d for generating the current values of q and q-1 to be written into the quotient registers 114a, 114b, and means (illustrated in FIG. 1c) for writing the contents of the Q register 114a into the Q-1 register 114b and for writing the contents of the Q-1 register 114b into the Q register 114. Referring next to FIG. 1c, the quotient registers 114a, 114b shall now be described in greater detail. Each quotient register 114a, 114b is comprised of a series of quotient bit registers 114a-0, ... 114a-(i-1), 114a-i, 114b-0 ..., 114b-(i-1), 114b-i, respectively, connected in parallel. The shift register 114c receives the divide start signal from the first quotient predictor 112 and begins to generate pairs of pointers 1000 connected to pairs of the quotient bit registers 114a-0, ... 114a-(i-1), 114a-i, 114b-0, ..., 114b-(i-1), 114b-i, such that the pointers connected to the two most significant quotient register bits are asserted first. Successive iterations cause assertion of successively less significant pairs of pointers. Based on the 8 j value and sign sent from the second quotient predictor 112, the q decode block 114d generates the bit values to be written into the positions within the quotient bit registers currently being pointed at. During any iteration, if the q sign is positive, the q decode 114d writes the q value to the position within the quotient bit registers 114a currently being pointed at and the q-1 value to the position within the quotient bit registers 114b currently being pointed at. All the remaining bit positions within the Q-1 register 114b are written to by the corresponding bit positions within the Q register 114a. Similarly, if the q sign value were to be negative, the q decode 114a would write the corresponding q value value to the position within the quotient bit register 114a currently being pointed at and the q-1 value to the position within the quotient bit registers 114b currently being pointed at. All remaining bit positions within the Q register 114a would be written to by the corresponding bit positions within the Q-1 register 114b. Finally, if the q value is zero, the position within the quotient bit register 114a would receive a 0 and the position within the quotient bit register 114b would receive a 3. Certain of the pointers 1000 are used as end of divide indicators 1016 for use by the divider controller 110 of FIG. 1. Also during the first phase of the first clock pulse, the adder 104 receives the divisor at a first input and two times the divisor at a second input. The generation of two times the divisor is a relatively simple operation and may be performed by a shifter 103 which receives the divisor, produces two times the divisor by shifting the divisor over a single binary place to the left and outputs two times the divisor to the adder 104. The divisor register is connected with a divisor multiplexer 118 and, the divisor B is supplied to the divisor multiplexer 118, again during the first phase of the first clock pulse. During a second phase of the first clock pulse, the "overhead" stage of the division operation commences with the calculation of a first iteration of the non-restoring division operation. At this time, the partial remainder register 106 supplies the dividend A and the divisor register 108 supplies the divisor B to the quotient predictor 112. Similar to, but somewhat more complicated than, the first quotient predictor 102, the quotient predictor 112 is combinational logic circuitry configured such that, depending on the dividend A and the divisor B input into the quotient predictor 112, a quotient bit q j and a sign bit s j will be selected by the quotient predictor 112. Referring next to FIG. 3, a graphical representation of the combinational logic circuitry which comprises the quotient predictor 112 may now be seen. Like FIG. 2, FIG. 3 illustrates a logic PD plot which may be used to derive combinational logic, in this case, the combinational logic which comprises the quotient predictor 112. Furthermore, FIG. 2 represents a small section of FIG. 3. Accordingly, the principles described in detail with respect to the graphical representation illustrated in FIG. 2 are equally applicable here. As may be seen in FIG. 3, the quotient predictor 112 will determine Q to be any one of the following numbers: (-3), (-2), (-1), (-0), (+0), (+1), (+2), (+3); depending on the partial remainder and divisor input the quotient predictor 112. Again, after selection, the signed quotient bit Q j is transmitted to the quotient registers 114a, 114b for storage in the next significant quotient bit register. Also after selection, the sign and quotient bits are transmitted from the quotient predictor 112 to a carry save adder 120 via s j , q j lines, respectively. The partial remainder register 106 outputs the dividend or "first partial remainder" or a next partial remainder to a shifter 107 which shifts the partial remainder two binary places to the left, thereby producing four times the partial remainder which, in turn is provided by the shifter 107 to the carry save adder 120. The final inputs to the carry save adder 120 are the +0, -0, +D, -D, +2D, -2D, +3D, -3D inputs from the divisor multiplexer 118. However as the quotient prediction bit q j determined during the first iteration can never be +3 or -3, the divisor multiplexer 118 outputs +0, -0, +D, -D, +2D, and -2D to the carry save adder 120. In this regard, as the divisor register 108 had previously supplied the divisor to the divisor multiplexer 118, the divisor multiplexer can easily produced the above-specified outputs to the carry save adder 120 without difficulty. Next, the carry save adder 120, which is described in greater detail in our aforesaid copending application EP-A-0450751, then selects the particular one of the inputs from the division multiplexer 118, i.e. +0, -0, +D, -D, +2D, -2D, which is equal to the product of the signed quotient bit and the divisor for use in the performance of the recursive algorithm set forth below. Then using the selected output from the divisor multiplexer 118 and the output from the shifter 107, the carry save adder then performs a first iterative calculation to produce a next partial remainder by application of the recursive algorithm as set forth in equation (4) below: P j+1 = 4P j - q j D where: P j is the partial remainder stored in the partial remainder register 106; q j is the signed quotient bit produced by the quotient predictor 112; D is the divisor; and P j+1 is the next partial remainder. Also during phase two of the first clock pulse, and overlapping with the calculation of the first iteration of P j+1 , the adder 104 adds the divisor (D) and two times the divisor (2D) to produce three times the divisor (3D). The value 3D is then output to the 3X divisor register 116 for storage. The 3X divisor register 116 then outputs the value 3D to the divisor multiplexer 118 for generation of the +3D and -3D multiples of the divisor to be output to the carry save adder 120 for possible use in successive iterations of the partial remainder calculation. After calculating a next partial remainder in a redundant form comprised of a plurality of sums and carries by subtracting a multiple of D from 4P j , the carry save adder 120 outputs the most significant five sum bits and the most significant five carry bits to the quotient predictor 112 for use in a next iterative calculation of a next iterative prediction of a signed quotient bits by the quotient predictor 112. The sixth most significant sum and carry bit are used to provide a correction for ambiguous quotient bits to the quotient predictor 112. To further explain this aspect of the invention, reference is again made to FIG. 3. In two areas of the PD plot of FIG. 3, two small cross-hatched areas are illustrated. Thes two cross-hatched areas represent the error caused by using the carry save adder 120 which makes it impossible to predict a quotient within the theoretical error limit while using a 5 bit partial remainder estimate. It is, however, very expensive to add a sixth bit to the partial remainder estimate. However, by using the NOR of the 6th carry and the 6th sum bits to estimate the error in the 5 bit estimate, we can successfully pick a quotient guess within the theoretical limits. If the NOR of the 6th sum and 6th carry bit is one, then any carry would be killed in the sixth bit, so the difference between the partial remainder estimate derived from adding the top five bits of the sums to the top 5 bits of the carries, and the actual partial remainder can be no greater than 2 -6 ; so the larger of the possible quotient predictions may be safely used. Conversely, if the NOR of the 6th sum and the 6th carry is zero, then the difference between the partial remainder estimate and the actual partial remainder must be greater than 2 -7 ; so the smaller of the possible quotient predictions may be used without fear of landing exactly on the lower limit of the range, thereby possibly breaking into repeating threes. The divider 100 continues to iteratively produce a next signed quotient bit for storage in the quotient register 114 as set forth above followed by iteratively determining a next partial remainder in the carry save adder 120 until the entire quotient Q has been produced. For a single precision number, the calculation of the quotient Q will require 14 additional iterations of the recursive algorithm, each iteration of the algorithm being completed in one phase of a clock cycle. For a double precision number, the calculation of the quotient will require 28 additional iterations of the algorithm. The divide operation is complete when the quotient register 114 is full. Now entering the "post-overhead" stage of the division operation, the partial remainder stored in the partial remainder register 106 after completing the fourteenth iteration of the recursive algorithm, if single precision division is being performed, or the twenty-eight iteration of the recursive algorithm, if double precision division is being performed, is output to a zero detect means 122, for example a first adder of conventional design, and a remainder sign detect means 123, for example a second adder of conventional design, for parallel determination of these operations. The remainder sign detect operation is to determine whether the quotient stored in the quotient register 114a is off by one. The zero detect operation is to determine whether or not the completed divide is exact. Each of the zero detect means 122 and the remainder sign detect means 123 receives the remaining sums and carries output by the partial remainder register 106. The output latch 126 would then receive the quotient from the quotient register 114, tack the zero or "sticky" bit from the zero detect means 122, onto the quotient received from the quotient register 114a to provide the quotient with a extra bit for correct rounding in the round unit of the floating point processor. Nearly simultaneously with the zero determination, the remainder sign detect means 123 checks the sign of the addition of the sums and carries output by the partial remainder register 106. If the sign of the addition of the sums and carries is negative, the remainder sign detect means 123 outputs a signal to the output latch 126 indicating that the quotient is too big and that it should use the Q-1 register 114b. The output latch 126 would then use the quotient minus one from the quotient register 114b, tack the zero or "sticky" bit from the zero detect means 122 onto the quotient minus one received from the quotient register 114b to provide the quotient with an extra bit for correct rounding in the round unit of the floating point processor. Finally, while the mantissa portion of the quotient is being calculated in accordance with the iterative method set forth above, the exponent portion of the quotient is being calculated by an exponent calculation means 124. More specifically, the exponent calculation means is connected to receive the dividend A along the A bus and the divisor B along the B bus. Upon receipt of a control signal from the divider controller 110, the exponent calculation means 124 subtracts the divisor exponent from the dividend exponent and outputs the result to the output latch 126. Once the output latch 126 has received the mantissa quotient from the quotient register 114 and the exponent calculation means 124, respectively, the result of the division operation is output to the floating point processor unit via the RESULT bus. Referring next to FIG. 4, a space efficient, high speed divider 300 for performing non-restoring iterative division in radix 4 shall now be described. The space efficient, high speed divider described herein is identical in construction and operation to the high speed divider illustrated in FIG. 1 except as noted below. The space efficient divider 300, like the divider 100, includes a first quotient predictor 302, an adder 304, a partial remainder register 306, a shifter 307, a divisor register 308, a shifter 309, a divider controller 310, a quotient predictor 312, a quotient register 314, a 3X divisor register 316, a divisor multiplexer 318, a carry save adder 320, an exponent calculation means 324 and an output latch 326 identical in connection and operation as the corresponding components of the divider 100. Essentially, the space efficient, high speed divider 300 differs from the high speed divider 100 in that the shifter 103, the zero detect means 122 and the remainder detect means 123 have been removed. In this embodiment, however, the sign and zero detect operation previously performed by the zero detect means 122 is now being performed by the adder 304 which, in the previous embodiment, was used only to combine D and 2D. So that the adder 304 is capable of performing multiple functions, a multiplexer 328 is provided to control the inputs to the adder 304. The inputs of the multiplexer 328 are connected to receive the A operand via the A bus, the B operand via the B bus, a series of sums via a third output of the partial remainder register 306 and a series of carries via a fourth output from the partial remainder register 306. A fifth input to the multiplexer 328 shall be described in greater detail below. During the determination of three times the divisor, the multiplexer 328, upon the receipt of a control signal from the divider controller 310, takes the received divisor B, shifts the received divisor a single decimal point to produce two times the divisor and outputs the divisor and two times the divisor to first and second inputs of the adder 304. Upon receipt by the adder 304 of the divisor and two times the divisor, the space efficient, high speed divider 300 will operate as previously described with respect to FIG. 1 until the last iterative determination of the partial remainder has been stored in the partial remainder register 306 and the space efficient, high speed divider 300 enters the post-overhead stage. In the post-overhead stage, the remaining sums and carries are provided to the multiplexer 328 via the third and fourth outputs of the partial remainder register 306. At this point, the divider controller 310 generates a control signal to the multiplexer 328 so that the sums are output to the adder 304 via and the carries are output to the adder 304 via the first and second adder inputs. The adder 304 adds the sums and carries output by the multiplexer 306 and outputs the result of the addition to the output latch 326. The adder 304 would then output a signal indicating that the sign is positive or negative to the output latch 326 via the sign line. If the addition of the sums and carries shows the remainder sign is positive, the output latch 326 would use the quotient from the quotient register 314a. If, however, the addition of the sums and carries shows the remainder sign is negative, the contents of the Q-1 register 314b would be used by the output latch 326. The output of the adder 304 would also be directed to the fifth input of the multiplexer 328. The multiplexer 328 would then direct the inverse of the adder output back into the adder 304 and add one via a carry-in line 330 to determine the sign of the output sum. As explained before, the zero detect is used to set an extra result bit in the output latch 326. Referring next to FIG. 5, a space efficient, high speed divider for performing non-restore iterative division in radix 4 and square roots in radix 2 shall now he described. The divider described herein is very similar construction and operation to the high speed divider illustrated in FIG. 4 except as noted below. The divider 500 for performing division and square roots includes a first quotient predictor 502, an adder 504, a partial remainder register 506, a shifter 507, a divisor register 508, a shifter 509, a divider controller 510, a quotient predictor 512, a quotient register 514 which is comprised of a Q register 514a and a Q-1 register 514b, a 3X divisor register 516, a divisor multiplexer 518, a carry save adder 520, an exponent calculation means 524, an output latch 526, and a multiplexer 528 identical in connection and operation as the corresponding components of the space efficient, high speed divider 300 described with respect to FIG. 4. The modification of the high speed divider 500 to perform square root operations in radix 2, i.e root bits may be selected from the group -1, 0, and +1, as well as divide operations in radix 4 is set forth below. Unlike a divide operation, a square root operation involves the input of a single operand or "radicand" and the output of a single result which is the square root of the input radicand. The input radicand for which the square root operation is to be performed thereon is input to the multiplexer 528 via either the A bus or the B bus. Upon indication from the divider controller 510 that a square root operation is to be performed on the input from the A bus or B bus, the radicand P is shifted a decimal place to produce two times the radicand P and two times the radicand P is transmitted via the adder 504 to the square root predictor 530 which, like the first quotient predictor 502 and the quotient predictor 512, is a configuration of combinational logic circuitry such that, depending on the input 2P to the square root predictor 530, a prediction of a square root bit Q shall be determined. Referring next to FIG. 6, a graphical representation of the square root predictor 530 shall now be described. The predictor plot provides for a given for input value of 2P j , a corresponding prediction of the value of the square root quotient bit q j . During each iteration the square root predictor 530 determines a bit of the square root and outputs the predicted bit q j to the Q and Q-1 registers 514a, 514b, respectively, in accordance with the techniques set forth above. The square root predictor 530 further outputs the predicted square root bit to the multiplexer 528 for use in the next iteration. Repeat iterations are performed until the quotient register is filled with a series of predicted bits and the divider 500 operates as previously described with respect to FIG. 4. Referring next to FIG. 7, certain changes would be required to the quotient register 114 illustrated in FIG. 1b in order to incorporate a radix 2 square root calculation which requires the writing of one bit into both the Q register 114a and the Q-1 register 114b per iteration. In iteration per phase logic, signals from a given latch may provide data to a logic block which would, in turn, provide a result to the given latch in the same phase. This would cause race through in conventional latches where the result would pass through the latch and change the logic inputs, thereby causing an unpredictable result. In order to overcome race through and provide synchronous operation, so-called "partner" latches such as those illustrated in FIG. 7 had to be developed. During one phase, one partner will receive data while the other partner transmits data. On each successive phase, the partners trade places. Also, in order to use dynamic logic, circuits had to be duplicated with one partner precharging in phase 1 and evaluating in phase 2, and the other partner precharging in phase 2 and evaluating in phase 1. As can be seen from the above description of the present invention, there is provided an arithmetic operation unit which performs iterative divide and square root operations at a high speed while minimizing the requisite circuitry to perform the divide operation. The pre-overhead time is reduced by overlapping the calculation of a first iteration and the determination of three times the divisor. Furthermore, the use of an adder to produce the sum of the divisor and the divisor shifted (two times the divisor) eliminates the need for a large multiplier. Through the use of simple quotient prediction logic and a multiplexer which provides all possible products of the quotient Q j and the partial remainder P j to the means for iteratively producing a next partial remainder, a carry save adder is used to produce the next partial remainder P j+1 , thereby eliminating the need for the multiplication logic to perform the calculation P j+1 = 4P j + QD and permitting the carry save adder to quickly calculate P j+1 , the divider can perform one iteration of the Q j and P j calculations per clock phase. The post-overhead time is reduced by performing zero detect and remainder sign detect in parallel. Finally, the need for additional adder circuitry to determine the final quotient is avoided by providing Q and Q-1 registers for storing the quotient and the quotient minus one in parallel such that, if it is determined that the quotient is off by one, the correct quotient is stored in the parallel quotient register and will not have to be determined. In the space efficient, high speed divider, the output of the partial remainder register at the end of the iterative determination of the quotient is directed to the 3D adder to determine whether the partial remainder is equal to zero and the sign of the partial remainder. In such a manner, the zero detect means and remainder sign detect means are eliminated, therefore saving space. However, those skilled in the art will recognize that many modifications and variations besides those specifically mentioned may be made in the techniques described herein without departing substantially form the concept of the present invention. Accordingly, it should be clearly understood that the form of the invention described herein is exemplary only and is not intended as a limitation on the scope of the invention.

Claims: An apparatus (100; 300; 500) for performing a division of a first operand by a second operand to produce a result comprised of a series of quotient values, comprising: means (118,120; 318,320; 518,520) for iteratively producing a series of partial remainders, said means for iteratively producing a series of partial remainders selecting said first operand as a first partial remainder; means (102,112; 302,312; 502,512) for iteratively predicting a series of quotient values. said quotient prediction means predicting a first quotient value based upon said first operand and said second operand, and a next quotient value based upon one of said series of partial remainders and said second operand; wherein said quotient prediction means further comprises: a first quotient prediction circuit (102;302;502) connected to receive said first and second operands, said first quotient prediction circuit predicting said first quotient value wherein said first operand is divided by at least 4 prior to said prediction of said first quotient value; and a second quotient prediction circuit (112;312;512) connected to receive said predicted first quotient value, said second operand and said series of partial remainders said second quotient prediction circuit iteratively predicting the remaining values of said series of quotient values; a first quotient register (114a) connected to said quotient prediction means to receive and store said series of quotient values determined by said quotient prediction means; a second quotient register (114b) connected to said quotient prediction means to receive said series of quotient values and store said series of quotient values minus one; means (103,104,108,116,118;328,304,308,316,318;528,504,508,516,518) for generating multiples of said second operand; said means for iteratively producing a series of partial remainders determining a next partial remainder based upon one of said series of produced partial remainders and one of said multiples of said second operand; said means for iteratively producing a series of partial remainders further including means (120; 320; 520) for selecting. based upon said next quotient value, one of said generated multiples of said second operand for producing said next partial remainder. An apparatus according to claim 1, wherein said means for iteratively producing a series of partial remainders of said first operand determines said next partial remainder in accordance with the following equation: P j + 1 = 4P J + q j D where: P J = said first partial remainder: P J+1 = said next partial remainder: q j = said first quotient prediction; and D = said second operand. An apparatus according to claim 2, wherein said means (103,104,116; 328,304,316; 528,504,516) for generating multiples of said second operand further comprises means for generating ±0, ±1, ±2, and ±3 times said second operand. An apparatus according to claim 3. wherein said means for iteratively producing a series of partial remainders of said first operand further comprises multiplexing means (118; 318; 518) for selecting one of said generated multiples of said second operand for producing said next partial remainder, said selected multiple of said second operand being equivalent to the product of said second operand and said quotient prediction. An apparatus according to claim 4, wherein said means for generating multiples of said second operand further comprises: means (103) for shifting said second operand to produce two times said second operand; and an adder (104) for adding said second operand and said produced two times said second operand to produce three times said second operand during the calculation of the first iteration of P J+1 . An apparatus according to claim 1, wherein said means for iteratively producing a series of partial remainders of said first operand produces said series of partial remainders as a set of sums and carries. An apparatus according to claim 6, further comprising means (122,123) for determining that said result has been produced. An apparatus according to claim 7, wherein said means for determining that said result has been produced further comprises: means (123) for determining the sign of said first partial remainder; and means for adjusting said result based on the sign of said first partial remainder. An apparatus according to claim 8, wherein said means for iteratively producing a series of partial remainders of said first operand determines said next partial remainder in accordance with the following equation: P J + 1 = 4P J + QD where: P J = said first partial remainder; P J+1 = said next partial remainder; Q = said first quotient prediction; and D = said second operand. An apparatus according to claim 9, wherein said means for generating multiples of said second operand further comprises means for generating ±0, ±1, ±2, and ±3 times said second operand. An apparatus according to claim 10, wherein said means for iteratively producing a series of partial remainders further comprises multiplexing means (118; 318; 518) for selecting one of said generated multiples of said second operand for producing said next partial remainder, said selected multiple of said operand being equivalent to the product of said second operand and said quotient prediction. An apparatus according to claim 11, wherein said means for generating multiples of said second operand further comprises: means (103) for shifting said second operand to produce two times said second operand; and an adder (104) for adding said second operand and said produced two times said second operand to produce three times said second operand during the calculation of the first iteration of P J+1- . An apparatus according to claim 1, further comprising: means for writing the contents of the first quotient register (114a) into the second quotient register; and means for writing the contents of the second quotient register (114b) into the first quotient register. An apparatus according to claim 1, further comprising: a partial remainder register (106; 306; 506) connected to receive and store said first operand as a first partial remainder; a divisor register (108; 308; 508) connected to receive and store said second operand; said means (103,104,108,116,118; 328,304,308,316,318; 528,504,508,516,518) for generating multiples of said second operand is connected to a carry save adder (120;320;520), and wherein: said carry save adder (120; 320; 520) is connected to receive said multiples of said second operand from said means for generating multiples of said second operand and said predicted quotient value from said quotient prediction means, said carry save adder determining a next partial remainder by selecting one of said multiples of said second operand and adding it to four times said first partial remainder, said partial remainder register (106; 306; 506) connected to receive and store said next partial remainder in place of said first partial remainder, said quotient prediction means connected to receive said next partial remainder to determine a next quotient value. An apparatus according to claim 14, wherein said carry save adder (120; 320; 520) produces said next partial remainder as a set of sums and carries and said apparatus further comprises a first adder (122) connected to receive said next partial remainder from said partial remainder register, said adder adding said sums and carries to determine whether said result has been produced. An apparatus according to claim 15, further comprising a second adder (123) connected to receive said next partial remainder from said partial remainder register, the output of said second adder being used for determining the sign of said sums and carries. An apparatus according to claim 16, wherein said second quotient prediction circuit determines, for every quotient value determined, the quotient value minus one, and said second quotient register (114b) being connected to receive and store said quotient values minus one determined by said quotient prediction circuit. An apparatus according to claim 17, further comprising: means (123) for determining whether said quotient value stored in said first quotient register (114a) is incorrect; and means for replacing said quotient stored in said first quotient register (114a) by said quotient minus one stored in said second quotient register (114b). An apparatus according to claim 18, further comprising an output latch (126; 326; 526) connected to receive said quotient from said first quotient register (114a). An apparatus according to claim 19, wherein said first operand. said second operand and said result are each comprised of a mantissa portion and an exponent portion, said quotient being produced by dividing the mantissas of said first operand and said second operand and said apparatus further comprising exponent calculation means (124; 324; 524) connected to receive the exponents of said first operand and said second operand, said exponent calculation means subtracting said exponent of said second operand from said exponent of said first operand to determine said result exponent. said output latch being further connected to receive said result exponent from said exponent calculation means. An apparatus according to claim 16, further comprising: first shifting means (103) connected to receive said second operand for producing two times said second operand; a third adder (104) connected to receive two times said second operand from said first shifter and said second operand; and a second divisor register (116) connected to receive and store three times said divisor from said second adder. An apparatus according to claim 21, further comprising a first multiplexer (118;318;518) connected to receive said second operand from said divisor register (108; 308; 508) and three times said second operand from said second divisor register (116; 316; 516) and to output ±0, ±1, ±2, and ±3 times said second operand to said carry save adder (120; 320; 520). An apparatus according to claim 22, wherein said carry save adder (120; 320; 520) determines a next partial remainder in accordance with the following equation: P J + 1 = 4P J + q j D where: P J+1 = said next partial remainder; P J = said first partial remainder; q j = said first quotient prediction; and D = said second operand. An apparatus according to claim 23, wherein said carry save adder (120; 320; 520) further comprises: second shifting means for shifting said first partial remainder twice to produce four times said partial remainder; and means for selecting one of said inputs from said multiplexer based upon said first quotient prediction. An apparatus according to claim 24, wherein said carry save adder (120; 320; 520) produces said next partial remainder by adding said first partial remainder shifted twice to produce four times said first partial remainder and said multiplexer input equal to the product of said second operand and said first quotient prediction. An apparatus according to claim 14, further comprising: a first multiplexer connected to receive said second operand, said multiplexer including shifter means (103) for producing two times said second operand from said divisor register; and a first adder (104) connected to receive two times said second operand from said multiplexer means and said second operand. An apparatus according to claim 26, further comprising a second divisor register (116; 316; 516) connected to receive and store three times said second operand from said first adder. An apparatus according to claim 26, wherein said first multiplexer is further connected to receive a set of sums and carries from said partial remainder register (106; 306; 506), said multiplexer configured to selectively output either said second operand to said first adder for said determination of three times the second operand or said set of sums and carries to said first adder for determining a partial remainder sign and a final partial remainder zero detect; said apparatus further comprising means for providing a return path for said addition of said sums and carries output from said first adder back to said first adder to determine the sign of said first partial remainder. An apparatus according to claim 28, further comprising an output latch (126; 326: 526) connected to receive said quotient from said quotient register (114; 314; 514), said output latch further connected to receive signals from said first adder indicative of whether said final partial remainder is zero. An apparatus according to claim 29, further comprising means for providing said determined sign of said final partial remainder to said output latch (126; 326; 526). An apparatus according to claim 30, wherein said quotient register circuit further determines, for every quotient value determined, the quotient value minus one, said second quotient register (114b) being connected to receive and store said quotient value minus one determined by said quotient register circuit. An apparatus according to claim 31. further comprising: square root prediction logic (530) connected to receive a radicand from said adder (504), said square root prediction logic determining a predicted root value based upon said radicand; means for providing said predicted root value to said first quotient register (514a) and said first multiplexer (528); said multiplexer (528) iteratively providing two times said predicted root value to said square root prediction logic for determining a next predicted root value.

Inventors: HURSON TONY, LYNCH THOMAS W, MCINTYRE STEPHEN D, SHAH SALIM A, TSENG KEN, HURSON, TONY, LYNCH, THOMAS W., MCINTYRE, STEPHEN D., SHAH, SALIM A., TSENG, KEN
Applicants: ADVANCED MICRO DEVICES INC, ADVANCED MICRO DEVICES, INC.
Application year: 1991
Main classification: G06F7
IPC codes: G06F7