Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 1.

JANUARY 1990 89

Generalized Signed-Digit Number Systems :


A Unifying Framework for Redundant
Number Representations
BEHROOZ PAMAMI, SENIOR MEMBER, IEEE

Abstract-Signed-digit (SD) number representation systems Whenever long sequences of computations are to be
have been defined for any radix r L 3 with digit values ranging performed on particular pieces of data, the one-time conver-
over the set { -a, . . . , - 1, 0,1, . * a},where a is an arbitrary
a ,

integer in the range 112 r < a < r. Such number representation sion and reconversion effort to/from the OSD representation is
systems possess sufficient redundancy to allow for the annihila- more than compensated for by the gain in computation speed.
tion of carry or borrow chains and hence result in fast The crossover point is surpassed much more frequently in the
propagation-free addition and subtraction. In this paper, we refer case of maximally redundant OSD representations (for which
to the above as “ordinary” SD number systems and define a = r - l), since conventional radix-r numbers C ~ I !be
generalized SD number systems which contain them as a special
symmetric subclass. It is shown that the generalization not only interpreted as maximally redundant OSD numbers, with no
provides a unified view of all redundant number systems which need for the initial conversion [7]. However, maximally
have proven useful in practice (including stored-carry and redundant OSD number systems may consume more storage
stored-borrowed systems), but also leads to new number systems space than the corresponding minimally redundant or interme-
not examined before. Examples of such new number systems are diate OSD number systems.
stored-carry-or-borrow systems, stored-double-carry systems,
and certain redundant decimal representations. The original definition of SD arithmetic uses a symmetric
digit set and precludes the case of r = 2, since such a binary
Index Terms-Asymmetric signed-digit number systems, bi- signed-digit (BSD) number system possesses insufficient
nary signed-digit numbers, computer arithmetic, number repre- redundancy for the general carry-free addition algorithm to be
sentation, redundant number systems, signed-digit arithmetic, applicable. This is also the reason behind the requirement that
stored-borrow representation, stored-carry representation.
a be greater than 1/2 r, even though a = 1/2 r is a viable
selection for a redundant number system if r is even (see
I. INTRODUCTION below). However, BSD numbers possess interesting properties
OR any radix r 2 3, there are one or more signed-digit [20] and have been in practical use for representing intermedi-
F ( S D ) number representation systems [2]-[4]. These ate values in two’s complement and high-speed multiplication
ordinary SD (OSD) number systems correspond to different schemes ever since multiplier recoding was introduced by
values of a in the range 1/2 r < a < r, from the minimally Booth [6]. They have also been used in redundant quotient
redundant system (a = L1/2 rJ +
1) to the maximally representation for the S-R-T division algorithm which was
redundant one (a = r - l), where a determines the set { - a, proposed independently by Sweeney [ 141, Robertson [22], and
-
..., - 1, 0, 1, * a} of the 2 a + 1 digit values used. The
e ,
Tocher [24].
most important property of OSD number representation The generalization which is proposed here not only unifies
systems is the possibility of performing carry-free addition and the OSD and BSD number systems, but also covers as special
(by changing all the digit signs in the subtrahend) borrow-free cases all other useful redundant representations such as those
subtraction. offered by stored-carry and stored-borrow systems. It also
The carry-free addition property of OSD number systems is provides valuable insight into the relationships of various
best understood by a conceptual “recoding” process which redundant number representation systems and leads to some
replaces each f a value in the digit-by-digit position sum of new representation methods which are interesting in their own
two operands by f (a - r ) and an outgoing transfer digit of right. The stored-carry-or-borrow representation system is
f 1. The new digit value, which has a magnitude r - a in the probably the most important of these new methods and is thus
range 0 < r - a < 1/2 r < a,always absorbs an incoming explored in depth.
transfer digit of f 1, thus stopping its propagation. 11. GENERALIZED
SIGNED-DIGIT
NUMBER
SYSTEMS
We define a generalized signed-digit (GSD) number
system as a positional system with the digit set { - a, - a +
Manuscript received May 15, 1987; revised December 19, 1987. This work
was carried out while the author was a Visiting Professor at the University of
Waterloo and was supported in part by the Natural Sciences and Engineering 1, * , p - 1, p } with the conditions a 2 0, 0 L 0, and a +
Research Council of Canada under Grants G1140, A3055, and A5515. + 1 > r, where r is the number representation radix. The
excluded case of a + + 1 = r results in nonredundant
The author is with the Department of Electrical and Computer Engineering,
University of California, Santa Barbara, CA 93106.
IEEE Log Number 8930844. number representation systems which cover the conventional

OO18-9340/90/01OO-OO89$01 .OO 0 1990 IEEE


90 IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 1, JANUARY 1990

GSD example, the redundant number system with r = 2 and the


digit set { 5 , I, 0,2} is not a GSD system. However, redundant
systems with digit sets whose members are not necessarily
consecutive integers do not appear to offer any advantage over
Minimal Non-Minimal GSD systems in terms of the speed or simplicity of arithmetic
GSD GSD operations.
Most GSD number systems allow carry-free addition and
borrow-free subtraction, just as OSD number systems do. This
is not a trivial extension of the corresponding OSD property,
since GSD number systems can have very strange digit sets
Symmetric Asymmetric Symmetric Asymmetric (e.g., digits 16 to 15 with r = lo). A limited-carry addition
Minimal Minimal Non-Minimal Non-Minimal
GSD GSD GSD GSD algorithm is applicable to those GSD number systems which
do not support carry-free addition.
acr a=1
p=r 1II. CARRY-FREE
ADDITION
OF GSD NUMBERS

We start by considering the following carry-free addition


BSD sc SB OSD SCB algorithm which will be shown to be applicable to most GSD
or (non-
BSB number representation systems.
Algorithm I (carry-free addition): Let the two numbers to
r= 2 be added have xi and y; as the ith digits. For each position i, a
position sum pi = xi + yi is computed which is then broken
into a transfer digit ti+ and an interim sum w; = p i - r t i +
BSC Minimally
Redundant
Maximally
Redundant
BSCB +
The final sum digit is si = w i ti whose computation should
OSD OSD produce no new transfer. a
Fig. 1. The hierarchical relationships of redundant number representation Let us see what is involved in computing the transfer digit
systems. ti+ From the digit set assumption ( - a 5 x i , yi 5 0) and the
requirements of Algorithm 1, we have - 2 a Ip; I20 and
radix-r system with a = 0 and = r - 1 as a special case.
The redundancy index of a GSD number system is defined as - a 5 wi + t i s p. (1)
p = a + p + 1 - r. GSD number systems cover the
Substituting pi - r t i + l for wi in (l), we get after some
following systems as special cases [191:
manipulation,
Binary stored-carry (BSC) number system: r = 2 , a=O,
p=2, p = l
Radix-r stored-carry (SC) number systems: a = 0, 0= r,
p=l
Let the range of transfer digits be
BSD (also, binary stored-borrow or BSB) number system:
r=2, a = p = l , p = l -xstjsp (3)
Radix-r stored-borrow (SB) number systems: CY = 1, p = r
-l,p=l where h 5 a and p I @ are nonnegative integers to be
Binary stored-carry-or-borrow (BSCB) number system: determined later. So, in the worst case, is in the range
r=2, a = l , p=2, p = 2
Pi 0 - P p; a - x
Radix-r stored-carry-or-borrow (SCB) number systems: 5t;+1s-+-. (4)
a = l , P=r, p=2 r r r r
Minimally redundant symmetric SD number systems:
Fig. 2 depicts the range of values for ti+ as a function of pi. A
2a=2P=r14, p = l
number of interesting observations can be made in connection
OSD number systems: r 1 3 , 1/2 r < a = p < r , 2 s p < r
with Fig. 2.
Minimally redundant: a = = L1/2 r] + 1, 2 5 p 5 3
First, let us specialize Fig. 2 to the case of OSD numbers
Maximally redundant: a = p = r - 1, p = r - 1.
(Fig. 3). ln general, there are overlap regions in Fig. 3 where
Fig. 1 depicts the hierarchical relationships of these two valid choices for ti+ exist. Maximum overlap occurs for
systems. The BSCB number system is equivalent to a maximally redundant OSD numbers (a = r - 1). For such
redundant number representation system proposed for the numbers, the transfer digit can sometimes be selected to be
design of a systolic binary counter [9], apparently without a f2 if r 2 4. However, this only complicates the transfer digit
realization that it was a signed-digit number system. Another selection process and the subsequent addition to compute si =
systolic binary counter design [18] uses the BSCB number wi + ti. Thus, it is advantageous to restrict the transfer digit
system in a different disguise. values to the set { 1, 0, 1) which is always adequate (see Fig.
It is interesting to note that GSD number systems actually do 3). The overlap amount is zero for even radices with a =
not cover the most general redundant representations. For 1/2 r + 1 and is negative for odd radices with C Y = 1/2(r+ 1).
PARHAMI: SIGNED-DIGIT NUMBER SYSTEMS 91

‘i+r Lemma I : A necessary and sufficient condition for the


carry-free addition algorithm to be applicable is

pLX+p. (5)
Proof: The existence of an integer value for t i + l
satisfying (4) implies

(6)
r r
+ +
Letp, a - X = ryi Si, where Si (0 I6; 5 r - 1) is the
pi remainder of dividing p i + a - A by r. Then, (6) becomes
N\\Y

y i + 6;- ( a - h )--
/3 - p
5 Yi
r
Simplifying this inequality and noting that a + /3 = r +p -
1 yields
I
p?X+p-(r- 1 -Si). (7)
Fig. 2. The range of transfer digit values as a function of position sum for
carry-free addition. Inequality (7) must hold for all possible values of 6;. If we
show that Si = r - 1 for some p i in the range - 2a Ip i I
A
‘i+l +
20, the desired conclusion ( p I X p ) will be immediate.
Consider the case Si = r - 1 with y i = 0. We have in this
case
p i = S i - ( a - h ) = r - 1- ( a - A ) . (8)
Clearly, p i in (8) satisfies p i 2 - 2a. It satisfies p i I2/3 if we
have p 2 X - 0.This concludes the proof for the case p I X
- p. If p < X - 0,let 6; = r - 1 with yi = - 1. We have in
this case
t p i = - r + & - ( a - X ) = -1-(a-A). (9)
ta Pi

Clearly, p i in (9) satisfies p i I2p. It satisfies p i 2 - 2a if we


+
have a X I 1. According to the assumption p < X - p, we
can write
a + X>a + p + p = 2 p + r - 1.
The conclusion a +
h 2 1 is immediate. 0
It is apparent from our previous discussion that the transfer
digit selection process consists of a number of (approximate)
comparisons between p i and known constants. Thus, the
Fig. 3. The range of transfer digit values for ordinary signed-digit numbers
addition algorithm is simplified if the set of possible values for
transfer digits is of minimal size.
No problem arises in the latter case due to the fact that an
integer value for p i cannot fall in the “noncovered” region.
Lemma2: The set {-A, - X +
1, p - 1, p } of
a - . ,

possible transfer digit values for carry-free addition of GSD


Both of these cases correspond to minimally redundant OSD
numbers is of minimal size if we choose
numbers.
The overlap region, if present and wide enough, can be used
to simplify and speed up the adder design. As an example,
consider the OSD number system with r = 8 and a = 7.
Here, the transfer digit may be 0 for - 6 5 p i I6 , 1 for p i I
2, and 1 for p i 5 - 2 . Therefore, it is sufficient to compute p i
to an accuracy of f 2 and compare it to +- 4 for selecting a
proper transfer digit. Assuming sign-and-magnituderepresen- Proof: To determine the minimal value for A, we set
tation of the radix-8 digits, accuracy of k 2 can be obtained by p i = -2a in (4) to obtain
ignoring the least significant bits of the two digits. The sum of
the two high-order bits of the two digits must then be 2a+p-p a+X
- s m i n ( t i + I ) I-- .
compared to k 2 . r pi r
92 IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. I , JANUARY 1990

To minimize the value of h. we select Noting that a + 0= r - 1 + p , we conclude that carry-free


addition is possible only if
max(-A)=max(min(ti+l))=
Pi I
--
p 2 =1+ p1
- .
which in turn yields
Inequality (16) cannot be satisfied for r = 2 . Thus, Algorithm
1 is inapplicable to radix-2 GSD numbers, regardless of the
choice of values for a and 6. Similarly, a GSD number system
To verify that (10) is indeed the solution of (12), we substitute
with p = 1 (or a +
p = r ) does not lend itself to carry-free
addition and is in a sense insufficiently redundant for this
and verify the following equality:
purpose. For r > 2, necessity of p 2 2 is implied by (16). To
prove the sufficiency of p z 2 when a , p # 1 , we reconsider
(15) and substitute r - 1 +
p - a for p:

Let a = ( r - 1) y + 6, where 0 5 6 < r - 1 . Then, (13) P-a


becomes
For a = 0 mod(r - l), the sufficient condition given by (17)
(14) is identical to (16) and thus p 2 2 is necessary and sufficient.
Now let a = 6 mod(r - 1); that is (Y = ( r - 1) y +6 for
Equality (14) clearly holds for 6 = 0. For 1 I6 <r - 1, we Some y, with 0 < 6 < r - 1. In this case, the sufficient
have r6/(r - 1)1 = 1 and (14) becomes conditions given by (17) can be reduced to

p12+

which is cleary satisfied for all the values of 6 in the assumed For 6= 1, inequality (18) is satisfied iff p 1 3. For 2 5 6 I
range. A similar argument shows that r - 1, inequality (18) is satisfied iff p 1 2 . The proof is
complete upon noting that 6 = 1 and p = 2 imply either (Y = 1
or a = r (0 = 1). a
Algorithm 2 (transfer digit selection for carry-free
which is satisfied by (1I). a addition): The transfer digit ti+ is selected to be k iff c k 5 p i
Corollary I: In a GSD number system, the set of possible < C k + ] , w h e ~ e C - ~-o3,CP+]
= = mandeachC,(-h<
j Ip ) is a known comparison constant to be specified later.
transfer digit values must have at least rp/(r - 1)1 + 2
members if the carry-free addition algorithm is to be applica- Clearly, the values of comparison constants in Algorithm 2
ble. directly affect the complexity of the GSD adder. In general,
Proof: The set of possible transfer digit values must have there may be several valid choices for each Cj and thus the one
at least A"" + +
pmin 1 members. We have from Lemma 2 which results in the simplest possible hardware realization can
be selected. The following theorem specifies the range of valid
choices for Cj.
Theorem 2: For carry-free addition of GSD numbers, the
comparison constants c k ( - h < k 5 p ) of Algorithm 2 must
satisfy the following constraints:

This concludes the proof. a kr - (a- A) IC k i( k - l ) r + - p + 1. (19)


An immediate implication of Corollary 1 is that at least
three different values are needed for the transfer digit and that Proof: From inequality (4), we see that the selection ti+
a simple binary carry (or borrow) is insufficient. = k - 1 is valid only if
Theorem I : For the carry-free addition defined by Al-
p i s ( k - l)r+p-p. (20)
gorithm l to be applicable to a GSD number system, it is
necessary and sufficient to have p 2 3 if either (Y or p is equal
to 1 and p L 2 otherwise, with r > 2 in both cases. Similarly, the selection t i + ] = k is valid only if
Proof: From Lemma 1, we must have p 2 h + p. Thus,
assuming minimal values for h and p , we can write

1 ' 1 I"[ 1 9 1
Amin + pmin =
r-1
+
r- 1 r- 1
. (15) So the boundary between choosing k - 1 and choosing k (i.e.,
Ck)mustliebetween kr - (a - X)and(k - 1)r + - p +
PARHAMI: SIGNED-DIGIT NUMBER SYSTEMS

1, provided that we have


k r - ( a - X ) s ( k - l ) r + P - p + 1.
Considering that a + - r = p 1 , the above condition is
-

equivalent to p L h + p which is the same as the condition of


Lemma 1 .

IV. LIMITED-CARRY
ADDITION
OF GSD NUMBERS

Next, we consider a limited-carry addition algorithm which


is applicable to all GSD number systems. This algorithm finds
applications in cases where Algorithm 1 cannot be used.
According to Theorem 1, this happens when we have one of
the following situations: 1) r = 2, 2) p = 1 , or 3) p = 2, with
either a or /3 equal to 1. Examples of GSD systems in these
categories are the SC, SB, and SCB representation methods,
including of course their radix-2 special cases.
Algorithm 3 (limited-carry addition): Let the two num- Fig. 4. The range of transfer digit values as a function of position sum for
bers to be added have xi and y ; as the ith digits. In stage 1, for limited-carry addition.
+
each position i, a position sum p i = x; y; is computed and
used to generate a range estimate for the final transfer
digit In stage 2, the position sum pi and the range Using inequalities (23), in the worst case, t;+l is in the range
estimate e; are used to compute a transfer digit ti+land an
interim sum wi = pi - rt;, The final sum digit is si = w i Pi P - P ’ p; a-X
+ t; whose computation should produce no new transfer. 0 if e;=l then
r r
Iti+1 I-+-
r r
The new aspects of this algorithm with respect to Algorithm
1 are 1 ) computation of range estimates, and 2) computation of
Pi P-P pi a-A’
ti+1 as a function of both pi and e;. The range estimate e, may i f e ; = h then ------<t;+11-+-. (24b)
be presented in many different formats. In the simplest case, it r r r r
is a binary indicator restricting ti to one of two subsets (not
necessarily disjoint) of the set { - A, - X +
1, *, p - 1, p} Fig. 4 depicts the range of ti, as a function of pi and the
of possible transfer digit values. In the most general case, the incoming range estimate ei .
range estimate e; is k-valued and identifies one of k (possibly Intuitively, the key to the success of the limited-carry
overlapping) subintervals of the closed interval [ - X, p] as addition algorithm in cases where the carry-free algorithm
containing ti. fails is the “expanded” range of ti+! which permits the
In our subsequent discussion, we consider the simplest case selection of a value for ti+ when no acceptable value exists in
where a binary range estimate is used and show that this is the original nonexpanded range.
sufficient for limited-carry addition in all cases. Let X ’ and p ’ Obviously, we must make sure that the range estimate ei+
be constant integers satisfying for the value of ti+ can be generated based on a simple test of
PI.
Algorithm 4 (range estimate f o r limited-carry addition):
Select = 1 iffpi < E and e;+l = h iffpi 2 E, where E is
Unlike X and p which are assumed to be nonnegative, X ’ and a known comparison constant to be specified later. e
p’ can also be negative. The minus sign of - X‘ in (22) is only Theorem 3: For limited-carry addition of GSD numbers,
used for convenience since it allows simple application of our the comparison constant E of Algorithm 4 must satisfy the
previous results in this case. The binary range estimate ej E following constraints:
{I, h } restricts the transfer digit tj into one of the two closed
subintervals; the low subinterval [-A, p ’ ] and the high - (A’ + 1)r+ -p ’<EI ( p’ + l ) r - ( a- A’). (25)
subinterval [-A’, p ] . For example, if X‘ = p’ = 0, then the
range estimate determines the sign of the transfer digit (with 0 Proof: Referring to Fig. 5, we note that for pi < F ( F
considered both positive and negative). being the value of pi at the intersection of the horizontal line
Let us see what is involved in computing e i c l and = p’ +
1 with the uppermost oblique line), t;+I is at
Inequalities (1) and (2) remain valid here. The correspondence most equal to p ’ regardless of the value of ei. Thus, a range
between range estimates and possible transfer digit values is as estimate e;+ = 1 can be generated for pi < F. Similarly, for
follows: pi > D (Dbeing the value of pi at the intersection of the
horizontal line ti+ = - X ’ - 1 with the lowermost oblique
if e;=l then -Xhltirp’ (23a) line), ti+ is at least equal to X‘ regardless of the value of ei.
if e;=h then - X h ’ s t i s p . (23b) Thus, a range estimate e;+ = h can be generated for p; > D.
94 IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. I , JANUARY 1990

