Digit Selection for SRT Division and Square Root

advertisement
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
1
Digit Selection for SRT Division
and Square Root
Peter Kornerup, Member, IEEE
Abstract— The quotient digit selection in the SRT division
algorithm is based on a few most significant bits of the remainder
and divisor, where the remainder is usually represented in a
redundant representation. The number of leading bits needed
depends on the quotient radix and digit set, and is usually found
by an extensive search, to assure that the next quotient digit can
be chosen as valid for all points (remainder,divisor) in a set defined
by the truncated remainder and divisor, i.e., an “uncertainty
rectangle”.
This paper presents expressions for the number of bits needed
from the truncated remainder and divisor (the truncation parameters), thus eliminating the need for a search through the
truncation parameter space for validation.
The analysis is then extended to the digit selection in SRT
square root algorithms, where it is shown that, in general, it
may be necessary to increase the number of leading bits needed
for digit determination in a combined divide and square root
algorithm. An easy condition to check the number of bits needed
is established, also checking the number of initial digits of the
root may have to be found by other means, e.g., by table look-up.
The minimally redundant, radix-4 combined divide and square
root algorithm is finally analyzed, and it is shown that in this case
it can be implemented without such a special table to determine
initial digits for the square root.
Index Terms— Digit selection, division, square root
I. I NTRODUCTION
T
HE SRT class of division algorithms is characterized
by the use of redundant representations for the quotient, and most often as well for the remainder. Since the
invention in the late fifties simultaneously by D. Sweeney,
J.E. Robertson [2] and K.D. Tocher [3], and the introduction
of the use of redundant representations for the remainders by
D.E. Atkins [4], these methods have been extensively studied
and implemented in processors. The famous “Pentium bug”,
where certain anomalies in the behavior of the floating point
divide instruction were discovered, turned out to be caused
by a few incorrect entries in the table employed by the
quotient digit determination algorithm used for the radix 4
SRT implementation [5].
Due to the redundancy in the quotient digit set, there are
overlaps between digit selection regions in the Robertson
diagram, allowing a choice between two digit values. Hence
even if the information on the remainder and divisor is
incomplete (representing an uncertainty interval), it may be
possible to choose one of the alternative quotient digit values.
Dept. of Mathematics and Computer Science, University of Southern
Denmark, Odense, Denmark, E-mail: kornerup@imada.sdu.dk
Work supported by the Danish Natural Science Research Council, grant
no. 21-00-0679. This is a revised version of [1], presented at ARITH16, now
extended with the analysis of square root.
By allowing such a relaxed quotient digit determination, it is
possible to base the quotient digit selection on leading digits of
the divisor and of the remainder in a redundant representation.
The determination of the truncation parameters, i.e., how many
digits of the remainder and divisor will be needed, has been
extensively studied since the paper by Atkins, e.g., in [6], [7],
[8], [9], [10] to list a few. These all use extensive searches to
check the validity of a given set of parameters, recently [11]
reduced the search to four pairs of truncation parameters. To
cite
[10] “It is not possible to determine the optimal choices of
and analytically,
as several factors are involved in making
these choices.” ( and here being the number of fractional
digits needed in the truncated divisor resp. remainder.) It is,
however, well-known that there is a simple lower bound on ,
[12]
has a lower bound on , and [11] has upper bounds on
and .
It is shown here, that given a value of
satisfying the
bound mentioned above, it is indeed possible to determine
analytically the other parameter , such that a valid quotient
digit selection function can be specified, eliminating the need
for checking by search.
The analysis is then repeated for the SRT square root algorithm, where it is shown that in general it may be necessary
to increase the number of bits needed for digit selection,
compared to the equivalent parameters for division. It is also
shown how to determine the number of initial digits that may
have to be determined by other means. A combined divide
and square root algorithm is developed, sharing digit selection
intervals. For the radix 4 case it is shown that there is a simple
way to determine the single needed initial digit, thus avoiding
a special table for this purpose, along the lines also found in
[13], however realized differently.
Section II introduces the fundamentals of SRT division and
the notation, together with certain bounds used in the quotient
digit selection. Section III then develops the theory leading
to the determination of the truncation parameters, and thus
the specification of the quotient digit selection function. A
few examples then illustrate the results. The analysis is then
in Section IV repeated for square root, concluding how to
determine the truncation parameters for a combined divide and
square root algorithm, and the number of initial digits that
may have to be determined by other means for the square
root determination. To complete the picture, the special case of
minimally redundant radix 4 is analyzed, determining selection
constants for the combined algorithm, including the possibility
in this case also to determine the leading digit for the square
root, avoiding a special table to initialize the algorithmin this
case. Finally Section V concludes with some comments on
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
2
the extensibility of the results to more complicated truncation
procedures.
II. F UNDAMENTALS OF SRT D IVISION
SRT is not really a specific kind of division, rather it is a
class of division methods, characterized by the following:
The divisor is normalized.
A redundant symmetric quotient digit set is used.
Quotient digits selected by a few leading digits of remainder and divisor.
The remainders may be in a redundant representation.
Let be the quotient radix and the quotient digit set with !"#$&% , and define the
redundancy factor
()%
' +* ,
with
' !%
thus consecutive selection intervals overlap, such that there are
values of 041 for which in general there is a choice between
two digit values (and possibly three for ' C% ).
In summary, provided that ' /wx01S ' / , then the
selection function can deliver at least one digit value 7y1GA such
*
that the new remainder satisfies ' /tT0 1BA ' / . However,
*
for 9zS , the dividend is used as the first remainder, 0 3 &. ,
thus we must require that . and/or / are normalized such that
' /5Y.$ ' / , or ' 6{| ' . Any scaling applied for this
normalization must then be used to correct the final quotient
remainder pair.
Observation 1: With quotient radix , quotient digit
p
c
set 8O@} , and ' ~ a , there exists a digit
*
selection function :<;j0 1 >/@? that delivers a next quotient digit
7 1BA such that the next remainder
*
(1)
where ' #% corresponds to a maximally redundant digit set.
Let . be the dividend and / the positive divisor, 021 the
remainder (with 04356. ) and 781 the digit selected in the 9 th
step. The purpose of the digit selection function, :<;=021>/@? , is
to select the next quotient digit 7 1BA , while keeping the new
*
remainder 0 1BA CD0 1 E7 1BA / bounded, say with bounds F
*
*
and F ,
(2)
F )0 1GA F5H
*
Let the selection interval I JLKMONPKQ be the interval for R0 1 ,
SR0 1 T F , for which it is possible to chose 7 1BA !7
*
while keeping the updated remainder 0 1GA TR0 1 U78/ bounded
*
by (2), i.e., for JVKW)R0 1 TNXK
0 1GA
Y0 1BA
*
TD0 1 Z78/5
F
must hold, corresponding to the Robertson diagram in Fig. 1.
From the diagram it is seen that
J[K\S7/^]_F
NPKU&78/W]
and
F5
(3)
&R0 1 7 1GA
satisfies
*
/
' /5Y0 1BA
for
' /d
*
9zT%8
provided that the dividend . , equal to the initial remainder 023 ,
and divisor /€sr are normalized such that ' 6{| ' .
To simplify the analysis of the digit selection, we are assuming that /€sr . We will also assume that the digit selection
and remainder updating takes place in binary arithmetic, and
implicitly also that the quotient radix is of the form "&
for some ‚
% .
p
DF
F
*
III. Q UOTIENT D IGIT S ELECTION
Due to the overlap N[K a EJ[K-ƒ;v ' &%4?o/sg it is not
*
necessary to know the exact value of the remainder 0 1 to be
able to select a correct next digit 7„1GA . The digit selection
*
intervals are conveniently illustrated in a P-D diagram or
Taylor diagram as in Fig. 2, showing the intervals as functions
of the divisor / , assumed normalized +* ƒ/ , % , and the
shifted remainder R01 .
in particular (3) must hold for 7 B1 A #`U , the extremal digit
*
values, hence
JbadcUC/^]_F
But as seen from Fig. 1, eF
follows that
# ' /
F
NPcWT/W]
and
F5H
#J\adc and FfgNXc , hence it
and
Fh
' /
and from (3) we find
J[K\i;j7k ' ?l/
and
NPKUg;m7n]
' ?o/H
(4)
To assure that at least one digit value can be chosen for any
0 1 , every value of R0 1 must fall in at least one digit selection
interval, i.e., it is necessary that
NPK a
*np
J[K8
hence by (4) we must require that ;j7qr%L]
+* which is always satisfied since or '
p
p
by (1) recalling that we require /tsY
N K a
*
uJ K C;v ' Y%?l/5sr@
' ?l/
' ?o/ ,
;m7q
p
. Actually
(5)
Fig. 2.
P-D diagram for digit selection with normalized divisor.
For any given fixed value of the divisor / , it is now
possible to choose partition points, …eK8;=/@? , in the selection intervals I J[K8;=/@?OONPK8;=/@?†Q , or rather in the stricter overlap intervals
…RK8;=/@?Z‡ˆI J[K;j/y?‰NXK a ;j/y?lQ , such that the selection function
*
:<;=0 1 >/@? returning 7 1GA is defined by
R041
R041 ,
p
‹Š
*
… K ;=/@?LYR01 ,
‹Š\… K A
*
;j/@?LER041 ,
… K A
*
;=/@?ZŒ
\… K ;=/@?uŒ
781GA
71BA
&7H
*
*
C7}
using the symmetry around the / -axis, allowing us to restrict
, assuming that the remainder 01
the analysis to 7
p
p
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
Fig. 1.
3
Robertson diagram for SRT division
Ž
without loss of generality, as there is a simple way of
mapping negative remainders (and divisors) into their positive
equivalents [1], adjusting the sign of the digit appropriately.
To simplify the following discussion, we shall often assume
that  is fixed and drop the argument  in the notation of
selection intervals  ‘V’“j@”O•‰–X’“=@”†— and partition points ˜e’“jy” .
However, these can be pictured as functions of  as in Fig. 3.
Fig. 3.
™š2›Bœ as a function of œ
Fig. 4.
Due to the overlap between selection intervals, the partition
points can be chosen such that it is sufficient to check a few of
the
leading digits of the (possibly redundant) value
of žRŸ2 . Let
¡
¡
žRŸ denote a truncated value of žDŸ , and ¢@£G¤D“ žRŸ ” denote
the
¡
unit in the last place of the truncated value, say ¢@£G¤e“ žRŸ ”n¥
¦„§}¨
. Define the truncation error, ©ª , by
žRŸ e¥
¡
žRŸ }«
©Mª
then for various binary representations of Ÿ we have:
¡
2’s complement:
0 ¬©ªW­E¢@£G¤e“ žR¡ Ÿ ”
¦
2’s compl. carry-save:
0
¬ ©ªW­
¢£B¤D¡ “ žRŸ ”
¡
2
borrow-save :
®b¢£B¤D“ žRŸ ”T
­ ©MªW­E¢@£G¤e“ žRŸ ”
as illustrated below, where ¯ is the number of integer bits,
which we shall not be concerned with here.
It is essential to note that truncation of the remainder for
digit selection is assumed to take place on the redundant
2 Often
also denoted signed-digit
representation, before conversion into non-redundant representation. Thus it is not necessary to convert the full-length
remainder.
Similarly, considering only a few leading digits of the
divisor, let ° denote the truncated value of  with ¢£B¤“m@
° ”n¥
¦„§d±
for ²³g´ , and truncation error µ defined by t¥C ° « µ ,
Ž
where ¬)µ¶­Y¢£B¤D“m@
° ” for  in 2’s complement. The function
™š2›Gœ4 as a function of truncated divisor °œ
˜R’8“=@” now becomes a step function, delimiting rectangles
within which a particular quotient digit can be chosen, as
pictured in Fig. 4. We shall assume that ˜ ’ “jy” is chosen as
far to the left as possible.
The step function ˜D’8“=@” is now determined by a set of
constants ˜ ° ’ “m@
° ” , corresponding to the various truncated values
constants¡ are assumed specified to the same accuracy
° . These
¡
¦„§¨
¦y§d±
as žDŸ (i.e., ¢@£G¤D“ žRŸ ”·¥
). For fixed S
° ¥¹¸
, where
¦ §d± °
¢@£G¤D“m@
° ”P¥
° ” can then be written as an integer multiple
, ˜R¡ ’“my
º ’» ¼ ¦„§¨ of ¢@£B¤e“ žRŸ ”P¥ ¦„§}¨ .
The dotted rectangle in Fig. 4 located with lower left-hand
corner at “ ˜ ° ’ “m@
° ”O•„
° ” , for  in non-redundant 2’s complement
and žRŸ redundant carry-save 2’s complement, shows the set
of points “=žRŸ •>@” satisfying
˜ ° ’ “my
° ”V¬)žRŸ4 P­
˜ ° ’ “m@
° ” «
¦
¡
¢@£G¤R“ žRŸ ” and €
° ¬Yt­r ° «
¢@£G¤D“my
° ”
(6)
° ’“my
° ”•@
° ” and the truncations have to be
where the point “ ˜R
chosen such that the next quotient digit ½ G¾e¿ ¥½ can be
selected for any point in the rectangle (6).
For the shifted remainder žDŸ4 in borrow-save, ˜ ° ’ “m@
° ” would
just have to be chosen as the midpoint of the lower edge, but
for the following analysis we will assume that the representation is carry-save, with the rectangle shown fully drawn to
more detail in Fig. 5, where the modifications for borrow-save
are trivial.
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
4
õ
àˆÂ , öùàúÙ and øûÁˆÂ for À#àúÙ . Clearly it is
with
necessary that ø^è(à!ö for this condition to be satisfied, but
it is easily seen that ø^è·Ê)öüàÉÙ is a sufficient condition,
since then there is at least one integer between the ceiling and
floor expressions. Hence if the condition
Ô â†Ûç
Fig. 5.
Overlapping uncertainty rectangles
Using (4) for À·Á&Â the rectangle has to be to the right of
the line ÃVÄÅjÆ@ÇWÈÉÅjÀ-Ê_ËyÇlÆ , yielding the following condition
on the upper left-hand corner:
Ã Ä ÅmÆ^
Ì Í_Î@ÏGÐDÅmÆ@
Ì Ç>ÇPÈiÅjÀkÊ"ËyÇÅmÆ^
Ì Í_Î@ÏGÐDÅmÆ@
Ì ÇÇLÑ
ÒÌ
Ì ÇÓ
Ä ÅmÆy
(7)
These rectangles are overlapping, since they are of width
ÖD×MØ
Î ÏGÐDÅvÕ
@
Ç , but are positioned at a horizontal spacing of
ÖR×Ø
Ò
Î@ÏBÐeÅvÕ
Ç . Since Ì Ä Åm@
ÆÌ Ç is chosen as small as possible, for any
Ô
point in the (dotted) rectangle overlapping from the left, the
digit value À‹ÊSÙ must be chosen. Thus the midpoint of the
bottom edge must be to the left of the line Ú ÄÛÝÜ ÅjÆyÇ , yielding
this additional condition:
ÒÌ
ÖR×MØ
ÄÅmÆ@
Ì ÇRÍ_Î@ÏBÐÅvÕ
ÇVÑ&ÚPÄÛÝÜ2ÅmÆ@
Ì ÇPÈgÅmÀÞÊ)Ù[ÍZËyÇ>Æd
Ì Ó
(8)
But the lower right-most corner must also be to the left of
the line ÚXÄÅjÆ@Ç , hence we must also require
ÒÌ
Ì ÇDÍ
Ä ÅmÆ@
Ô
ÖR×MØ
Î@ÏGÐDÅvÕ
ÇVÑ&Ú Ä ÅmÆ@
Ì ÇPÈgÅmÀUÍ_˄Ç>Æd
Ì Ó
Ò
ÖR×MØ
ÅjÀXʋ˄ÇÅmÆz
Ì Í€Î@ÏGÐDÅmÆy
Ì ÇÇLÑ Ì Ä ÅmÆ@
Ì ÇVÑ!ÅmÀPÊ Ù̀˄Ç>ÆP
Ì Ê‹Î@ÏGÐDÅvÕ
ÇOÓ (10)
ÒÌ
ÖR×MØ
Ô Û}â
But ÄÅmÆy
Ì Ç has to be an integer multiple of Î@ÏGÐeÅlÕ
ÇPÈ
,
ÒÌ
Ô Ûâ
Ì Ç[È&ã Ää å
hence defining Ä ÅmÆy
we must require:
æ Ô â†Ûdç
Ô â†Ûç
ÅmÀÞÊu˄ÇÅmèÞÍ&Ù4Çlé^Èáã4Ää åkÑëê
ÅjÀkÊYÙ[Í_˄Çè¶ÊYÙì
Ô Ûç
(11)
, for
for ÀuÁi , using Î@ÏGÐDÅmÆ@
Ì Ç^È
and defining Æ"
Ì Èfè
Ô
Ô ç
integer è , ç8ÛÝÜ ÑTè5í
.
ÖD×MØ
à)Â and thus it should also be
Recall that we required Õ
Òdî
Ì ÇWÈh for
possible toî choose À Èh , but obviously then Ì ÅmÆy
Ô ç8ÛÝÜ
Ô ç
Ñfè)í
all ÆÌ , or ã ä å Èï for all è ,
. Note that the
right-most bounds on the uncertainty
rectangles for À¶È& are
Ò
Ì Ç for À¶ÈCÙ .
implicitly chosen by the choice of Ì Ä ÅmÆy
Without restrictions on ß , ð and Ë , there is only the integer
term Ê^Ù which can be moved in and out of the floor and
ceiling functions, but reorganizing terms then condition (11)
for À-Á)Â can be written as:
æ Ô â†Ûç
Ô â†Ûç
ÅmÀÞÊu˄ÇèÞÍ
jÅ ÀkÊ"ËyÇRÍTÙ é
Ô â†Ûdç
Ô â†Ûdç Ô
Ñ6ñ
ÅmÀÞÊu˄ÇèWÍ
Å ËÞÊ)Ù4ÇèòXó
(12)
where the ceiling and floor expressions are linear functions of
è :
=ô õ
õ
èÞÍ_öÞ÷ÞÑ6ñ>Å ÍYø^Ç>èòó
(13)
ÖR× Ø
Ô
Ô
may be used to find values of ß , Ûâ ÈrÎÏBÐÅ Õ Ç and ð , Ûç È
Î@ÏGÐDÅmÆ@
Ì Ç , for which (12) is satisfied for all ÀÙó
óý and
Ô
Ô ç
Ü
all è such that çÛRÜ Ñhè_Ñ
ÑÿÆ_
Ì íëÙ . Note,
Ê&Ù , i.e.,
however, that the solutions to (14) need not be optimal in the
sense that ß is minimal, since it might be sufficient to require
ø^ètà)ö , i.e., only require
Ô Û}â
Ô Ûdç
Ü
Ñÿþ‰Å=ËÞÊ
Ç<Ê)ÅmýkÊu˄Ç
ó
(15)
which would allow a solution for ß which is one smaller
than the solution to (14). We shall below return to the choice
between the two conditions.
Obviously, the right-hand side of both (14) and (15) must
be strictly positive for solutions to exist for ß , hence we want
a ð satisfying
Ô Ûç
(9)
It is easy to see that for ßbàáÙ (which
we shall see later is
Ò
always the case), the upper bound on Ì ÄÅmÆ@
Ì Ç obtained from (8)
is smaller than or equal to the bound found from (9). Thus
combining conditions (6) and (8) to determine the size and
position of the rectangles we must require
Ô Ûç
Ô
Ô
Å>Å k
Ë Ê)Ù4ÇèkÊrÅjÀkÊ"ËyÇ>ÇVà
ó
Ô ç8ÛÝÜ
holds for the minimal value è-È
and the maximal value
À¶ÈSý , then this is sufficient for (12) to hold.
Thus the stronger condition derived from ø^èqÊö6à!Ù
Ô Û}â
Ô Ûdç Ô
Ü
Ñÿþ‰Å=ËÞÊ
Ç<Ê)ÅmýkÊu˄Ç
(14)
Ö
Ü
ËkÊ
í
Ô
ýÞÊuË
ó
(16)
Ö
Ô
provided that ý ÁSË , or Á
, since È
is the only case
ËYÈÉýdÅvȍÙ4Ç . As seen in Example 3 below, the case
where
Ö
Ô
È
can be handledÖ separately. Hence (16) is a sufficient
Ô
condition on ð for all Á
, À8Ù8ó
óý and all è such
Ô ç8ÛÝÜ
Ô ç
that
ÑTètÑ
ÊYÙ .
Returning to (13) and the choice between (14) and (15) to
determine a minimal value of ß õ , we need the following lemma:
Lemma î 2: Given constants àY , øiÁr , then there exists
integers è Ñrè Ü such that the inequality
ô=õ
èWÍEö^÷ÞÑfñoÅ
õ
ÍYø^Ç>èò
(17)
î
that:
holds for all
=ô õ ètà)è , provided
õ
î
i) ô=õ èÞÍ_öÞ÷UÈ ñ>Å õ ÍYø^Ç>èò for è r
Ñ ètÑ)è„ÜVÊ)Ù ,
and ii)
èÜXÍ_öÞ÷Þí6ñ>Å ÍYõ ø^Ç>è„܉ò .
=ô õ
Proof:õ Define ·
Å
ÇL
ònÊ
‹ÍYö^÷ . Since
õ Èëñ>Å Í)ø^Ç@
Åd
·
ÇÑÅ Ígø^Ç
ÊiÅ "
Í#öqÇ$Èüøu
Êáö and ·
Å
Ç is
integral, it follows that ·
Å
ÇtÑüñmø Êrö^ò . If on the other
hand ñjø ÊEö^òtÈ then
Åd
·
Çqà õ Ê&Ù (there are at least
õ
ÊYÙ integers between q
·
ÍEö and Å ÍYø^Ç ), thus
ñmø5ÊuöÞò\Ê)Ù^Ñ·ÅdÇLÑ6ñmø5Êö^ò8Ó
(18)
Hence ·ÅdÇPÊrÙkÑïñmø€ÊZö^ònÊ)Ù¶ÑïñjøUÆqÊZö^ònÊrÙÞÑ·ÅjÆyÇ
for Æ5à , thus:
Æ5à
·ÅjÆyÇVà·ÅdÇzÊrÙÓ
Åd
·
Ç may not always increase with following figure
(19)
as shown in the
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
5
If the conditions for the first two choices for ƒ fail, then the
stronger condition
U
UKa@³u´
=
/ m b®²vQA2 € #2¤ H\2nQo#›/
/oJ
correspondinga8U to ƒ\%ˆƒ7)+ , implies that 43! 2­w9l+ for
= and c%CH , and again by the lemma this
!%C!17z%;/
implies that condition (11) holds for all ! 9!87 , and then also
for all c , +°bcb¤H .
where "!$#&%(' , but "!*)+,#-%(.!*)0/1#-%23+ .
Since 465' , by (18) there exists a minimal !87 such that
"!$#:9;' for !<9;!17 until eventually there is a minimal
!=>9?!17 such that .!@=#A9+ . By (19) the lemma then has
been proven.
We can now combine the previous discussion with the
lemma, into the following result:
Theorem 3: (SRT digit selection constants)
For
radix B SRT division for BC5D/ with digit set EF%
G
2IHKJ
UKLaL
LMJNHPO and QR% T$US = , the selection constants VWYX.[Z #\%
] X^ _`/
can be determined for +3bcdbH and [ Z %e!\L
f$gihj.[Z #
as
] X^ _%lk/`m UKa cA2nQo#M"!3)+,#qp
a8U =
a
/
J
L
LLMJN/ 2s+ ,U using truncation parameters
for !r%
U|a
, where
f$gthu.VWYX.[Z #v#:%wf$gihj"BY
V x1y.#z%{/ m and f$gihj.[Z #z%{/
} has to satisfy
U|a~ Q*2 €=
/
H32zQ‚
}
To determine ƒ for given , let ƒ7 be the smallest ƒ satisfying
/
U
m b„Q*2
€= #…2.HA2:Q@#v/
U|a
U a
K
UKa
} Jvƒ†JN!$#-%ˆ‡/ m H\20+‰)Q@#v!\2+
Š12>‹/ m H\2nQo#M"!*)+,#qŒ-J
a8U =
‘.’ } Jvƒ 7 “J /
#”9+
a8U =

} vJ ƒ 7 “J !$#-%'PJ ’q•P– —
7
‘
.
’
ƒ
! %e/
J
LL
L
J“! = 2+1J
Ž
ƒ…% Ž
˜$™š } J›ƒ 7 JN! = #œ9+
ƒ7@) + •žŸ –¢¡‘.£ 
Proof: The expression
for ] X^ _ is from (11), and the
}
condition on from (16) was shown a8
toU be sufficient for c5¤' ,
= , for all values of ƒ .
by using ¥¦¨§œc©%(H , and ¥—ªt«‚!%e/
Rewriting (11) we found that } and ƒ must satisfy the
condition
(20)
‹¬!*)­*Œ*b®‡›¬¯)043#›!ŠJ
8
a
U
= b
or ~ equivalently
} Jvƒ†JN!$#œ9' , for c\%(H and for all ! , /
a
!
/ , where
UKa
¬
%
/ m cA2nQo#”9'
UKa
­
%
/ m cA2nQo#j)(+
UKa
4
%
/ m ./¨Q*2+¢#œ5¤'

