On-Line Algorithms for Division and Multiplication

On-Line Algorithms for Division and Multiplication

IEEE TRANSACTIONS ON COMPUTERS, VOL. C-26, NO. 7, JULY 1977 681 On-Line Algorithms for Division and Multiplication KISHOR S. TRIVEDI AND MILO0 D. ERCEGOVAC Abstract-In this paper, on-line algorithms for division and subtraction operations always satisfy this property. multiplication are developed. It is assumed that the operands as well Atrubin [3] has developed a right-to-left on-line algorithm as the result flow through the arithmetic unit in a digit-by-digit, most significant digit first fashion. The use of a redundant digit set, for multiplication. In this paper, we will retain our earlier at least for the digits of the result, is required. definition of the on-line property where all of the operands as well as the result digits flow through the arithmetic unit Index Terms-Computer arithmetic, division, multiplication, in a left-to-right digit-by-digit fashion. on-line algorithms, pipelining, radix, redundancy. Consider an mr-digit radix r number N = 1=l nir-i. In the conventional representation, each digit ni can take any I. INTRODUCTION value from the digit set 0,1, - - ,r - 1}. Such representa- IN THIS PAPER we consider problems of divi- tions, which allow only r values in the digit set, are non- sion and multiplication in a computational environ- redundant since there is a unique representation for each ment in which all basic arithmetic algorithms satisfy the (representable) number. By contrast, number systems that "on-line" property. This implies that to generate the jth allow more than r values in the digit set are redundant. digit of the result, it is necessary and sufficient to have the Redundant number representations are often useful in operands available up to the (j + 6)th digit, where the speeding up arithmetic operations [4], [5]. It is not difficult index difference 6 is a small positive constant. It is neces- to see that the use of redundant number representation is sary to accumulate 6 initial digits of the operands in order mandatory for on-line algorithms. If we were to use a to produce the first digit of the result. Subsequently, one nonredundant number system, then even for simple op- digit of the result is produced upon receiving one digit of erations like addition and subtraction, there is an on-line each ofthe operands. Thus ( is the on-line delay. Such al- delay 6 = m due to carry propagation. If we allow redun- gorithms can be used to speed up an arithmetic multi- dancy in the number representation, then it is possible to processor structure due to their potential to perform a limit carry propagation to one digital position. A well- sequence of operations in an overlapped fashion. Another known example is the totally parallel addition in the signed possible application is in performing variable precision digit representation [4]. This gives us an on-line algorithm arithmetic. The on-line property implies a left-to-right for addition (and subtraction) with 6 = 1. Campeau [6] has digit-by-digit type of algorithm and consequently, a re- developed an on-line algorithm for multiplication with ( dundant representation, at least, of the results. For addi- = 1. In this paper, we develop a new on-line algorithm for tion and subtraction, algorithms satisfying the on-line division where the value of 6 depends upon the radix and property can be easily specified. Multiplication requires other properties of the number system employed. In par- a somewhat more elaborate approach arnd there are several ticular, we will present an on-line binary division algorithm possible ways of defining an on-line algorithm. However, with 6 = 4 (i.e., a 4-bit on-line delay). We will also show that the existence of an on-line division algorithm is not obvious an on-line decimal division algorithm can be obtained with and its analysis appears interesting. 6 = 4 (i.e., a 4-digit on-line delay). We also develop a Note that it is possible to define the on-line property compatible on-line multiplication algorithm with 6 = 1. with respect to a subset of the operands and/or the result. After introductory remarks, an analysis of the on-line For example, conventional division has the on-line prop- division problem is given in Section II. The radix-2 case erty with respect to the quotient. Similarly, conventional with nonredundant operands is considered first and a multiplication has the on-line property with respect to the feasible on-line algorithm is defined. Later, a generaliza- multiplier. Several authors have extended the on-line tion of this on-line algorithm for redundantly represented property of multiplication to the product digits as well [1], operands and higher radices is given. In Section III, a [2]. It is also possible to define the on-line property with compatible on-line multiplication ailgorithm is consid- respect to a right-to-left mode of operation. Addition and ered. Manuscript received January 20, 1976; revised January 5, 1977. This II. DIVISION work was supported in part by the National Science Foundation under Grant US NSF DCR 73-07998. Let the radix r representations of the positive dividend, K. S. Trivedi was with the University of Illinois at Urbana-Champaign, Urbana, IL 61801. He is now with the Department of Computer Science, divisor, and quotient be denoted by N, D, and Q, respec- Duke University, Durham, NC 27706. tively, such that M. D. Ercegovac was with the Department of Computer Science, Universityof Illinois at Urbana-Champaign, Urbana,IL 61801. He is now m m m with the Department of Computer Science, School of Engineering and N= ,nirTh D= Edir-i, Q = E qir- Applied Science, University of California, Los Angeles, CA 90024. i=l i=l i=l 682 IEEE TRANSACTIONS ON COMPUTERS, JULY 1977 and that in algorithm D1 due to the corrective action necessi- Q = N/D to m digit precision. tated by the operand digits that arrive at the jth step. The convergence of algorithm D2 can be established as If all the digits of the operands N and D are known in follows. From the recursions of algorithm D2, the following advance then the division can be carried out by the fol- expression for Pj is easily established by induction on j. lowing well-known algorithm DI. Algorithm D1: = r[ - qiri) ( diri)], (2.1) Step 1 [Initialize]: PO - N; j O- 0; nir-i (IE Step 2 [Selection]: qj+1 <- Select (rP1,D); Step 3 [Basic Recursion]: Pj+j l- rPj -qj+D; which implies that Step4 [Test]: Ifj < m - 1thenj 4]j + 1, andgoto Step 2; Pm = rm[N - QD] End D1; and In this algorithm, Pj is known as the jth partial remainder and rPj is known as the jth shifted partial remainder. The Q = NID - Pmr-m/D. (2.2) selection procedure of Step 2 obtains the new quotient Therefore, if we can establish a range restriction digit qj+1 such that Pj+1 satisfies certain range restrictions < [5]. This process requires the comparison of rPj against PjA caD (2-3) some constant multiples of D. The use of redundancy in with ½ < a < 1, then from (2.2) we deduce that Q is the the representation of each digital position of the quotient required quotient to mr-digit precision [5]. Note that the allows us to select qj+I based on the inspection of a limited value of a is determined by the properties of the number number of leading digits of rPj and D [5]. Furthermore, system employed [5]. For j = 0, (2.3) can be satisfied by these methods can also be extended to the case when both appropriately preshifting the dividend. Assume that there the partial remainder and the divisor are in redundant is a selection procedure that generates the quotient digit form [7]. It is clear that without the use of redundancy it qj+1 so as to guarantee Ip1i+I < aD given that IPj < aD. is not possible to avoid a set of full precision compari- Then by induction, the range restriction (2.3) will hold for sons. all values ofj. Therefore, we will now derive such a selec- The present problem is that the digits of the dividend tion procedure. Instead of proceeding directly, we will first and the divisor are not known in advance but are available establish a bound on IPj - Pj and then a selection pro- on-line, digit-by-digit, most significant digit first. It should cedure will be developed that guarantees IPj < a 'D. This be clear at the outset that in the absence of redundancy the in turn gives us a bound on Pj. We will first discuss a simple problem cannot be solved. case in which the radix is two and the divisor and the Let us assume that the first digit (q1) of the quotient can partial remainders are in nonredundant forms. Later, we be obtained after 6 leading digits of the dividend and the will generalize to an arbitrary radix with all operands in divisor are known. Thereafter, one new digit of the quo- redundant form. tient can be obtained upon receiving one digit each of the dividend and the divisor. We can then specify the following A. Binary Division with Nonredundant Operands algorithm D2. From the recursions of algorithm D1, the following Algorithm D2: equation can be derived by induction. Step 1 [Initialize]: Po nir-i4 P m i=l1 Pi = ri -E nir-i - (ii qir-i) ( dir-i)]. (2.4) _i=l Do E dir-i; j 0; From (2.1) and (2.4) we have i=l1 Step 2 [Selection]: qj+1 -- Select (rPj,D1) pi -Pi = ri [E nir-i Step 3 [Basic Recursions]: i=j+b+1 f)j+l fi+ dj4++l-ri45 - (.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us