(2B+a-l'),,
for D and F from Fig. 5 , we obtain

-(A' + l)r+/3- p' < ( p ' + 1)r- (a-A').

Using the identity a + /3 = r - 1 + p , the above condition


becomes
P
X'+p'>-- 1. (29)
r+ 1

2p Condition (29) is the same as (28) since A' + p' is an


integer. a
Theorem 5: The limited-carry addition defined by Al-
gorithm 3 is applicable to all GSD number systems.
Proof: Substituting the values of X"'" and pmlnin (27),
we obtain

Fig. 5. Generating a binary range estimate e,+ for the transfer digit t,, I . pbmax( [z]
r- 1 r- 1 ) .
X ' + [L]
+p', (30)

Therefore, valid choices for E are in the range D < E 5 F. Inequality (30) and the conditions X' < X"'" and p' < p"'"
Substituting the expressions for D and F from Fig. 5, we dictate
obtain the desired result. 0
Algorithm 5 (transfer digit selection for limited-carry
addition): The transfer digit ti+ is selected to be k iff Ck(ei)
5 p i < Ck+l(ei), where C P x ( l )= C P x ( h ) = -03,
h.Imin( [z]
r - 1 -1, I"]
r- 1 ) p- (31a)

Cp+l(l) = C,+,(h) = oo,andeachC,(ei)(-X < J Ip , e j


E { 1, h}) is a known comparison constant to be specified p'5min( [L]
r- 1 -1, r- 1 ) .
[z] (31b)
p-
later. a
Because of the need for taking e; into account, Algorithm 5
implies a more complex hardware implementation than its We need only check that valid choices for X ' and p ' satisfying
carry-free counterpart (Algorithm 2). (28) and (31) exist for cases where carry-free addition is
Theorem 4: For limited-carry addition of GSD numbers, impossible; namely for the cases 1) r = 2, 2) p = 1, 3) p = 2,
the comparison constants Ck(l) and Ck(h) ( - h < k 5 p ) of with either CY or /3 equal to 1. For r = 2, conditions (28) and
Algorithm 5 must satisfy the following constraints: (31) become

