LI E> R.A FLY OF THE UN IVLRSITY OF ILLINOIS 510.84 I«6r no. £50-256 cop. 2. Digitized by the Internet Archive in 2013 http://archive.org/details/correspondencebe252robe 'x6V A ^S"£" Report No. 252 7>f {lZJ< THE CORRESPONDENCE BETWEEN METHODS OF DIGITAL DIVISION AND MULTIPLIER RECODING PROCEDURES by James E. Robertson December 21, 1967 THE LIBRARY OF THE AUG lo 12S f J UH1VERSITV Of ILLINOIS Report No. 252 THE CORRESPONDENCE BETWEEN METHODS OF DIGITAL DIVISION AND MULTIPLIER RECODING PROCEDURES BY James E. Robertson December 21, 1967 Department of Computer Science University of Illinois Urbana, Illinois 6l801 TABLE OF CONTENTS Page No, 1. INTRODUCTION ...................... 1 2. REVIEW OF THE THEORY OF MULTIPLIER RECODING. ...... 3 3. THE SIMPLEST MINIMAL RIGHT-DIRECTED BINARY RECODING. . . 5 k. DIVISION AS A METHOD OF RECODING ............ 7 5. THE SCALED DIVISION. .................. 10 6. THE CORRESPONDENCE BETWEEN MULTIPLIER RECODIUG AND ... Ik THE SCALED DIVISION 7. THE CLASS OF RIGHT -DIRECTED RECODINGS CORRESPONDING. . . 16 TO THE SCALED SRT DIVISION 8. ANALYSIS OF THE SRT FAMILY OF RIGHT-DIRECTED ...... 18 RECODINGS 9. THE RIGHT-DIRECTED RECODING CORRESPONDING TO THE .... 26 STRETCH DIVISION WITH d = 2/3 10. A RIGHT-DIRECTED DECIMAL RECODING. ........... 28 11. SUMMARY. ........................ 30 BIBLIOGRAPHY' ...................... 31 1 . INTRODUCTION Statistical analyses of the so-called SRT* method of binary division have been conducted by Freiman [l] and Shively [8], At each recursive step of this division procedure, three alternatives are possible; shift left, add and shift left, or subtract and shift left. One may therefore take the point of view that each quotient digit correspondingly has one of the three values 0, -1, or +1. Thus the division procedure results in a quotient in redundant recoded form, and it is the first purpose of this paper to establish the correspondence between the quotient recodings and a class of multiplier recodings. It is first necessary to review some aspects of the theory of multiplier recoding. For the binary case with recoded digital values of +1, 0, or -1, a recoding can in general be characterized by the choice of two Boolean functions For the important class of arithmetically symmetric recodings (defined below) the two Boolean functions are duals of one another, hence this class of recodings is characterized by the choice of one Boolean function. A third class of recodings is next defined by restricting the Boolean functions in such a way that each function can be determined by the choice of a single binary numerical parameter in the interval to 1. It is this third class of recodings that corresponds to the quotient recodings of the SRT division. The next step in establishing the correspondence is that of scaling. It is obvious that the value of the quotient remains unchanged if both the divisor and dividend are multiplied by the same parameter; similarly the detailed rules for each recursive step can be scaled in such a way that both the value and the particular recoded form of the quotient remain unchanged [3J. One further observation is that, although in practice the divisor for the SRT division is restricted to the range from l/2 to 1, the method is valid for ail divisors greater than 1. * The earliest published description of a binary division involving redundancy in the representation of the quotient is contained in reference U. t Numbers in brackets refer to articles listed in the Bibliography, -1- Although the primary emphasis here is on the binary case, with redundancy limited to the use of three digital values -1, 0, and +1. procedures and examples are described for establishing a correspondence with known division methods involving greater redundancy with radix 2, and with higher radix division methods. -2- 2. REVIEW OF THE THEORY OF MULTIPLIER RECODING A multiplier y is represented in radix r by a sign digit y and m nonsign digits y , y , . .., y . The algebraic value of a fraction y in radix complement representation is then m -i y ■ = -y + E r y ° i=l The multiplier y is said to be in conventional form if the sign digit y is either or 1 and if each nonsign digit y. has one of the r values 0, 1, 2, ..., r-1. The effect of recoding is to transform y into m digits y! (i = 1,2, . .., m), with each y\ selected from the extended set of values -(r-l), a . aJ -1, 0, 1, B „„, r-1 or from a subset thereof. If the extended set of values over which y : may range has more than r values, the recoded representation is redundant , The basic equation for multiplier recoding follows from the observation that the addition of a mode digit m. in digital position i is compensated for by the subtraction of rm, in digital position i+l„ The i net effect at the i-th digital position is then y i = y i + m i ~ m i-l • ^ X - The requirement that the algebraic value of y shall remain unchanged by recoding is expressed as m -l , r y! = y m m -y + E -i r y. = E o . - i i=l 1=1 and by substituion of equation 1, leads to the boundary mode conditions m - y and m = 0. Restriction of the range of y! to -(r-l), . , . , o o m l ' ' -1, 0, 1, „.„, r-1 restricts each m. to one of the two values 0, 1, The more usual practice in multiplication is to inspect first the least significant digit y and direct attention thereafter in a serial fashion to digits of greater significance to the left of y . The recodings considered here are right-directed; that is, the most significant digits are inspected first, and attention is directed thereafter serially to digits of lesser significance to the right, -3- For a right-directed receding, Equation 1 is applied recursively with i assuming the values 1, 2, „.,,,, m, in ascending order „ For each value of i, the values of m. , and y. are known, and m and y* are to be l-l i ' 11 determined o For the binary case fr=2), each y. and m. have one of the values ' i i 0, 1 and may be treated as Boolean variables, and y[ has one of the three values -1, 0, 1, The sign of y! is m. , the magnitude of y[ is y. @ m. (where is the symbol for EXCLUSIVE OR); therefore m. y! = (-i) x (y ± © m.) . (2) The unknown mode digit m. can be determined by the Boolean equation m. -: m y. ^ y f . v m. . g. (3) i i-I l l i i-l i in which m. , g. , for example, means m, . AND g. , the symbol v represents i-l i- _ - i-l i' the INCLUSIVE OR, and y. means NOT y. . The Boolean functions f. and g. ' l l 11 are in theory arbitrary functions of conventional multiplier digits other than y .. „ For the right-directed recodings discussed by Penhollow [5]» the functional dependence of f. and g. was restricted to digits y. ., for i l i+J j > 1, that is, on multiplier digits to the right of y. . It is sometimes convenient to impose the restriction of arithmetic symmetry on the recoding,, A recoding is arithmetically symmetric if the recoded representation of -y can be found from the recoded representation of y by replacing in each digital position O's by f s, fl's by -l'Sj and -l's by + I's„ The effect of arithmetic symmetry on Equation 3 is that f . and g. are dual Boolean functions; i.e. % - < ■ „k- 3, THE SIMPLEST MINIMAL RIGHT-DIRECTED BINARY RECODING A binary recoding is minimal if the probability that y! is nonzero is minimal. The simplest such right-directed recoding is obtained if, in Equation 3, f l ■ y l + l y i + 2 '• «i " f i ' y i + l v y i + 2 ' {k) D Since g. = f., the recoding is arithmetically symmetric, The tabular equivalent of Equations 2 and 3, with f . and g. defined by Equations h } is given in Table 1. Table 2 presents the numerical example of the recoding of the binary fraction -^-7 - 0.00101101, using the rules embodied in Table 1. Vi y i y i4l y i + 2 m. 1 n 1 0/1 0/1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0/1 0/1 1 1 Note 1: 0/1 indicates that the digit may be either or 1, Note 2i 1 = -1 TABLE 1 The Simplest Minimal Binary Right-Directed Recoding. -5- i Digits Inspected Corresponding Values Result of Recoding Comments 1 m o y-, y 2 y 3 1 m =0 yj=o 1 2 m l y 2 y 3 y U 1 m 2 =0 y 2=° 3 m 2 y 3 y k y 5 1 1 m =0 y'=i h m 3 y u y 5 y 6 1 1 m, -1 K =1 5 m k y 5 y 6 y T 1 1 1 m =1 y^o 6 m 5 y 6 y 7 y 8 1 1 1 m 6 =l y^o 7 m 6 y 7 y 8 y 9 1 1 ny=l y ? 2 8 "t y 8 y 9 y io 1 1 Bg-0 y§=i 2,3 Comments; 1. m = y is the left boundary condition, o o 2, y_ and y are assumed to be zero. j7 _L\J 3. The right boundary condition mn=0 is satisfied. TABLE 2 Recoding of ^£ The result of the recoding is .00110011 = -~|- k. DIVISION AS A METHOD OF RECODING The recursion relationship applicable to many varieties of division is X, = r X.^ - q. d , (5) in which r is the radix, i is an index ranging from 1 to m, the number of quotient digits, d is the divisor, X. and X. are successive partial remainders, and q is the itn quotient digit „ The initial partial remainder X is the dividend„ The basic problem in division is that of selection of o q.; this selection is based on the values of the shifted partial remainder r X. , and the divisor d. l-l The problem of selection of q. is eased if q. is redundantly represented; that is, if each q. may have more than r values. The rules for selection of q , coupled with Equation 5, characterize a method of division, aside from special procedures preliminary to and following the recursive steps. Division may be regarded as a recocting procedure if the resultant quotient is represented in other than conventional form, Let V = » , • (6) where Q is the number to be receded „ Both the divisor d and the product Qd are in conventional formj division by d then produces Q" , an algebraically equivalent but recoded version of Q The simplest division with redundancy in the representation of the quotient is the binary SRT method. With r=2, each quotient digit q. may have one of the three values -1, 0, or *1, The selection rules are particularly simple, and are; (1) If -| < 2X 1 . 1 < | , q. = (2) !.f d > and - < 2X. ,. then q. = 1. and 2—1-1' i ' if a > and 2X. . < -r. then q. = -1. — l-l 2' l (3) If d < and 2X. . < --, then q. = 1. and l-l 2' l ' if d < and - < 2X. .. then q. = -1. 2 - i-1' l -7- Although the method is normally used with the divisor normalized (i.e., either — < d < 1 or -1 .< d<-— ), the method remains valid if the upper limit on the magnitude of the divisor is removed (i.e., either d > 1 or d < -1 ) . The recoding equivalent to that of Table 2 is obtained if, in Equation 6, d = ~, Q = ^T^t and Qd = T^o". The division — illustrated in Table 3^ using the rules of the SRT division, yields a quotient Q', each digit q. of which is identical with the corresponding digit y[ resulting from the right-directed recoding of Tables 1 and 2. The division example 2 of Table 3 is artificial in the sense that the divisor d = — cannot be 3 2 represented in a binary computer of finite precision. In the table, — is » j represented as 0.1010 or a variant thereof, the dot indicating a repetitive pattern, and the length of the stroke indicating the period of the repetitive pattern. •8- 2 x o ---. 0.001111 X 1 = 2 x o = 0.001111 2x i = 0.01111 X 2 = 2x i - 0.01111 2x 2 o.mi -d = 1.010101 X 3 = 2x 2 - d = 0.010001 2X 3 = 0.10001 -d = 1.01010 x h = 2x 3 - d - 1.11100 2 \ = 1.1100 X 5 = 2x U = 1.1100 2x 5 = 1,100 x 6 = 2x 5 = 1,100 2x 6 = 1,000 +d = 0.1010 X 7 = 2x 6 + d - 1.1010 2 3U = 1.010 +d = 0.101 Xo = 2 x^ + d = 0.000 o 7 q x -0 q 2 = q 3 % % % = 0,-1 ^ = 1 15M 15/32 15/16 13/W 13/2U -3/24 = -1/8 -l/U -1/2 -1 -1/3 -2/3 TABLE 3 SRT Division of ^|| by | US — The Result of the Division is rr4 = 0.00110011 -9- 5. THE SCALED DIVISION Many of the properties of a division method remain invariant under scaling by an arbitrary multiplicative factor z, provided that not only Equation 5 but also the rules for selection of quotient digits are scaled by the same factor z„ Figure 1 illustrates the mapping of jr X. | onto |X. | for the Q 1 — -L 1 SRT division with d = — . 1 2 I* -a *-f 1 : 2 \ |2 x ~" y l 6 i-l' 1 FIGURE 1. Conventional SRT Division with d = 2/3. The analysis of the division of Figure 1 is similar to that of Freiman, but differs in two important respects: (1) The interval of shifted partial remainder magnitudes (i.e., of |2 X. |) is (0,l) rather than (-, l) (2) One step corresponds to the generation of one quotient digit, rather than an addition or subtraction followed by normalization. The quantity — , the abcissa of the discontinuity in the mapping function in Figure 1, is called the comparison constant since the comparison of 1 2 X. _, I with this constant determines whether q. is zero or ,.±1, The 1 1-I 1 1 comparison constant plays the following important role in the analysis of -10- the SRT division. If - and - are defined by -" = lira (- - a) A->0 1+ = lim A-^0 (|+ A) A > then endpoints of intervals are — and the images of — and — , namely 112 2 2 0, —, ~, —j and 1. The intervals thus found are a, P, 7, and 5 and the steady state probability that 2 X i-1 - for OL and y for f3, y , and 8. The probability that |q. | is 1 is then the / 1 \ 1 1 probability that 1 2 X. | is in the interval (— , l) and is r*. Since the shift average is the reciprocal of this probability, = 3» Figure 2 shows the effect of scaling Figure 1 by the factor z = 2d \k a '—^)^— p '— >|<- 7 ! ->|-e 2 u i-l FIGURE 2 Scaled SRT Division If the scaled partial remainder is denoted by u., then u. = z X., ill for each value of i. Thus each partial remainder, including the dividend x , is scaled. The divisor scales to —, and the comparison constant scales 1 13 2 from — in Figure 1 to — z = -k m Figure 2. The images of the comparison constant; i.e., the end points of the intervals, are also scaled by the factor z, The probabilities associated with- the intervals remain invariant; the probability densities, since interval lengths scale by z, ■11- -1 1 l Q are scaled by the factor z , Equation 6, with z = — scales to Q' = — , 2d 1 2 and the quotient Q 1 resulting from the scaled division is identical not only in algebraic value but also in digit pattern to the quotient resulting from the conventional SRT division. In effect, the conventional SRT division is characterized by a comparison constant which is always — ; the divisor value is the parameter that determines the properties of the recoding. The choice of the scaling factor z = — results in a procedure in which the "divisor" is always — and £_Cl -j 2 the comparison "constant" — z becomes the parameter which determines the properties of the recoding. More complicated methods of division involve addition or subtraction of more than one divisor multiple of the form nd, and perhaps values of the radix r greater than 2. (The radix r is an integer, and n is usually an integer, but is sometimes a simple rational fraction.) For these divisions, the scaling factor is z = — , and the "divisor multiples" are, after scaling, of the form — . The scaled version of the SRT division example of Table 3 is presented in Table k. The scaling factor is z = rr = j- f the dividend is — Q, = — ^ , the "divisor" is — , and the comparison constant is — z = q. The detailed rules for selection of quotient digits are those given for the SRT method, 1 • 3 with the comparison constant — (and its negative) replaced by g- (and its negative) and with each partial remainder X, replaced by the corresponding scaled partial remainder u. . Note that each quotient digit resulting from the scaled division is identical to the corresponding digits of Tables 2 and 3. Equation 5 becomes u. = 2 u. --q,, with the dividend 1 n JH ii-12i- U o = 2 Q = 512' -12- X = 0.000101101 2 x - 0.00101101 x l - 2 x o 2x i - 0.00101101 = 0.0101101 q x = X 2 = 2x i 2x 2 = 0.0101101 = 0.101101 q 2 = -d = 1.1 q 3 = 1 X 3 = 2x 2 - 2x 3 d = 0.001101 - 0.01101 -d = 1.1 % = 1 x k = 2X 3 - 2x u d = 1.11101 = 1.1101 *5 = 2x u 2x 5 = 1.1101 : 1.101 q 5 = x 6 = 2 x^ 5 2x 6 - 1.101 = 1.01 %~ + d = 0.1 h = 1 X T = 2x + 2x ? d = 1.110 = 1,100 +d = 0.1 % = 1 x 8 = 2x + d = 0,000 TABLE k 1 3 Scaled SRT Division With ± z = g -13- 6. THE CORRESPONDENCE BETWEEN MULTIPLIER RECODING AND THE SCALED DIVISION The first step in establishing the correspondence is to show that the basic equation for multiplier recoding (Equation l), when augmented by the weighted sum of multiplier digits y. . , 1 < j < m-i, can be interpreted as the recursion relationship for the scaled division. The second step is to translate the detailed rules for selection of quotient digits into Boolean functions or an equivalent statement of the rules for a right-directed recoding . Equation 1 may be rewritten as " m i-l + r y i = r ^ y j " m i^ ^ in which, for a right-directed recoding, m. and y. are known, and y! and m. are to be determined. Adding m-i . , £ r'J" 1 y. . 3-1 1+J to both sides of Equation 7 yields m-i _ . _-, , m-i -m + E r y . . = r (y! - m + Z r J y ) (8) i-l J=0 lf J 1 X j = l 1+J If r u , is defined as l-l then m-i . ., r u. . = -m. _ + L r y, ., l-l l-l J i+j' m-(i+l) _ m-i . r u. = -m. + Z r J " y. . . = -m. + Z r ° y. . i Q *i +J+ l i ^ i +J Substition in Equation 8 yields r u._ 1 = r "" (y!, + r u^ , or, u. = r u. n - r y! (9) i i-I i -Ik- Equation 9 can be interpreted as the recursion relationship for division, Equation 5 , scaled so that the divisor becomes — ; that is, 1 r z = — r. The quantity r u. _, is identified with the scaled shifted partial remainder, which is known, u. is the partial remainder to be determined, and y! is identified as the quotient digit to be determined by the selection rules. The mode digit m. is identified as the sign digit of the partial remainder u. . l The above analysis indicates that Equation 5 for division and Equation 1 for recoding are of the same order of generality. Just as it is necessary to augment Equation 5 with a specific set of selection rules in order to completely characterize a division, it is also necessary to augment Equation 1 with specific rules for determining the values of recoded digits. One of the advantages of the correspondence established here is now obvious. Sets of selection rules augmenting Equation 5 are known for a wide variety of division procedures, including use of a higher radix than the binary, and including use of quotient digit values which are not integers. On the other hand rules augmenting Equation 1 have been limited to radix 2 with recoded digit values of -1, 0, and 1, Thus, the translation of the quotient digit selection rules into rules for right-directed recodings, to be discussed in connection with specific methods of division in examples to follow, can be expected to provide additional insight into the theory of right- directed recodings. •15- 7, THE CLASS OF RIGHT-DIRECTED RECODINGS CORRESPONDING TO THE SCALED SRT DIVISION The analysis of the previous section indicates that for a binary- radix the scaled partial remainder 2 u. . is related to the Boolean variables l-l employed during recoding by the equation m-i 2 u. . = -m. _ + Z 2" J " y. .. l-l l-l J i+j Equation 3- for an arithmetically symmetric right-directed recoding, is - D , N m. = m. , y. v y. f . ^ m. . f . (10) l l-l i i l l-l l Thus, 2 u. ., contains all the information necessary for the determination i-l D of m since the functional dependence of f. and f. is on the y. . (j > l). l li i+j - Furthermore , the quotient digit resultant from the division is equivalent >d known, from the equation I y[ = (-i) (y i ©m 1 ) . to the recoded multiplier digit y! , which is easily determined once m. is Vi It remains to be shown how, given the quotient digit selection rules, the function f. can be determined . i The quotient digit selection rules for the scaled SRT division with the scaling factor z = — , becomes 2d 7 1) If - | < 2 u < | , y! = (11a) 2 l-l d i 2) If | < 2 u i _ 1 , Y[ = 1 (Hb) 3) If 2 u.^ < - |, y^ = -1 (lie) These rules, with the recursion relationship (Equation 9 with r=2), namely u. = 2 Vl - | y' , (12) -16- completely describe the scaled division. In these equations, the scaling factor z is a parameter in the range < z < 1, corresponding to °° > d > — . The choice of z determines f . (and its dual) for substitution in Equation 10, 1 D Note that Equations 11 imply arithmetic symmetry; hence the use of f. in Equation 10 rather than the aribitrary function g. of Equation 3. The proof of arithmetic symmetry follows from the fact that if two divisions are performed with scaled dividends u and -u , equations 11 guarantee that in the two resultant quotients, corresponding digits will either both be zero or negatives of one another. Given the value of z, the function f . can be determined in the 1 -k following way. Express z as a binary fraction of the form 2 Z, where k is an integer (0 < k < <») and Z is an odd integer such that < Z < 2 . f. is then a function of k digits y ., for j = 1, 2, „.„,k, and has l l+J IT 2 - Z terms in its canonical expansion. Let each of the minterms associated with the k digits y. . ( j = 1, 2, . . . ; k) be weighted as follows: 1) If y . appears in the minterm, the weight w. is zero. 2) If y. . appears in the minterm, the weight w. is one. i+J J Then the weight W of the minterm is Z 2" J w j-l The canonical expansion of f . is then the disjunction of all 1 -k minterms having weights in the range z < W < 1 - 2 „ As an example of K the determination of f., consider the simplest minimal right-directed recoding, which corresponds to a scaled SRT division of Table h, with 3 3 k z = J7- For z = r, Z = 3; 2 ^ k, and k = 2. f . is then a function of y. and y. , and nas 2 - Z = 1 minterm. The four minterms associated l+l i+2 with y and y are y y with weight W = 0, y y with weight 1+1 L-fd. 1-rl l+£i d. 1+1 X+d. 1-1 3 % 3 y i+l Y i+2 With wei S ht 2' and y i+l y i+2 wlth wei S ht f- 0nl y the last minterm has weight W^ > z = f' > therefore f . = y. ., y. ^ and f. = y. n ^ y. ^, B 2 - h 1 J i+1 J i+2 i J i+1 J i+2 -17- 8. ANALYSIS OF THE SRT FAMILY OF RIGHT -DIRECTED RECODINGS The SRT division has been intensively analysed by Freiman and Shively. The crucial step of identifying the Markov chain as the mathematical model of the SRT division was made by Freiman. In Shively's model, one time step corresponds to the generation of one quotient digit, including zero values with partial remainder magnitudes in the range [0,1], In contrast, one time step in Freiman' s model corresponds to the generation of one nonzero quotient digit with as many partial remainder normalizations as are required, and partial remainder magnitudes are in the interval [— , 1]. Although Shively's results were originally given for the SRT division with the divisor magnitude |d| in the range [— , l], and with |d| as the independent variable, his results are restated here for the scaled SRT division with the scaling factor z - — as the independent variable, with z in the range [0, 1] . Thus, the trivial extension of Shively's results to include the divisor range l<|d|< oo (or < z < — ) is presented here, Shively's results are summarized with reference to Figure 3> which shows the location of the lower order discontinuities in the steady state probability density of the scaled partial remainder magnitude u as functions of the scaling factor z „ 1) The range of u is [0, 1-z] for < z < - and is [0, z] for — < z < 1. Therefore, the probability density is zero outside these ranges, namely in the triangular region bounded by u - 1, u = z, and u - 1-z. 2) The probability density p(u, z) is symmetric about u 1 2' for a fixed value z of z, o 1 . a „\ . _/l P (- + e, z q ) + P (- - e, Zq ) - 2 for o < e < I (13) Symmetry of this form implies that a plot of the locations of discontinuities in the probability density in the u, z plane for u > — is the mirror image of the plot of 2 l discontinuities for u < — . Furthermore, for each value z of 2 o -18- _i2- - r-l X^Iern^^- <0 m ' >c \ / <> -t <*\ ' ^^^ \ IO *«\ 1 ^x / \ CM / \ / \ / \ / \ / \ / \ / \ 0J - "X v'V \ t-i ">/ \ // \ ?7 \ \ / o»\ / 7>\ jy "'\ \ \ S i / x \ ~i i / X \ \ \ / / II ' ai **X N i / X \ i / \ \ i / x \ i / x \ i / \\ t/ I \\ -s N ro CJ Figure 3. Discontinuities of Order Three or Less -19- fclS ~) at u = 1 - z (z < — ) and at u = z ( z > — ) . By symmetry^ there is a negative jump in p(u, z) in the lower half (u < — ) at u = z ( z < — ) and at u - 1 - z (z >-), b) Given the kth order pair of discontinuities, with the equations k k vl = 2 z - b and u' = (b + l) - 2 z, the (k + l)st order pair is formed as follows (cf Equations 11, 12): i) If u < -, then u . = 2u. ^ 2 k+1 z - 2b n . k 2 ? k+1 k k 1 For u- > 1 - -, ^ +1 . (2b k + 1) - 2 z ii) If u^< |, then u' = 2uJ_ = (2b +2) - 2 + " z. - 2(u k - \) = 2 k+1 z - (2b k + 1) Thus, b is either 2b or 2b + 1, depending on whether For ^ > 1 - -, u^ : ^ - -. k k+1 k k vl or u* is less than z/2. Note that the two lines forming each pair of lines of discontinuity are symmetric. The two lines are symmetric if il + ii" = 1; since the rules for generating pairs of lines result in ii + W = 1, symmetry is preserved. c) For an interval of z, the process of generating pairs of lines of discontinuity terminates when il and u' are in ■21- the interval (— , 1 - — ) of u„ Let the value of k for the terminating pair of lines of discontinuity be T - 1. T-1 The lines are u T _ 1 = 2 z - b^ x and u^ - (b T _ x + l) ■ 2 z. These lines intersect at u = — , T z = (2b +l)/(2 ) } and the interval of z for which no additional lines of discontinuity can occur is 2b T-l , , 2 ^ b T-l + l) ~m < Z < Fp 2-1 2+1 Examples are 1 z l-z z = 1/2 2 2z-l 2-2z z = 3/4 k 8z-6 T-8z z = 13/16 3 4z-3 4-4z z - 7/8 4 8z-T 8-8z z - 15/16 U™ , ul intersection interval of z with u = l/2 < z < 2/3 2/3 < z < 4/5 4/5 < z < 14/17 6/7 < z < 8/9 14/15 < z < 16/17 5 J Symmetry requires that the magnitudes of the jumps at each of the two discontinuities of a symmetric pair be equal. If the magnitude of the jump at u is a , then the sum for the symmetric pair u , u" is 2a . The magnitudes of the jumps form a geometric sequence; that is, a, _ = — a. . k+1 2 k For an interval of z having T pairs of discontinuities, the jump magnitudes are a, = " =- k = 0,1, ..., T-1 (14) k 2(1-2" T ) Equation 14 follows from the requirement that T-1 I 2a = 2, fc,0 k since the total change in the probability density from u = to u = 1 is 2, •22- 6) The probability P (z) that the recoded digit y! is zero is z 2 P Q (z) = I p(u, z)du. P (z) = z for < z < - o ~ - 3 P o (,)-|far|<.<|, 2 1 and P (z) decreases in a nonmonotonic way from — to — in o c 3 2 the interval t < z < 1. The probability P (z) that the magnitude of the recoded digit |y'. | is 1 is P (z) = 1 - P (z) 1 o and the shift average is 1 = P x (z; Shively's results, as restated above, form the basis for the analysis of the family of right-directed recodings corresponding to the scaled SRT division. The recodings which have attracted the greatest attention in the past are the minimal ones, for which P (z) has its 1 l minimum value of —. The minimal recodings of the SRT family correspond 2 5 to a choice of z in the range — < z < 'f. The simplest minimal recoding of Table 1 is obtained by choosing z to be the simplest binary fraction 3 in the minimal range; namely, z = r> which yields f . = y . y. _. Other ' h' J i i+1 i+2 relatively simple minimal recodings correspond to the choice of 11 1^ z " 16' ° r f i = y i+l ' y i+2 ^ y i+3 y i+0 and to the choice of z = 16 or f i = y i+l y i+2 ^ y i+3 ^ y ifV° -23- The minimal recodings of the SRT family are a subset of the minimal right-directed recodings found by Penhollov. The Penhollow minimal recodings differ in two ways: 1) For the SRT family, if a minterm of weight W is included in the canonical expansion of f., all minterms having weight greater than W are also included. This restriction does not apply to the Penhollow recodings; for example f i = y i + l (y i + 2 y i +3 v y i + 3 y i + ^ v y i-2 y i + U } yields a minimal right-directed recoding which is not a member of the SRT family, since the minterms of the 11 13 7 canonical expansion of f. have weights —r, tt, -k, and r7». The minterm of weight y- is not included in the canonical expansion of f.. 2) The restriction of arithmetic symmetry was not imposed by Penhollow. Let F. be the class of all minimal right- directed recoding functions f., and let G. be the class D x x of all dual functions f . . Then any function from the 1 class F and any function from the class G can be used 1 1 as f. and g., respectively, in Equation 3 to yield a minimal Penhollow recoding. Arithmetic symmetry, in contrast, requires that once f. is chosen, the one D 1 member of class G. which is f . must be used as g. , 1 1 1' rather than any member of class G. . 1 Other recodings of the SRT family of historic interest are: l) z = 0, f . = 1 , f. - 0. In this case, the recoding equation reduces to m = y. , and each y; is either +1 or 11 1 -1. The corresponding division method is nonrestoring division. -2.h- 2) z = — f. - f. = y . n . This recoding corresponds to 2 ' i 1 l+l differentiation in the following physical sense. Assume that a magnetic surface is magnetized positively for each digit y. which is one, and is magnetized negatively for each digit which is zero. The recoding corresponds to the pulse pattern obtained as the magnetic surface is moved past a reading head if a positive pulse is associated with +1, a negative pulse with a -1, and the absence of a pulse with zero. This recoding is also related to the transformation from binary to the Gray code. 3) z = 1 , f . = , f . - 1. The recoding equation reduces to m. = m. . , so that y! - y. if m = y =0, and 1 _ 1-1 11 y! = -y. if n = y = 1. Thus positive numbers are left 1 i o o unchanged by this recoding, and a negative number is replaced by the digitwise negative of its diminished radix complement. 2 2 h) z = ~. The recoding for z = — is the canonical recoding discussed by Reitwiesner [6], and shown to be the simplest minimal left-directed recoding by Penhollow. 2 The fact that — cannot be represented by a finite number of binary digits indicates that, as a right- directed recoding, it would be necessary to inspect all digits to the right of y. . ■25- are 9. THE RIGHT -DIRECTED RECODING CORRESPONDING TO THE STRETCH DIVISION WITH d = | In the STRETCH division [2], additional redundancy is introduced into the representation of the quotient in such a way that the probability that the quotient digit is zero, and hence the shift average, is increased. 3 3 The divisor d, and the multiples r- d and — d are available for addition or subtraction at each step; hence the possible values for each quotient digit i _i _4 o T; 1, and — . In addition to the comparison constant k = — to determine if another step of normalization can be performed, two more comparison constants 7 are required. Ideally k = oJd| would be employed to separate the partial 3 remainder range for which |q. | = y-, from the partial remainder range for which | q . | = 1. Similarly k = r~ |d| would be used to separate the range for which |q. | = 1 from the range for which | q . | = — . 2 1 With d - — , and after scaling so that the scaled divisor is — , the equation relating successive partial remainders is x. = 2 x. - - y! i 1-1 2 l and the rules for selection of y! are l If 2 x i-l < "I' y i = ~\ lf -i ^ 2 x i-i <-&> K = - 1 ^ -iJ < 2 x. _ x < -I y ! = ~l If -| < 2 x. , < |, y' = 8 - " i-l Q> i 3 -i-i f * : 16' r i ' h If ~i * 2 x i-i < I- y i = x if i s 2 Vi> n = I -26- The tabular equivalent of the rules of the recoding are given below. Note that the introduction of fractional values of y! requires that the original digits y. , and y. _ be replaced by the values y* . and y* _ in i+1 i+2 l+l i+2 subsequent steps of the recoding. m i-l y i y i+l y i+2 y. o i+3 *i m. l n + i y i+2 1 1 3/2 1 1 1 ) ) 3/2 1 1 1 1 1 3/2 1 1 1 1 1 ) ) ) 1 1 1 1 1 1 1 1 1 1 1 1 3A 1 1 ) ) ) 1 1 1 1 1 1 1 1 1 1 1 1 ) 1 1 1 1 1 ) ) 1 1 1 1 1 -3A 1 1 1 1 1 -1 1 1 1 1 ) ) ) -1 1 1 1 1 1 1 -1 1 1 1 1 1 1 ) ) ) -3/2 1 1 -3/2 1 -3/2 1 1 A particular numerical example of this recoding procedure is the following: 0. 101010110111001000 .Joo-^ofooioo-fooi 2 2 4 h The probability of a zero after recoding is j~, corresponding to a shift average of h. •27- 10. A RIGHT -DIRECTED DECIMAL RECODING As an example of a higher radix recoding, a decimal right-directed recoding can be derived from the decimal division example of reference [7]. In this example, two serial steps determine first q[ = 5, 0, 5 with comparison constants ideally equal to + 2.5d, and second, q" = 2, 1, 0, 1, 2 with comparison constants ideally equal to + 0„5d and + l„5d. The quotient digit q. is then After scaling by the factor r-r-r , and combining the two serial steps into one, lOd les for the scaled diA become the rules for the scaled division, for each scaled partial remainder u., If lOu. < -0,145, q. n = 5. 1 ' l+l If -O.U5 < lOu. < -0.35, q. _ = h. — 1 l+l If -0.35 < 10^ < -0.25, q i+1 - 3. If -0.25 < 10u. < -0.15, q.. -, = 2. — 1 ' l+l If -0.15 < lOu. < -0.05, a = 1. 1 i+1 If -0.05 < lOu. < +0.05, q. = 0. If 0,05 < 10u. < 0.15, q. _ - 1. 1 1+1 If 0,15 < 10u. < 0.25, q. n = 2. - 1 ' l+l If 0.25 < 10u i < 0.35, q i+1 = 3. If 0.35 < 10u. < 0.U5, q.. = k. 1 ■ 1+1 If 0.U5 < lOu. , q. = 5- The example of the recoding of O.IH15926535, treated here as a scaled division with a divisor value of 0.1, and with the recursion relation- ship u . = lOu. - 0,1 q. , . is shown in Table 5. * l+l 1 l+l' -28- 10u 0.1U15926535 lOu O.U15926535 10u 2 0.15926535 10u 3 -0.i+073U65 10u u -0.073^65 lOu +O.26535 10u 6 -0.3^65 lOiu -O.U65 IOuq +0.35 10u 9 -0.5 10 io 0.05 < lOu < 0.15 q = 1 0.35 < lOu < O.U5 q^ = k 0.15 < 10u 2 < 0.25 q- = 2 ■O.U5 < lOu < -0.35