Using Lemma 2 the two
first
choices
for
ƒ imply that (11)
a8U =
holds for all ! 9¤!17%(/
. As we saw before, 43!°2­®9¤'
for all c , +3bcb¤H translates into the condition
U
U|a
=
/ m± b„Q\2 € #2.HA2:Qo#›/

ŽŽ
resulting in the following table of comparison constants
J
and let
then
Example 1 (Minimally redundant radix 4 SRT)
%
G Let BF% µ with minimally redundant €· digit set E
, and from (16)
2‚/$J
23+8Jv'$J+1J“/@O , hence H%¶/ and Q%
we derive } 9µ . Choosing } %µ by Theorem 3, ƒ‰%ƒ 7 has
to be the smallest solution to
U
UKa
=
/ m b
Q\2 € #¸2¤HA2nQo#›/
€·
€· UK¹
=
%
2 € #¸2¤./2
#v/
=º
=€
=€
%
2 = % = J
a8U =
%¼$JN½$J
+¢' , µPJvµPJ“!$#*%»' but
hence ƒ7 %»µ . For !R%/
µJ›µPJ+1+,#%+ . Thus by the second choice for ƒ in Theorem 3,
ƒ-%¤ƒ7%µ . Hence
we can compute the values of the constants
U
Z .[Z #&% ] X^ _ / m for c5¤' as
W”
] X^ _°%‹./ m U|a .c32zQ@#
.!3)+,#qŒ%lkc*2 €· #M.!*)(+¢#pœJ
Utilizing the definitions (4) of the functions ¾ X [ # and ¿ X [ #
we have
ƒ7
which together with the table of W Z X yields the P-D diagram
for the first quadrant in~ Fig. 6. In practice the left part of
V x y
the diagram (for BY
' ) is not needed, when utilizing
symmetries in the uncertainty rectangles.
Fig. 6.
P-D diagram for minimally redundant radix 4 SRT
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
Example 2 Continuing the previous example, if instead of
choosing the minimal À¯Á the value ÀÁ®Ã is chosen, we
Ä@ÅKÆÈÇ
ÉÊAËÌ ËÉ.Ï*Ë:Ê Ä Å|Ð
find
É
Á
Ì ÍÑ Ë
ËÍ@Ì Î ËÉ"ÄË
ÌÍ Î
Ì
ÍÑ
Î Ä ÅKÒ
Î
Ó
Í›Ô Á ÕÖ
Á
Ä Ð8Å Ì
É
having the minimal solution ×*Á»×›ØÁÚÙ . However, for ÛÁ
Á
É ÜÝ we find for Ä Þ Å À Ö ×Ò Ø Ö Û Î Ë
Ë<â.Ä Å
͔à ÔÑ à
Í”Ë à Ñ â
à ̛å
›
Ì
å
Þ Ã Ö Ù Ö Ü¢Ý Î Á
ß
ÜÝ
ÜMá
Ü,ã,ä
Ñ
ÑË
Ë
Á
ß á
ä
Á
Ã
ÝæÁ
Ü Ö
É
É
thus by Theorem 3 it is necessary to increase ×-ÁכØ-ç܂Á( ,
É
hence À Ö × Î Á Ã Ö Â Î is also a valid pair of truncation parameÉ
â Ñ
Ñ å theË previous
ters, but obviously not as good as Â Ö Â Î found in
Ñ Ë Ä ÔÑ
ÄèË Ä
É
åvê Ë<â Ñ
example. As a check we find Þ Ã Ö Â Ö ÜÝ Î Ñ Ó Á ß á
ä Á
Ü
Ü Á(é and Þ Ã Ö Â Ö Ü,ã Î Álß Ó á
ä*ÁæÜ¢Ù
Ü ÁÜ .
Ä
Ë
Example 3 (Radix 2 SRT)
Ï
Ê
For ëlÁ
and digit set ì Ü Ö é Ö Ü1í the condition on À in
Ä Ð8Å Ì
ÁCÜ . However, for
Theorem 3 cannot be used since Á
Ä Ð
Ä
À¤Áˆ×\ÁsÜ and Û¯ÁîÜ , corresponding to
ÁsÜÁïÛ¤ð
Á , it is easily seen that (11) is satisfied for ñ©Á„Ü .
Ì Ç
Thus only one bit of the fraction part of ò is needed for òó ,
É÷
ò:ðÜ , implying that the
and this bit is always Ü since Í
Ä Å Ì
Ì
quotient selection is independent of ò . Note that ô$õiö ëYøù Î Á
Á Í . From (4) the lower and upper bounds are then found
to be
Ë Ì
Ì
ú
Í and ó and it now easy to see that ؗÁ
Á é , since the
uncertainty rectangle has height Í and width Ü . The resulting
full P-D diagram is shown in Fig. 7.
úó
Fig. 7.
Ì
P-D diagram for radix 2 SRT with redundant remainder
IV. SRT S QUARE ROOT
The SRT square root algorithm assumes the radicand is
normalized in a “relaxed” way, since preferably the scaling
factor applied for normalization should be an even power
of the radix, used in the representation of the radicand û ,
and in the arithmetic. Normally this will mean that a binary
representation and arithmetic is used, and that the radix used
6
Ä8ü
Ì Ç
for representing the quotient is of the form ë:Á
. We will
ûýð
initially assume that normalization is to the interval Ô
Éþ
Ü .
þ
Let û be the normalized radicand
and
ù Ö ø ù Î the
Í
root,remainder pair such that ûæÁ
ù çø ù . The purpose of
Ë
the digit Ì selection function is to select the nextÌ root digit
É.Ä1þ
Å Å Ì
ñ¯Álñùiÿ , while keeping the new remainder ø,ùiÿ Áïëjøù
ù
ç>ñ1ë ù Î ñ bounded. Let the remainder bounds as before
Ç
be ù and \ù , such that Ç
ùÖ
ø ù
ù
(21)
where we shall see that the bounds here turn out to depend
É
É
on the iteration index .
Ì
Let Î Ö Î be the selection
interval of ëYø,ù for which
Álñ , while keeping the scaled
we can select Ì the digit ñ ùtÿ
remainder ø ùiÿ bounded:
É
É
ëYøù
Ç
Ì
ùtÿ
Î Ö Î
Å Å Ì
Ç
Ì
ù Î
ø¢ùtÿ Ál
þ ëYøù þ ùçñ8ë Å Å Ì ñ
Aùiÿ Ö
Ì
Ì
ù . Hence we have
and update the root by ùtÿ Á ùMç—ñùiÿ ë
the bounds
Ä1þ
Å Å Ì
É
Ì
Í
ù
Ç
É
Å Å Ì
Î Á
(22)
ù Ì ñ°çĨñ þ ë
ùtÿ Ç ç
Í
ù
ëYÏ ø ù
Á Î
ùiÿ ç
ù ñç¯ñ ë
ËÉ"Ĩþ
Ì
With ñ<Á
, the maximal digit value, we have for ëYø`ù
ËÉ"Ĩþ
Ï Å Å Ì Ï
maximal, ëjø¢ùÁ¤ë \ù
Ì
ù Î
Aùiÿ Á(ë ĨAùÊþ
Ê ùKç Å ë
(23)
Í
ù
ë , which can be checked
whose solution is ù Á
ù ç
by insertion. Similarly the following expression for ù can be
ø ù Ĩfor
found, such
˂Ä`that
Ê@þ theÊ remainder
Å Ç
Ç
Êþ all Ê must
Å satisfy
Í
Í
ù
ù
(24)
ùPç
ë
ø¢ù
ùç
ë
Á Aù
ù Á
To find the overlap between
É
Ä1þ
using (22) that
Ì
Ä1þ É Ë:Ê
É Î Á
ùtÿ ç Ä1þ
Î
Á
ù ñÌ
Ä1þ É
Ê
Î Á \ù
tÿ ç
Á
ù ñç Î
selection intervals we have
Å Å Ì
Í Ê ù Å Å Ì
É Ë:
ù.ñç¯ñ ë Í
Å Å Ì
ç ñ Í Î ë ù
É
Ê ù Å Å Ì
ù.ñç¯ñ ë Í
ç ñç Î ë ù Ö
É
Å Ì value
where it is necessary for the digit selection that each
É
Î of ëYø¢ù falls in at least one selection interval, i.e., Î
, or Å Ì É Ë
É
.
É
`
Ä
A
Ê
Ë
Å Å Ì
Î Ä1Î þ É.Ä Ë
é
Á
Ü Î ù ç
ñ
Ü Îë ù
(25)
Ä
Note that this inequality not only depends onà
àñ à as in
Ä`Ê3Ë
ËIÏ
Ï
division, but also on the iteration index Á;àÜ à
àÖ Ö
. Since
ËIÏ
Ë Ê|É Ë
Ö
Ö í , i.e., for
Ü ¤é , for (25) to hold for all ñ nì
ë Ä`Ê|É Ü Î ,Ë and since
all ñ ËzÄ Á Ç
Ä`Ê ËÉ"Ä`ÊAË
ÇÄ`Ê
Ü
ñ
܉ç
ë
Ü Î Á
ë
Ü Î
ë Ö
in order to assure an overlap of selection intervals it is required
þ
Ê Å
that
ù
ù ë
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
7
"
4 6 7$98
Since !#"$&%')(+*-,.#"/01%23 and 5!
this condition will be satisfied for all :<;!:>= for some :=-;?8 .
"
Since % 6 8 it is sufficient to require @";A23 , in particular
it is possible to use #B0DCEB0F8 as the initial value. This
is necessary whenever %G$A8 , since the maximally obtainable
H CJ".2 3 " without a 2 B term is
value of H0AI
4
H 6
L
KH L "
2 3 $ M
2 N8 0O%QP
4
For maximally redundant digit sets where %&0R8 , it is
feasible to start with C B 0TS and C 0VU#W 5)X yielding 8ZY
4
; 54 ;N2[3 4 .
4
A. Combining SRT Square Root with Division
Looking for a square root algorithm as close as possible to
division, we want the selection intervals \ ]_^E,.:/`ab^
3 4 ,.:>/cd0
\ ] "^ ,feg#"/h`ha ^ " 3 4 ,ieE#"/c to be independent of : , and as functions
of eg" to coincide with the bounds for division as functions
of the divisor j , at least for :;k:>= for some :=l;A8 . Since the
bounds for root extraction are
a ^ " 3 4 i, eg " /m0
] "^ i, eg"i/m0
5
be the left boundary for the uncertainty rectangles, the (nonnegative) perturbation can be compensated for by increasing
the height of these rectangles by the maximal perturbation.
We shall now turn our attention to the selection function, in
the form of determining the step-wise functions ›-^,.”}/ , where
”70œeE#" here takes the place of the divisor j in division.
In particular we will first attempt to determine a value :x= ,
^
such that the perturbations ž Ÿ ^ ,.— " / are sufficiently small
for :b;N: = , using the same truncation parameters ¡ and ¢ as for
division. Recalling (10) for choosing the step function › £ ^ , ”}
£/
for division, but now adding the perturbation in the left bound
we get the condition:
,.C¤M%}/#, ”<£ o…'’(+*q, £”J/Qo— "^ / 6 ›š£ ^J, ”}£ / 6 ,iC†8o…%}/ £”¥M')({*-,f2š¦ ™ " /`
(28)
where £” now is either j £ or eE¦ #" .
£ ^J, £”J/ has to be an integer multiple of
As for division, ›q
')({*q,f2q¦ ™ " /§0Fep3€¨ , hence defining ›š£ ^E, £”/G09©^ª « ep3€¨ we must
require:
©@^ª «d0D¬ie ¨3Q­ ,.CŽ%p/,i®roO8oNe ­ — " ^ / ¯
6±° e ¨3Q­Q,.CnN8oZ%p/x®²s8³
(29)
using '’(+*q, £”/r0´ep3Q­ , and defining £”0´®)ep3µ­ , for integer ® ,
3qu "+v 4xw
eg " ,.CnN8oZ%p/qoO,iCrs
5 8ot"{v %p/ 2
e ­J3 4 6 ®G$!e ­ , assuming that the range of ” is the half-open
ge "x,.Cny%p/qoz,.Cny%p/ 2 3qu 4xw `
(26)
4 6 ”˜$A8 .
interval 5
"
Now we want to determine a minimal bound ¶†Y·S as a
where the second term in a ^
3 4 ,ieE#"/ is non-negative and small
for large : , this term may be discarded, thus yielding the function of : = , such that
smaller upper bound
^ ž Ÿ ,i— " ^ /[0¸, L Ž%}/>2 3qu "{v 4xw 6 ¶0¸, L y%p/2 3qu "{¹ºv 4>w (30)
ar^ | 3 4 ,feg " /[0Aeg " ,.CnN8oZ%}/`
(27)
for :!;œ:= , preferably without changing the values of the
which is now identical to the upper bound a ^
~
,
)
j
/
O
0
l
j
i
,
n
C
discretisation parameters ¡ and ¢ .
8ot%p/ for division, when j is substituted by eg3 4" .
» However, this will not be possible in general. Let
However, where the range of the divisor j is the interval
,~¡`x¢h`®µ`>¶E/ be defined as in Theorem 3, but modified with
\5€4  8/ , this is unfortunately not identical to the range of eg "-‚ the inclusion of a perturbation ¶
e yƒs\„8  eJ/ , using the previously assumed normalization of »
,~¡`x¢h`®µ`>¶E/[0
(31)
the radicand …ƒ†\ ‡ 4  8@/ . But changing the normalization of the
L
L
° e ¨3µ­€, s8ot%p/x®²s8³¥?¼.eg¨3Q­Q, y%p/,f®ro8oNeg­E¶E/½bP
4  8/ ,
radicand such that ˆƒt\ 4  ‡ 4 / , implies eg "q‚ e ˆƒt\ 5€
4x‰
now coinciding with the interval
of the divisor j .
Consider the case of radix 4 SRT as in » Example 1 where
Below we shall see how to determine an index :x= such that »
,~¾€`x¾’`®µ`¿S/À;ÁS for  6 ® 6 8@à , but ,.¾’`x¾€`¿Â’`>¶E/ 6 8
an overlap of selection intervals is assured for all :t;Š:x= .
for any ¶·YÄS , since eE¨3Q­Q, L Å%}/#,i®o&8@/ happens to be
Recalling that for SRT division it is assumed that dividend
Thus (29) cannot be satisfied and it will be necessary
and divisor j are normalized such that _% 6Œ‹Ž6 % , both integral.
to increase ¡ and/or ¢ .
an approximate quotient " and an approximate root " can be
" C"~2 " , i.e., as a proper fraction.
Inserting
» the bound ¶ from (30) in (31), changing the
written as #"0 I
function
now to be a function of :x= instead of ¶ we obtain
4
Rewriting the right-hand expression of (26) into
» =
,.¡-`¿¢h`Æ®µ`¿: = /[0ŒÇ~e ¨3Q­ , L N8oZ%}/¿®²N8#È
(32)
] "^ ,ieg"f/[0D‘eg"’oO,iCrŽ%}/>2 3qu "+v 4xw>“ ,.Cny%p/h`
?Ue ¨3µ­€, L Ž%}/‘®roO8boseg­’, L Ž%p/23-u "+¹{v 4xw “ X `
we notice that this can be considered a value of the bound for
^ whose values must be non-negative for all values of ® , e­J3 4 6
division ] ^ ,.”}/•0z”Q,.CŽ%}/ , where the argument ”–0zeg " ot— "
is a perturbed version of the argument j used for division, the ® 6 eE­rs8 for a chosen set of parameters ¡`x¢ and :x= .
^
"{v
Theorem 4: The digit selection of radix 2t;se SRT square
perturbation being — " 01,.C˜k%}/>23qu 4xw . As for division we
root
can for :;N:>= be implemented using the same algorithms
shall again assume that 2š™"Y!S , handling negative remainders
as
SRT
division, when :>= is chosen such that
by symmetry. Observing then that
»
= ,.¡-`¿¢h`Æe ­J3 4 `x: = /;A8
S 6 CrŽ% 6 L Ž% for 8 6 C 6 L `
ɒÊ
»
^
the perturbation — " can be made arbitrarily small by requiring
,x, =,~¡`x¢h`®µ`x:={/b0S for » ®0Aeg­J3 4 `#Ë#ËË#`® 4 s8@/
:b;k:= for some sufficiently large :>= . Since the line ]^E,i”/ is to
and =,~¡`x¢h`® `x:=º/;A8/
4
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
for suitable values of Ì and Í . These values must satisfy ̅Îk̚Ï
and ͅÎ9Í>Ï , where ÌµÏ and ÍxÏ are the values determined for
division by Theorem 3. It is assumed that the divisor Ð is
Ò Ô#Õ@Ö and the radicand × to the
normalized to the interval Ñ>Ӏ
Ù
Ô
Ö
interval Ñ Ò Ò .
ÒxØ
Proof: By Theorem 3, the choices of Ì and Í assure that
digit selection for division is possible for چÛÜ , what remains
is to show that they are also valid for digit selection for square
root when Ý[ÎNÝ>Ï in these cases. The condition of the theorem
on Ì-Þ¿Í and ÝÏ implies by Lemma 2 that ߘÏà~̏ÞxÍhÞÆálÞxÝÏ Ö ÎÁâ
for all á , ÜEãEä ÒMå á å ÜEãæ Õ , such that condition (29), or
equivalently (28) holds for all digits ç?ÛFâ . But the latter
condition
on the step function è_àié Ö defined by the points
ê ê
èšëà é Ö is equivalent to requiring that the “heightë extended”
uncertainty rectangles (see Fig. 8) for all áµÞÆç’ÞÆì í and ÝÎ?ÝÏ
lie between the lines îëàié Ö and ïrë ð à.é Ö , both as defined for
ä Ò
division.
8
ÝÏ ÷ Ü
÷ û#û Õ÷ ÿâ)Þ Õ Þ Õ ÞÆÜ)Þ Þ Þ Þ Þ
ÿ ß Ï à Þ ÞÆálÞÆÜ Ö á both satisfying Theorem 4. Choosing instead Ì ÷ and Í ÷
but also for
turns out also to be possible:
Ö á ÷ÅÕ _û#û )Õ
ÿ ß Ï à Þ ÞÆáµÞÜ ÷ ÿ@â)ÞÆâ)ÞÆâ)Þ¿â’Þ¿â’Þ¿â)Þ Õ Þ Õ Þ Õ Þ Õ Þ Õ Þ Õ ÞÆÜ)ÞÆÜ}ÞÜpÞ¿Ü û
As an illustration some examples are shown in Table I,
including the ones found above. The smallest possible values
of Ì-Þ¿Í and Ý>Ï have been chosen, allowing for non-negative
values of ß²Ïà.Ì-Þ¿ÍhÞÆáµÞ¿ÝÏ Ö for all á such that ÜEãJä Ò¤å á å Ügãæ Õ .
TABLE I
PARAMETERS FOR SOME COMBINED DIVIDE AND SQRT ALGORITHMS .
However, recall that it is not necessary to check all values of
, it is sufficient to check a few initial values, e.g., for Ú ÷ ,
minimally redundant
á
Fig. 8.
Extended uncertainty rectangle
This follows from the equivalent of (7), specifying that the
upper left-hand corner must be to the right of the line î ë à.é Ö ,
as specified by
ê ê
ê
ê
ê
ê
î ë à éòñtó)ô{õqà é Ö t
ñ ö [Ö ÷ àiçræŽø Ö à é¤ñZó)ô{õqà é Ö t
ñ ö Ö å è ë àé Ö Þ
and similarly that the midpoint of the lower edge of the
rectangle must be to the left of the line ï ë ð àié Ö
ä Ò
ê ê
ê
ê
è¥à é Ö ñtó)ô{õqàfښù ú í Ö å ï ë ð ä Ò à é Öb÷ à.çræ Õ ñZø Ö¿Ö é€û
These bounds are equivalent to (28), thus the uncertainty
rectangles, for division as well as for square root, for all
digits çÛ´â and ÜEãJä Òyå áAü1ÜEã , for ÝGÎ&ÝÏ are properly
located.
What remains is to handle the case Ú ÷ Ü , where it is easily
seen since ø ÷ýÕ that the perturbations ì í ë å â . For Ì ÷ Í ÷?Õ ,
checking the cases by insertion, it is found that (29) is satisfied
for all values of çþŽÿJæ Õ ÞÆâ)Þ Õ and á ÷ýÕ for all Ý[Î!â , since
(29) in this case is simply a rewriting of the condition that
ߖÏfà Õ Þ Õ Þ Õ ÞÆâ Ö ÎNâ .
Values of ß²Ï can thus be used to verify parameter choices,
e.g., for Ú ÷ , minimally redundant, where we know that
Ì ÷ Í ÷ is sufficient for division, but that Ì and/or Í must
be increased. Trying Ì ÷ , Í ÷ and Ý>Ï ÷ we find
ÿ ß Ï à Þ ÞÆáµÞ JÖ
á ÷ ûû Õ÷ ÿâ)ÞÆÜ)ÞÆÜ)ÞÆÜpÞ Þ Þ Þ Þ
ÿß Ï àpÞ)ÞáµÞ Ö
á ÷ û#û Õ Ü
÷ ÿ Õ Þ Õ Þ¿â’Þ Õ Þ Õ Þ Õ ÞÆÜ)Þ Õ Þ>Þ Þ Þ Þ Þ Þ Þ’Þ the first value ß²Ïfà pÞ )Þ Þ JÖ÷ÁÕ is sufficient to assure that
the remaining values are non-negative.
Finally note that while Ð is a constant in division, normally
given in non-redundant representation, for square root í is
computed for each step. Hence í is likely to be in a redundant
representation, but can be converted to non-redundant representation “on-the-fly” [14], and then truncated to accuracy
ó)ô{õqà Üù í Ö[÷ ÜpäQã for digit selection.
[12] investigated whether the truncation parameters Í and Ì
can be chosen such that some constant value, é ÷ Ü , found
by table look-up in non-redundant form, can be used as an
approximation of Üù í during the iterative phase of the square
root algorithm, i.e., for ÝÛNÝ>Ï , ÝÏ suitably chosen.
Assuming that the quotient radix is of the form Ú ÷ Ü where Ä
! Î Õ , having determined Ü í#" (and implicitly
í "'& digits
ç Ò Þ Þ¿ç í#" ) by table look-up, then ó’ô+õàiÜ í$" Ö[÷ Ü}ä% Ò . From
the proof of Theorem 4 it is easy to see that the vertical
location and size of a uncertainty rectangle can be determined
by ê a modified
condition (32)ê on ß˜Ï , toí "#remain
fixed for Ý[ÛsÝ>Ï
ê
&
at é ÷ Ü ÷Ü( í " with ó’ô+õà Ü Ö[÷ Ü ä%
Ò . Since
ê
ê
í "$& Ó
ê
Ü í æ Ü å ܒà í æ*) × ñ ) × æ Ö å Ü ó)ô{õqà Ü ÖE÷ Ü ä+
it is possible to choose Ì-Þ¿Í and Ý>Ï such that all subsequent
ë
points àiÜ í ñ ì í ޿ښú í Ö for Ý!Û Ý Ï are inside such suitably
located uncertainty rectangles. We shall, however, not pursue
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
this possibility further, but instead see that it is possible to
avoid the initial table look-up phase in the frequently used
case of ,.-/ .
B. Radix 4 Divide and Square Root without Initial PLA
346Let
5749,0
87:;-1
787/ 5< with minimally redundant digit set 2
. 5 From the table above we choose =>-?/ ,
@
-BA andHJI CEDF. We can now compute the values of the
L -MNO P 5Q%R for SUT : as
constants G K;
G
5XRYQ%Z I 4.[ L I\9] 8 ] 5Z^ LY_
5 I 4bac L Id\e]gfc LEh 7
M NO P -WV
S
-` S
resulting in the following table of comparison
constants
valid
5
5mn
for square
root
digit
selection
for
with
,
and
for
j
C
i
l
k
8
8
all Cji
for division with ko- K , assuming kqpsruaw
t v L:
I
Utilizing
that the definitions of the functions xJN k L and
I
yez L
N H k are the same as for division, combining with the table
of G N , yields the P-D diagram for the first quadrant as shown
in Fig. 9.
Fig.
{}|~ 9.
.
P-D diagram for a combined divide and square root, radix 4 SRT,
n
nb1‚ ƒ
m n
5
n 5Q
-1€
S
p0r f t v at L and CEDSince
,
t
it is sufficient initially to determine S for the square root
t
algorithm, before the general SRT algorithm can be applied.
Following [13] for completeness we now want to see if it is
possible to find common selection intervals for S , valid for
t
division as well as square root, thus avoiding a special look-up
ƒ
table to determine the initial digit.
For the square root of the radicand , there 3are
87„5< two
possibilities for the choice of the first digit, S p
, as
t
ƒ the following based on choosing the initial remainder
seen by
…† :
ƒ
8
m
4
S : Here ƒ - 4 f t , thus … -B/
f t , and the bounds
‡
‡
t
t
t
ƒ ft
are
satisfied
/
t ˆ
ˆ a‰ t
for ft f
ff .
ƒ
ˆ t
5
4‹8
t m ˆ
S : Here ƒ - 4Œ8 at , thus … -Š/
, and the bounds
‡
‡
t
t
t
ƒ
are
satisfied
/
t ˆ
ˆ ‰ t
for tŽf f
f f .
ˆ
ˆ
‡ n
‡ n
t
t
… n
using the remainder boundsƒ
from (24). Note
ˆ
ˆ
that the whole range t
f t is covered, with an overlap
tu ˆ
9
a‰
interval r tŽf f v ff‘ of width t whereƒ both values of S are
t
t
t
tŽ
ƒ
possible.
Translating
these bounds
on into bounds on , …† / we find
ca‰
8
can be chosen for
, … †
S ft
ˆ 8 7
t
c ˆ
5
can be chosen for tu
S , … †
t
ˆ
ˆ