kr-(a-h)sCk(I)5(k- l)r+P-p'+l (26a) h'+p'2

kr - (a- A') ICk(h ) I( k - l ) r + /3 - p + 1. (26b)


h ' I m i n ( a - 1, p - P ) = a - 1 (32b)
Proof: Similar to Theorem 2, with p replaced by p' in
p ' < m i n ( p - 1, p - a ) = P - 1. (32c)
one pass to get the constraints on Ck(1 ) and h replaced by X '
in another @ss for Ck(h) conditions. a
Lemma 3: Necessary and sufficient conditions for the It is sufficient to show that at least one pair of values for X'
and p' satisfy the conditions of (32). Let A' = a - 1 and p'
limited-carry addition algorithm to be applicable to a GSD
= /3 - 1. Then, A' + p' = a + /3 - 2 = p - 1, which is
number system are
clearly not less than -I p / 3 -I since p L 1. This concludes the
pLmax(X+p', h ' + p ) (27) proof for r = 2. Next consider the simplified versions of (28)
and (31) for p = 1:

Proof: The necessity of (27) is established similar to the


proof of Lemma 1, with p replaced by p' in one pass (giving p
X r s m i n ( [ r~- 11 - 1 , 1 - r - 1 [E] ) (33b)

L p' + X) and X replaced by h' in another pass (giving p L


p + A'). The necessity of (28) results from the requirement D
< F in the proof of Theorem 3. Substituting the expressions
ptsmin( [e]
r- 1
-1,l- r'l>
r- 1
. (33c)
PARHAMI: SIGNED-DIGIT NUMBER SYSTEMS 95

Consider the three cases a = 0, a = r, and 0 < a < r. For a presented here allows replacing the second condition by p, 2
= 0, the values A' = - 1 and p' = 1 satisfy the conditions 4 which is easier to test in hardware (only the sign bit and a
given by (33). For a = r, the values A' = 1 and p' = - 1 single value bit need to be examined).
satisfy the conditions given by (33). Finally, for 0 < a < r, Maximally redundant OSD number systems have a = r -
the values A' = p' = 0 satisfy the required conditions. This 1 . Let r > 4, since for r = 3 or r = 4, maximally redundant
concludes the proof for p = 1 . For the final case of p = 2 with and minimally redundant OSD systems are identical. For such
either a or /3 equal to 1 , we consider the two possibilities: a = systems, p = r - 1 L 3 and we find the following ranges for
1 and a = r. The required conditions in this case are the comparison constants:
A' + p ' 2 0 (344 -(r-22)1C05 - 1

A'rmin( 1'1 r- 1
- 1 , 2- 1-
r+l-a
)
r- 1
(34b)
2 s C l s r - 1.

Selection of values for CO and C1 is governed by the

P' S m i n ( I"'-"]
r-1 - 1, 2- 1
5
1) . implementation details. For example, consider the case of r =
(34C) 8. Ifp; is formed in sign-and-magnitude or one's complement
form, then CO= - 3 and C1 = 4 are the best choices, since
It is easily seen that in both cases of a = 1 and a = r, the the comparisons pi 1 - 3 and pi 2 4 involve the testing of the
A' = sign and a single value bit. If negative values are represented
= the conditions given by (34).
in two's complement form, then CO= - 4 and CI = 4 are the
V. ORDINARY SIGNED-DIGIT NUMBER SYSTEMS best choices. Note that both cases are different from Avi-
Ordinary signed-digit (OSD) number representation sys- zienis's original OSD proposal which specifies CO= - 6 and
= for =
tems have been defined for any radix r 1 3 with digit values
ranging over the set { - a , * * , - 1 , 0 , 1 ,- a } , where a is
e ,
Such
applied
changes to the original OSD proposal can also be
to intermediate OSD systems with 112 r + 1 < a < r
an arbitrary integer in the range 1/2 < < r. An OSD
number system has a redundancy index in the range 2 Ip < - 1 to obtain similar improvements.
r. The fact that 1 < 112 r < a < r implies that a # 1 mod (r VI. STORED-CARRY NUMBER SYSTEMS
- 1) and thus the cany-free addition algorithm is applicable
even when p = 2. We have for all OSD number systems Stored-carry number representation systems can be defined
for any radix r as having the digit set ( 0 , 1, 2, * * r}, e ,

although only the binary stored-carry (BSC) system has found


wide applications. The main application of BSC numbers is in
multioperand addition and hence multiplication. A BSC
number can be added to a conventional binary number,
For minimally redundant odd-radix OSD systems, p = 2.
producing a BSC result, by a set of full adders without carry
From Theorem 2, the comparison constants COand C1are
propagation. The usual encoding for BSC digits in this context
istorepresentOby(O,O), l b y ( 0 , l ) o r ( l , O ) , a n d 2 b y ( l ,
r- 1 1 ) . We call this the unary encoding of the digit set ( 0 , 1 , 2).
CO=- ( c y - I)= --
2 That two unary-encoded BSC numbers can be added by a
limited-carry circuit consisting of two levels of full adders is
r+ 1
Cl=r-(a-l)=-. well known. This property follows for SC numbers in all
2 radices from our Theorem 5, although the circuit implied by
our limited-carry addition procedure is different. In adding
Minimally redundant even-radix OSD systems have the
two BSC numbers, we have A"'" = 0 and pmln= 2 from (10)
following comparison constants (here p = 3):
and (11). To design the needed circuit, we start by selecting
r r appropriate values for A ' and p' satisfying (28) and (31)
-(a- 1 ) = - - s C , s - + 1 which for the BSC number system becomes
2 2
A'+pj L O
r r
-<CIS- + 1 = a .
2 2 A'S-1

This is slightly different from Avizienis's original algorithm p ' S 1.


which uses CO = - ( a - 1) and CI = a in all cases, and
the Only possible choices are A ' = - and p ' = *
results in simpler hardware realizations for Some values of r;
including the very important special cases of r = 2a. The comparison constant E of Theorem 3 must satisfy
Let us take r = 8 as an example. The digit set of a 1<E~3.
minimally redundant radix-8 OSD system is { 5 , . . ., 1, 0 , 1 ,
. . ., 5 } . According to Avizienis's OSD addition algorithm, The most convenient value for E depends on the encoding used
t;+1 = for p ; < - 4 and ti+ = 1 for pi > 4. The method to represent pi. For example, with a 3-bit binary encoding for
96 IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 1, JANUARY 1990

pi,the choice E = 2 is more convenient since the condition p, 2) the (n, p ) encoding, consisting of “negative” and
L E of Algorithm 4 can be checked by examining the logical “positive” flags for each digit, whereby i, 0, and 1 are
OR of the two most significant bits of pi. It is possible to represented by (1, 0), ( 0 , 0), and (0, l ) , respectively.
generate the range estimate directly as a function of xi and yi If a digit d is represented as (ds, du)with the first and as
(four logic variables) rather than waiting for the computation ( d ” , dP) with the second encoding, then the following
of pi. This speeds up the addition process at the expense of a equalities hold:
somewhat more complex design. If the encoding (1, 0) is d = ( l -2ds)du=dp-d”.
disallowed for representing the BSC digit 1, then the choice E
It has been shown that the second encoding results in much
= 3 turns out to be more convenient and simplifies the overall
simpler implementations for most arithmetic circuits of inter-
design considerably. If the unary encoding is used, the absence
est [20]. Both encodings allow the implementation of normal-
of (1, 0) can be ensured by adding an initial pair of gates that
ized significant digit arithmetic [15] if the extra combination
convert each digit encoding ( a l ,a2) to ( a l a 2 ,al + 4.
(( 1 , O ) in the (s, U ) encoding and (1, 1) in the (n,p ) encoding)
VII. STORED-BORROW NUMBER SYSTEMS is used to denote nonsignificant zeros. On the other hand, the
extra combination ( 1, 0) of the (s, U ) encoding and the unused
Stored-borrow number representation systems can be de- (1, 1) ofthe (n,p) encoding can be used as DON’T
fined for any radix as having the digit set { i, O, * * ’
-
3 9
CARE conditions to obtain simpler designs. It is also possible to
11. In the special case of r = 2, we obtain the binary stored- use a l-out-of-3 encoding where a binary signed digit is
PSB) Or signed-digit (BSD) number system by the triple (n,0,p),with the middle flag denoting
with the digit set { i, 0, I}. In addition to having been used for the zero. Such an can provide complete
representing temporary values in high-speed multiplication unidirectional error detection capability with a relatively low
and division [61, [ 141 [221, [241, BSD numbers have been overhead in terms of add& hardware complexity.
3

proposed for application Over the entire range of data storage An important property of BSD numbers is that there exists a
and processing functions in special-purpose arithmetic engines propagation-free recoding algorithm which transforms any
1201. A BSD number can be added to a conventional binary BSD number = x k 1~x k - 2 . . . xo into an equivalent BSD
number, producing a BSD result, by a set of adder-like cells number = ZkZk- . . . zo, such that z,.z,-, + 1 (1 j
without carry or borrow propagation.
k). This recoding enables the use of a special carry-free
That two BSD numbers can be added by a limited-carry addition process instead of the limited-carry process and also
circuit is known r813 [23i. This property for SB leads to higher-speed serial or parallel multiplication. The
numbers in radices from Our 53 the details can be found in [20] and thus will not be discussed here.
circuit implied by our limited-carry addition procedure is As BSD numbers require the Same amount of storage as the
different from the previously proposed implementations. In stored-carry representation (2 bits per digit position), it is
adding two BSB Or BSD we have h”””= and pm’” natural to ask whether BSD numbers offer any advantage over
= 1 from (10) and (11). To design the needed circuit, we start the BSC system. The is positive for the following
by selecting appropriate values for h‘ and p ’ satisfying (28) reasons:
and (31) which for the BSB number system become
1) ease of multiplication, division, and other arithmetic
h’+p’10 operations,
2) ease of zero detection,
X‘rO
3) suitability for use with arithmetic error codes.
p’I0. These points have been dealt with elsewhere [20].
Clearly, the only possible choices are A‘ = p’ = 0. The VIII. STORED-CARRY-OR-BORROW
NUMBER
SYSTEMS
comparison constant E of Theorem 3 must satisfy The stored-carry and stored-borrow properties can be
-1<E~l. combined to obtain the SCB number representation systems
which in radix r use the digit set { 1, 0, 1, * * * , r } .
The most convenient value for E depends on the encoding used Unfortunately, despite the higher redundancy index ( p = 2)
to represent p,.In most cases, however, the choice E = 0 is compared to the SC and SB systems (p = l ) , carry-free
convenient since the condition p, 2 E of Algorithm 4 can addition is still not possible because we have CY = 1 (refer to
be checked by determining the sign of p,. It is also possible Theorem 1). Furthermore, other arithmetic algorithms (such
to generate the range estimate directly as a function of x, and y, as multiplication) can only become more difficult due to the
(four logic variables) rather thap waiting for the computation extra digit value. It is therefore quite surprising for SCB
of p,,as was the case for BSC numbers. number systems to find any application at all.
In two-valued logic, each binary signed digit can be One possible application area for SCB number Systems is in
represented by two bits, using several possible encociings. the design of systolic up/down counters. The binary SCB
Two natural encodings are (BSCB) number system was first used in the design of a
1) the (s, U ) encoding, consisting of “sign” and “value” systolic up/down counter in 1982 [9], apparently without any
bits for each digit, whereby 1, 0, and 1 are represented by (1, attention to its arithmetic properties. A later systolic binary
l ) , (0, 0), and ( 0 , l ) , respectively, counter design by the author [17] also used the BSCB number
PARHAMI: SIGNED-DIGIT NUMBER SYSTEMS 97

system in a different disguise. It was this application of the systems is the use of digits with larger magnitudes and thus the
BSCB number system that prompted the author to study the potential for more difficult multiplication and division. The
properties of GSD number systems. suitability of such new number systems must be evaluated in
In the systolic binary counter application, the magnitude of the context of particular application areas. However, one can
the count can be stored as a BSCB number, with the sign immediately conclude that SDC number systems are attractive
maintained separately. Assuming that the count value 0 is for applications where addlsubtract operations are dominant.
detectable without a need for signal propagation and that the Other potentially useful subclasses are decimal number
value 0 is always given the positive sign, then the various systems with higher redundancy indexes than the decimal SDC
counter operations can be performed as follows. system. For example, the hex-digit decimal (HDD) number
1) To count up from a nonnegative value, increment the system with the digit set ( 0 , 1, . . 15} implies no storage
0 ,

magnitude. overhead compared to conventional decimal representation but


2) To count up from a negative value, decrement and change offers the advantage of carry-free addition using a two-stage
the sign if the result is 0. circuit (an ordinary hex adder and a “correction” circuit
3) To count down from a nonnegative value, first change the which is only slightly more complex than the conventional
sign if the starting value is 0 and then decrement. decimal ‘ ‘adjuster’’). Compared to low-redundancy OSD
4) To count down from a negative value, increment the number systems (digit set {6, 0, . . 6) or (7, . . . , 0,
-
a , a ,

magnitude. * , 7}), the HDD representation has the advantages of no


