L I E) I^AFLY OF THE U N IVER.5ITY Of ILLINOIS SV0.84p- NOTICE: Return or renew all Library Materialsl The Minimum Fee for each Lost Book is $50.00. The person charging this material is responsible for its return to the library from which it was withdrawn on or before the Latest Date stamped below. Theft, mutilation, and underlining of books are reasons for discipli- nary action and may result in dismissal from the University. To renew call Telephone Center, 333-8400 UNIVERSITY OF ILLINOIS LIBRARY AT URBANA-CHAMPAIGN f^B20 L161— O-1096 Digitized by the Internet Archive in 2013 http://archive.org/details/newclassofdigita82robe UNIVERSITY OF ILLINOIS GRADUATE COLLEGE DIGITAL COMPUTER LABORATORY REPORT NO. 82 A NEW CLASS OF DIGITAL DIVISION I4ETH0DS by James E. Robertson March 5, 1958 This work was supported in part by the Atomic Energy Commission and the Office of Naval Research under AEC Contract AT(ll-l)-iia.5. •^•^J^^ ANEW CLASS OF DIGITAL DIVISION I4ETH0DS Introduction A division method can be catagorized by listing the permissable values of each quotient digit as generated during the division process. For an arbi- trary radix r, each quotient digit generated during a conventional restoring division has one of the values 0, 1, ..., r-1. For non-restoring division each quotient digit has one of the values -(r-l) -fr-2^ i i 9 •, \ ^/ , \i. ^/ f , , , J — j.^ X, «c, •••} r— 1, ^th excluded. The purpose of this paper is to describe a class of division methods in which each quotient digit has one of the values -n, -(n-l), ..., -1, 0, 1, ..., n, where n is an integer such that |(r-l) <. n < r-l. Conversion of the quotient to the conventional restoring form is required for the latter. two classes of division methods. Division, as executed in most digital computers now in use, involves a recursive process which may be preceded by preliminary operations and which may be followed by terminal operations. Most of the time required for a digital division is spent in the repeated execution of the recursive process. For non- restoring division and for the class of division methods proposed here, the re- cursive process can be described by the equation ^J*l = ^^J - ^j+i^ J = 0, 1, ..., m for which the following notation is employed: '• inTiSS:rcf Sr'sScfas"*"^'"^ ^'^ non-reeto.i„g methods can be fo™, ■ t^:^'^^l^t^1^ £g:fl;g; ^" m^tal Co,,^, 0. van -1- Xj partial remainder resulting from the jth execution of the recursive process x„ dividend o X remainder q^ (for fractions) the jth digit of the quotient to the right of the radix point m the number of digits, radix r, used to represent the quotient d divisor Each x^ (j = 0, 1, ..., m) satisfies Ix I < k|d( , and the sign of each q.,-, is Chosen so that lx.^^l= (r Ix.l - Iq.^J Idl) , For IdJ Iq.^^l ^^^ < rlx^l < rkldl |x I Ix. J '^j+l'max" ^Idl" Idl " k(r-l). For non-restoring division, k = 1; it vri.ll be shown that division methods exist for certain discrete values of k in the range 2 4 ^ < !• From the equation for the recursive process it can readily be shown that the division procedure is correct. For j = 1 ^ = ^^0 " ^1^ For j = 2 X2 = rxj_ - q^d = r\ - (rq^ + ci^)d For J = m X, = r^^ - (r^^ . r^^ * . • . * r^, * ^)d The shifted remainder r"'^^ is them -m ^ m -1 v*iere ^^ r" q^ represents the quotient Q. It then follows that Qd + r'^'x = x • m o' i.e., the sum of the shifted remainder and the product of the quotient and divisor is the dividend. -2- The mechanization of the recursive process requires three distinct steps: 1) The partial remainder x. is shifted, i.e., multiplied by J the radix r, 2) One of several permissable arithmetic procedures is selected, such that the maximum absolute value of rlx.l, namely kridi, is reduced by the amount ~, so that the result x. -, satisfies '' r' j+1 Ix. T 1 < kldl. It should be emphasized that the reduction is j+1 - in the range over which partial remainders may vary, and not necessarily in the absolute values of specific partial remainders. 3) A quotient digit is generated corresponding to the arithmetic procedure selected. The key to the study of division m.ethods lies in the analysis of arith- metic procedures which reduce the allowable range of absolute values of the shifted partial remainder (rx.) by the amount — . Analysis of Arithmetic Procedures It is convenient to normalize the partial remainders ^/d-th respect to X. the absolute value of the divisor. If the substitution z. = rr is made, the range restrictions become -k < z . , < k and -rk < rz . < rk. Attention is then focused on arithmetic procedures which transform rz . into z . , . The easily mechanized procedures involve addition or subtraction of integral multiples of the divisor from rx. to yield x. ,; after normalization, the procedures involve addition or subtraction of integers from rz . to yield z . , . The arithmetic pro- cedures can be represented as a family of straight lines of the form z . .. = rz ,-i , where i = -n, ..., -1, 0, 1, 2, .,,, n, as shown in Figure 1. -3- U •H O •H CO •H 10 V «) o o I •H M :{^ U -P i» 0) •H »t3 In order for one of the proposed class of division methods to exist, it must be possible to superimpose a rectangle on the family of straight lines of Figure 1 in such a way that 1) the rectangle is centered at the origin, vdth vertices at (+rk, +k), and 2) the projections on the rz , axis of the line segments vdthin the rectangle cover that portion of the rz . axis within the J rectangle. It follows from the first condition that the vertices of the rectangle lie on the lines through the origin of slope +l/r, v^ose equations are z. , = I.Z., and the second condition requires that the rectangle be sufficiently large to in- sure that k ^ ^, Two additional considerations govern the choice of size of the rectangle; i.e., the choice of k and of n« a) The number of lines of the form z . , = rz .-i necessary to satisfy condition 2 should be a minimum. The number of multiples of the divisor "v>riiich must be formed is proportional to the number of lines employed, b) The overlap of projections of the line segments on the rz . axis J should be maximized. The precision necessary in the selection process decreases as the overlap increases. The two considerations are mutually contradictory since a) requires that the size of the rectangle should be increased and b) requires that the size be decreased. The considerations govern the choice of k to the extent that k should take one of a discrete set of values such that the vertex (rk, k) of the rectangle lies on a line z . ., = rz .-n. Any one division method can then be characterized -5- by the positive integers chosen for r and for n. The value of k as a function of r and n can be found by solving for the point of intersection of the lines z. , = z. and z , = rz^-n. The value J -'- 3 3"*"^ J of z . -| at the point of intersection is k, and is found to be — ^. The require- 1 r-1 ment that k > ^ becomes n > ~2~» The choice of n for some given radix r involves a balance between time and equipment costs associated with the selection process on the one hand and similar costs in forming multiples of the divisor on the other. Since the balance is so much a function of design details, the choice of n will be dis- cussed further only in connection with specific examples. Quotient Conversion The conventional representation of a quotient requires that each digit be one of the positive integers 0, 1, ..o, r-1. Since non-restoring division and the method described here involve negative digits in the quotient, some means of conversion is required. The technique employed in conventional non-restoring division, except for the special case of the binary system, can be described for a radix complement representation by the follovjing rules, 1) If q^KO, replace q-. by qJ = r+q, and set the sign of the quotient negative; if q-, /"O, q' = q-i ^ and the quotient is positive. 2) For j = 1, 2, ..., m-1, inspect q'. and q-.-. • If '^•+-|'^ ^f replace q' by q»-l and replace q.^^ by q» ^ = r+q^+i* If Q'_.n >0, q'. is left unchanged, and q.' = q.,-, . -6h- The rules require a serial inspection of the quotient digits, most significant digit first. When a negative digit is encountered, it is added to the radix, and a unit is borrowed from the next most significant digit. For the proposed division method, the conversion is complicated hj the fact that 0' s are permissable quotient digits. The inspection of the sign of q. - (or q, in rule l) must be replaced by an inspection of signs of the divisor d and the partial remainder x. (x in rule l) to determine the sign of the next non- zero quotient digit. Agreement of signs of x. and d corresponds to q. , >0 in the above rules; disagreement corresponds to q - < 0, Alternatively, signs can be determined in the usual v/ay and can be associated with those q. , which are zero. These modifications provide for a borrow propagation through a sequence of 0»s. Both sets of conversion rules require that no quotient digit q. be such that lq.l> r-l. In particular, the parameter n is one value that |q.| can assume, J J and therefore n ^ r-l. Thus, n is restricted to the range -pCr-l) £ n < r-l, since it was previously established that n > -rCr-l). Preliminary and Terminal Operations The requirements which necessitate preliminary or terminal operations for division methods include: 1) The requirement of standardizing the quotient, in a floating point division, and the requirement of overflow detection in a fixed point unit, 2) The requirement for a rounded quotient, 3) The requirement that a correct remainder be generated. Procedures vary in computers in use. For the division methods described in this paper, the above reo^uirements necessitate comparable preliniLnary or terminal -7- operations; there are additional requirements imposed by the division methods described here. One requirement is that each partial remainder x. should satisfy «J IXj, < kidl where d is the divisor and ^ < ^ 1 !• ^^i particular, the restriction applies to the dividend x , and may necessitate additional preliminary operations for division methods for which k <1, in contrast to conventional procedures for which k = 1, Preliminary standardization of the divisor simplifies the selection of the correct multiple of the divisor during the recursive process, since the precision required for selection increases as the minimum absolute value of the divisor decreases. The proposed methods are therefore best suited for use in arithmetic units having facilities for floating point operations. The methods can be used for fixed point division if facilities for simultaneously shifting divisor and dividend are available. Generation of a remainder x such that the division algorithm m ^ -m Qd + r X = X (where Q is the quotient represented by m digits, radix r; d is the divisor, and x the dividend) is satisfied, poses additional pixDblems, If d and x are initially shifted left p digital positions so that d ' = r d and x' = r^x - then the value of x' such that Qd* + r x* = x* is foxind to be m mo x' = r^3c . For a fixed point division, it would thus be necessary to shift the remainder x' p digital positions right to obtain the correct remainder x • m ^ ^ '^ '^ m A second difficulty arises when the quotient conversion rules require the least significant digit q' of the converted quotient to have the value r. If, as is often the case, facilities for addition are not available for the quotient register, q' can be set to the value r-1, and the remainder x must -8- then be reolaced by x' = x +d. The divison algorithm becomes •^ m m -m\ -m/ (Q-r )d + r" (x^+d) = x^. Similar results are obtained when conventional non-restoring division methods are employed. Example 1 » Radix 4 division Conventional radix 4 division methods require either two uses of the adder (use of one adder sequentially or two adders in parallel) or the formation and storage to full precision of 3d^ where d is the divisor. The division method of the class proposed here with r = 4 and n = 2 requires a single adder, con- ditional doubling and complementing circuits, and a selection circuit to compare rx. \d.th 0,5d and 1.5d to a precision of 6 binary digits, if -j- < |dj < 1, The mechanization of the division scheme is indicated diagrajnmatically in Figure 2, f (J ompl erne n t i ng Circuit Conditional Doubling ^ Circuit Figure 2 Radix 4 Division "9- The selection circuit performs three fiinctions, based upon the 6 most significant binary digits of liX.. (or x. if desired) and of d. These functions are: 1) Compare signs of x. and d. If signs agree, set the complementing circuit to subtract^ if signs disagree, set the complementing circuit to add, 2) Compare absolute values of 4x. and 1.5d. If 41 x. I > l-rldlj the conditional doubling circuit must be set to form 2d. If 4lx.l < l^-ldl , the circuit must be set to form d. If l:rldl <4lx.l < l'T-|d|, the conditional doubling circuit can be set either way, depending upon the design details of the selection circuit. 3) A similar comparison of absolute values of 4x. and (l/2 + l/6)d •J is made. For the smaller values of4lx.l,x. t =4x.: other- vri.se X. , is transferred from the binary adder. After x. -, is formed, 4x. - is formed by a radix 4 left shift to replace 4x.« The values selected for the quotient digit q. - must correspond to the selec- tions made, as summarized in the table below: Selection 1 Selection 2 Subtract 2d Subtract Id Subtract Id Add 2d Add Id Add Id election 3 ^3*1 ^3^1 ^ ° +2 ^J.l = ' ♦O h^l ^ ' +1 7^0 -2 = -0 ^0 -1 -10- Example 2 . Radix 10 division From the many possible choices available to the designer, the radix 10 division method of this example is based upon the following: 1) The excess three representation of decimal digits is chosen. 2) A single adder is used sequentially, 3) Storage is provided for the divisor d, but not for any of its multiples, 4) A complementing circuit and a conditional doubling and quin- tupling circuit are employed, vdth +_d, +2d, and +5d available as inputs to the adder. 5) The division method is characterized by r = 10, n = 7, with k = n ]>-l 9* Doubling and quintupling circuits can be described by the sets of Boolean equations q = b(aVc Vde) V ac(dve) r = c ® (ide Vade) s = a@d®e V for doubling t = e u = a and V = e w = aCeVbV cd) V eb(cVd) X = b @ (ecd Vecd) ' J = e ® c ® d z = d for quintupling -11- where, in excess three notation, a, b, c, d; q, r, s, t; and v, ^^;, x, y represent one decimal digit of the divisor, 2x( divisor), and 5x( divisor), respectively, and •where e, u, and z are binar^,^ interdigital signals. If the permutation a' = b , b' = c , c' = d, d' = e^ e' = a is made in the divisor digits, and the permutation v = u, w = q, x = r, y = s, z = t, at the output of the circuit, the doubling circuit is transformed into a quintupling circuit. Thus the same hardware can be used sequentially for both doubling and quintupling, provided permutation and complementation of input and output signals is correctly arranged. The arrangement of hardware required for the division scheme is shown in Figure 3* The two steps required for the generation of each decimal quotient digit can be described as follows. X X. j+1' 0+1 xlO xl ;^Q =0 10 xj,x' 1. iti ^-f Selection Circuit Sign Comparison ConparelOlx.l^ 2-||dl ■9- 2a .Compare X 2b, Compare X Ah |di ild. Decimal Adder (Excess 3) xl Figure 3 A Decimal Division Method C omplementi ng Circuit , x2 x2,-x5 Permutation- Circuits Excess 3 Doubling and Quintupling J Gil ..ait / / / H x2. •x5 I / Divisor -12- Each quotient digit q. . can be decomposed into two digits q'.^-, j qi'-i-i * such that q ^^ = q»^^ + qj|^, ^^ere q»^^ = -5, 0, or $ and qj|^ = -2, -1, 0, 1, or 2, Step 1 corresponds to the determination of q'. , and results in the formap- tion of a quantity x'._j_, such that x' T = lOx. if q' T = or Ix' I = IdOlx I- 5ld|)l if q» =+5 Step 1 reduces the range <_ lo!x.|< Y^ldl to < Ix'^-^^l < 2|ldl. The result of step 2 is x. ., , whose range is < |x. J\<. ^IdL Step 1 is not re- quired whenever q' , = 0. The details of operations performed for all ranges of lOx. and x* . ^ are summarized in the table below. The overlap of •^Idi in J J+1 9 the ranges is such that three decimal digits of d and of lOx. or x' ^ are re- quired for comparison, provided d is standardized to the range l/lO < |d| <, 1. Range of lOx. Step 1 q._^. Range of x'._^, -7jldl<10x.<-2|y Add $|d| -5 -2jldkl0x. < 2^|d| Not required 7 7 2§|dl<10x, < 7? Id I Subtract 5 Id I +5 7 J 7 L -2^|dl