with an overlap of width f t between these intervals.
m
:
5m
:
Note that † , hence the value of G † ƒ cannot be
5m
used for digit selection together with , ’ 8… † - /’ , since Gko- G †
L
is supposed to be in the interval r aw
t v . But we are free to
5m
\
choose any suitable value for G † 3 8(or
75< ) in the comparisons or
table look-up to determine S p
, we may even translate
t
or scale the initial remainder , … † , as long as we assure that
the standard digit selection chooses the proper value of S
t
ƒ
ƒ
according to the selection intervals
found.
5 … just
”
5
“
It is thus possible just using , ’ † /’ instead of /’
for the initial root digit selection. Recall that the entries in
c
c  are
c lower bounds
the table of selection
for the digit
ca
c
c
5•“ c constants
a
a
selections, since
,
then
can
be
tu t
t
5
8: used as 8 a
\

S  lower bound for selecting
, choosing for
.
8 C–t
S
The
corresponding
lower
bound
for
selecting
is
then
5—“
c
t
bound way beyond the lower bound
f t - tŽa , with an upper
5
for choosing S . Note that multiplication by the factor
t
ƒ
2 is permissible, since the uncertainty rectangle
of , …† here
…
only has half the width because , ’ † - /’ is in non-redundant
n
representation, thus it has only half the error as values of ’, …
used in later iterations.
Finally, there is another minor problem with the digit
selection
for square root
5
m determination. If the initial digit
S - at , which is not in the interval
is chosen, then
t L
t
a
v
rEf t t , and\ there8˜ are no selection constants corresponding to
the
value
in the table above.
Of course entries for
8˜
\
\
(and other larger values of ) could easily be added,
but for a table look-up implementation this would imply
that
\
one additional bit would be needed
in
the
address
for
the
8˜
\
would be 12 and 47, it is
look-up. Since the entries for easily seen from the P-D diagram in \Fig. 68 that there is plenty
of “room” to change the values for A from 11 resp. 44
to the
values
12
resp.
47,
and
just
use
the
selection
constants
8
8˜
\
\
A instead of the missing ones for
for
. Thus
the following table of selection constants
is
valid
for
radix
4
8
division and square root for all C™i :
8:
5
56“
\
/’
using and , ’ … † square root digit selection.
ƒ
instead of /’
ƒ
for the initial
V. C ONCLUSIONS
It has been shown that for SRT division, it is indeed possible
@
to analytically
parameter for the shifted
5Q%R define theI truncation
nL
…
-›š;œ# , ’
remainder,
, given a value of the divisor
truncation parameter = satisfying a certain bound, e.g., the
minimal such value of = . Thus the quotient digit selection
TRANSACTIONS ON COMPUTERS, VOL. ?, NO. ?, ???, ????
function can be defined without the need to extensively check
the validity of some chosen parameters.
The analysis was then modified for the SRT square root
algorithm, where it is well known that initially some digits may
have to be determined by other means, but that it is possible
to use the same algorithm to determine digits žŸ for e¡‹ E¢ ,
with ¢ suitably chosen. It has been shown that by possibly
increasing the values of the truncation parameters determined
for division, such minimal values of ¢ may easily be found
from a condition very similar to the one used to determine the
division parameters.
A combined divide and square root algorithm has been
developed, sharing digit selection intervals. To complete the
picture, the particularly important case of minimally redundant
radix 4 is analyzed in detail. Along the line of [13], but
differently, it is shown that the initial digit of the square root
here can be found by the otherwise unchanged shared divide
and square root algorithm, by a slightly different initialization
of the square root case.
We have here used standard truncation, just discarding digits
below a certain position. In some of the previous papers, e.g.,
[7], [10], [8], also different truncations of the “save” and
“carry”-parts in carry-save representations have been analyzed,
and similarly for different truncations of the positive and
negative parts in borrow-save represented remainders. It is
also possible to reduce the truncation error by including a
carry-bit from a few extra positions beyond the truncation
point, as suggested in [7]. Another (equivalent) possibility is
to apply the digit-parallel PN-recoding from [15]. Such extra
(user specified) truncation parameters could also be included
in the analysis presented here, but will of course complicate
it.
R EFERENCES
[1] P. Kornerup, “Revisiting SRT Quotient Digit Selection,” in
Proc. 16th IEEE Symposium on Computer Arithmetic. IEEE
Computer Society, June 2003, pp. 38–45.
[2] J. Robertson, “A New Class of Digital Division Methods,” IRE
Transactions on Electronic Computers, vol. EC-7, pp. 218–222,
1958, reprinted in [16].
[3] K. Tocher, “Techniques of Multiplication and Division for
Automatic Binary Computers,” Quarterly Journal of Mechanics
and Applied Mathematics, vol. 11, pp. 364–384, 1958.
[4] D. Atkins, “Higher-Radix Division Using Estimates of the Divisor and Partial Remainders,” IEEE Transactions on Computers,
vol. C-17, pp. 925–934, 1968, reprinted in [16].
[5] T. Coe and P. Tang, “It takes Six Ones to Reach a Flaw,” in
Proc. 12th IEEE Symposium on Computer Arithmetic, IEEE
Computer Society, 1995.
[6] G. Taylor, “Radix 16 SRT Dividers with Overlapped Quotient
Selection Stages,” in Proc. 7th IEEE Symposium on Computer
Arithmetic. IEEE Computer Society, 1985, pp. 64–71.
10
[7] T. Williams and M. Horowitz, “SRT division diagrams and
their usage in designing custom integrated circuits for division,”
Stanford University, Tech. Rep. CSL-TR-87-326, 1986.
[8] N. Burgess and T. Williams, “Choices of Operand Truncation in
the SRT Division Algorithm,” IEEE Transactions on Computers,
vol. 44, no. 7, pp. 933–938, July 1995.
[9] M. Ercegovac and T. Lang, Division and Square Root: DigitRecurrence Algorithms and Implementations. Kluwer Academic Publishers, 1994.
[10] S. Oberman and M. Flynn, “Minimizing the Complexity of SRT
Tables,” IEEE Transactions on VLSI systems, vol. 6, no. 1, pp.
141–149, March 1998.
[11] B. Parhami, “Precision Requirements for Quotient Digit Selection in High-Radix Division,” in Proc. 35-th Asilomar Conference on Circuits, Systems and Computers. IEEE Press, 2001,
pp. 1670–1673.
[12] L. Ciminiera and P. Montushi, “Higher Radix Square Rooting,”
IEEE Transactions on Computers, vol. 39, no. 10, pp. 1220–
1231, October 1990.
[13] M. Ercegovac and T. Lang, “Radix-4 Square Root Without
Initial PLA,” IEEE Transactions on Computers, vol. C-39, no. 9,
pp. 1016–1024, August 1990.
[14] ——, “On-the-Fly Conversion of Redundant into Conventional
Representations,” IEEE Transactions on Computers, vol. C-36,
no. 7, pp. 895–897, July 1987, reprinted in [17].
[15] M. Daumas and D. Matula, “Further Reducing the Redundancy
of Notation Over a Minimally Redundant Digit Set,” Journal of
VLSI Signal Processing, vol. 33, no. 1/2, pp. 7–18, 2003.
[16] E. E. Swartzlander, Ed., Computer Arithmetic, Vol I. Dowden,
Hutchinson and Ross, Inc., 1980, reprinted by IEEE Computer
Society Press, 1990.
[17] ——, Computer Arithmetic, Vol II. IEEE Computer Society
Press, 1990.
Peter Kornerup was born in Aarhus, Denmark,
1939. He received the mag.scient. degree in mathematics from Aarhus University, Denmark, in 1967.
After a period with the University Computing Center, from 1969 involved in establishing the computer
science curriculum at Aarhus University, where he
helped found the Computer Science Department in
1971. Through most of the 70’s and 80’s he served
as Chairman of that department. Since 1988 he
has been Professor of Computer Science at Odense
University, now University of Southern Denmark,
where he has also served a period as the Chairman of the department. He
spent a leave during 1975/76 with the University of Southwestern Louisiana,
Lafayette, LA; four months in 1979 and shorter stays in many years with
Southern Methodist University, Dallas, TX; one month with Université de
Provence i Marseille in 1996 and two months with Ecole Normale Supérieure
de Lyon i 2001. His interests include compiler construction, microprogramming, computer networks and computer architecture, but in particular his
research has been in computer arithmetic and number representations, with
applications in cryptology and digital signal processing.
Prof. Kornerup has served on the program committees for numerous
IEEE, ACM and other meetings, in particular he has been on the Program
Committees for the 4th through the 16th IEEE Symposia on Computer
Arithmetic, and served as Program Co-Chair for these symposia in 1983, 1991
and 1999. He has been guest editor for a number of journal special issues, and
served as an associate editor of the IEEE Transactions on Computers during
1991–95.
Download