Increment and decrement operations affect only the least initial conversion from decimal and simpler adder logic and
significant counter position directly. At each clock pulse, the the disadvantage of needing an extra sign bit. The properties of
value of the ith counter digit is recomputed based on its this and other new redundant decimal number systems are
current value and the value of the ( i - 1)th digit according to a currently under investigation.
simple set of rewriting rules which essentially transfer a In general, the use of redundant number representation
stored carry or borrow from one position to the next higher systems is particularly effective when long sequences of
position, enabling the absorption of the incoming carry or computations andlor long operands are involved. Such condi-
borrow (increment or decrement) at the least significant tions prevail in many special-purpose systems such as those
position. used for high-precision scientific computations and signal
This method is also applicable to higher radix systolic processing 1111, 1261, [lo], [ 131. Further work is thus needed
counters which have the advantage of lower overhead. In to identify strategies for the evaluation of various redundant
particular, for r = 10, no storage overhead is involved since a representations with respect to suitability for particular classes
decimal counter requires at least 4 bits per digit position of applications.
anyway. The logic of each counter stage is of course more Finally, from the point of view of practical implementation,
complex for a systolic decimal counter than for an ordinary our discussion in this paper is incomplete due to inadequate
counter and this is the price one pays for the added speed. treatment of subtraction as well as zero detection and sign test
for GSD number representations. Because GSD number
IX . CONCLUSIONS systems may have asymmetric digit sets, we need to consider
We have presented a unified framework for the study of subtraction (or at least sign change for representations with CY
redundant number representation systems, providing a general > 0 and /3 > 0) explicitly. Most results presented here carry
theory for carry-free and limited-carry addition properties of over directly to subtraction, using the position difference q,
such systems. In fact, carry-free addition can be considered a = x, - y,, the interim difference U, = q, + rt,, and the
special case of limited-carry addition where the estimate e, is final difference digit d, = U , - t, in the algorithms. Details of
not needed because we have h’ = h and p’ = p. So, we could the procedures and related results along with methods for zero
have chosen to present the limited-carry results first and then detection and sign test have been worked out in a companion
derive the carry-free property as a special case by seeking paper 1211.
conditions under which the equalities A‘ = h and p’ = p can
be satisfied. However, it is felt that the present order of REFERENCES
presentation is more natural and easier to understand. [I] S. F. Anderson etal., “The IBM System/360 Model 91: Floating-point
Does the generalization considered in this paper suggest execution unit,” IBM J . Res. Develop., pp. 34-53, Jan. 1967.
[2] A. Avizienis, “Signed-digit number representation for fast parallel
new classes of redundant number representations which have arithmetic,” IRE Trans. Comput., vol. EC-IO, pp. 389-400, 1961.
not been dealt with in the past? The answer to this question is [3] -, “On a flexible implementation of digital computer arithmetic,”
positive. An immediate example is provided by the SCB in Inform. Processing ’62. Amsterdam: North-Holland, 1963, pp.
664-670.
subclass which has been previously examined in a limited [4] -, “Binary-compatible signed-digit arithmetic,” in AFIPS Con$
context and only for r = 2. Consider as another example an Proc. (1964 Fall Joint Comput. Conf.), pp. 663-672.
interesting subclass of GSD number systems which is obtained [5] -, “Arithmetic error codes: Cost and effectiveness studies for
applications in digital system design,” IEEE Trans. Comput., vol. C-
if we choose CY = 0 and 0 = r + 1. This subclass, which may 20, no. 11, pp. 1322-1331, Nov. 1971.
be called the stored-double-carry (SDC) number system, [6] A. D. Booth, “A signed binary multiplication technique,” Quarterly
implies the same amount of storage overhead and redundancy J. Mech. Appl. Math., vol. 4, part 2, pp. 236-240, 1951.
[7] T. C. Chen, “Maximal redundancy signed-digit systems,” in Proc.
as the SCB subclass but offers the advantage of carry-free Symp. Comput. Arithmetic, Urbana, IL, June 1985, IEEE Computer
addition. The obvious disadvantage with respect to SCB Society Press, pp. 296-300.
98 IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 1 , JANUARY 1990

[81 C. Y. Chow and J. E. Robertson, “Logical design of a redundant [26] V . Zakharov, “Parallelism and array processing,” ZEEE Trans.
binary adder,” in Proc. Symp. Comput. Arithmetic, Santa Monica, Comput., vol. C-33, no. 1, pp. 45-78, Jan. 1984.
CA, Oct. 1978, pp. 109-115.
191 L. J. Guibas and F. M. Liang, “Systolic stacks, queues, and
counters,” in Proc. Conf. Advanced Res. VLSZ, MIT, 1982, pp.
155-164.
L. B. Jackson Digital Filters and Signal Processing. Boston, MA:
Kluwer, 1986.
R. W. Hockney and C. R. Jesshope, Parallel Computers. Bristol, Behrooz Parhami (S’70-M’73-SM’78) was born
England: Adam Hilger, 1981. on February 1, 1947 in Tehran, Iran. He received
D. E. Knuth, The Art of Computer Programming: Vol. 2 Seminu- B.S. and M.S. degrees in electrical engineering
merical Algorithms, 2nd ed. Reading MA: Addison-Wesley, 1981, from Tehran University and Oregon State Univer-
pp. 179-197. sity, in 1968 and 1970, respectively, and the Ph.D
S.-Y. Kung, R. E. Owen, and J. G. Nash, Eds., VLSI Signal degree in computer science from University of
Processing IZ. New York: IEEE Press, 1986. California at Los Angeles in 1973.
0 . L. MacSorley, “High-speed arithmetic in binary computers,” He was a Research Assistant/Engineer (1970-
Proc. IRE, vol. 49, pp. 67-91, Jan. 1961. 1973) and Acting Assistant Professor (1973-1974)
N. Metropolis and R. L. Ashenhurst, “Significant digit computer at UCLA before joining Sharif (then Arya-Mehr)
arithmetic,” IRE Trans. Electron. Comput., vol. EC-7, pp. 265- University of Technology (SHUT) in Tehran, Iran,
267, 1958. where he was Professor of Computer Science until 1988 During his tenure at
G . Metze and J. E. Robertson, “Elimination of carry propagation in SHUT, he was active in the areas of educational planning and curriculum
digital computers,” in Inform. Processing ’59 (Proc. UNESCO development and also taught a wide variety of courses This led to his
Conf., June 1959), 1960, pp. 389-396. involvement in the development of a standard nationwide computer science
1171 B. Parhami and A. Avizienis, “Detection of storage errors in mass and engineering program which has been in effect in all major Iranian
memories using low-cost arithmetic error codes,” ZEEE Trans. universities since 1983. Since 1972, he has acted as a consultant to various
Comput., vol. C-27, no. 4, pp. 302-308, Apr. 1978. organizations, been involved m standardization activities, participated in
B. Parhami, “Systolic upidown counters with zero and sign detection,” many conference organizing and program commttees, and served on the
in Proc. Symp. Comput. Arithmetic, Como, Italy, May 1987, pp. editorial and advisory boards of several technical publications (including a
174- 178. five-year term as Editor of Computer Report, a Farsi-language computing
-, “A general theory of cany-free and limited-carry computer periodical) In 1986-1988, he was on sabbatical leave as Visiting Professor at
arithmetic,” in Proc. Canadian Conf. VLSZ, Winnipeg, Canada, Oct. the University of Waterloo and Carleton University in Canada, before joining
1987, pp. 167-172. University of California at Santa Barbara as Professor of Computer
-, “ C a q - f r e e addition of recoded binary signed-digit numbers, ” Engineering in 1988 Dr Parhami has published more than 60 research papers
ZEEE Trans. Comput., pp. 1470-1476, Nov. 1988. in the areas of computer architecture, computer arithmetic, dependable
-, “On the practical implementation of arithmetic functions with computing, Farsi-language information processing, and informatics educa-
generalized signed-digit number representation, ” submitted for publi- tion He has also authored two Farsi-language texts entitled Computer
cation. Appreciation and Computer Organization, Vol. 1: Basics of Hardware
17-21 J. E. Robertson, “A new class of digital division methods,” ZEEE and has coauthored a 6000-term English-Farsi Glossary of Computers and
Trans. Comput., vol. C-7, pp. 218-222, Sept. 1958. Informatics. His current research interests are in the general areas of
1231 N. Takagi, H . Yasuura, and S. Yajima. “High-speed VLSI multiplica- computer hardware and organization, including high-performance systems
tion algorithm with a redundant binary addition tree,” ZEEE Trans. and dependability issues
Comput., vol. C-34, no. 9, pp. 789-796, Sept. 1985. Dr. Parhanu is a Distinguished Member of the Informatics Society of Iran
K. D. Tocher, ”Technique for multiplication and division for auto- (ISI), and a member of the Association for Computing Machinery, and the
matic binary computers,” Quarterly J. Mech. Appl. Math., vol. 11, British Computer Society. He was the founder of IS1 and served as its first
part 3, pp. 364-384, 1958. president from 1978 to 1983. He also served as Chairman of IEEE Iran
1251 C. S. Wallace, “A suggestion for a fast multiplier,” ZEEE Trans. Section from 1977 to 1986, following a one-year term as Vice-chairman and
Electron. Cornput., vol. EC-14, no. 1, pp. 14-17, Feb. 1964. received the IEEE Centennial Medal in 1984.

You might also like