Selecting a to Eliminate Carry Chain in SD For no carry, require.
-
Upload
tobias-hunter -
Category
Documents
-
view
213 -
download
0
Transcript of Selecting a to Eliminate Carry Chain in SD For no carry, require.
Selecting a to Eliminate Carry Chain in SD
For no carry, require
{ , 1, ,1,0,1, , 1, }
1
1 (1)
, 1
i
i i i
i
i
i i i
s a a a a
s w t a
worst case t restricting
w a equation
must be true for all x y where t
Selecting a to Eliminate Carry Chain in SD1: 2
(2 ) (1) 2
(1)
2 1 1 ( )
2 :
( ) (1) 0
(1)
1
12 1 ( )
2
11
2
i i
i
i i
i
i
Case x y a
w a r a r
By
a r a or a r upper bound
Case x y a
w a r a r
w r a
By
r a a
ra r or a lower bound
ra r
Binary SD Addition
2 , 1, ( , 1,0,1 )
11 2 !
2
For r a only one digit set
rr a impossible for digit set
Implies no guarantee that si = wi + ti will not produce a carry
Looking at algorithm:Step 1:
1
1
( ) 2
1 1
1 1
0 0
i i i i
i i
i i i
i i
w x y t
if x y
t if x y
if x y
Unmodified Binary SD Addition Table
xi,yi
ti+1
wi
11 1111010100
10
0 0 0 0
01
1
11
1
Step 2: Based on calculation of wi and ti+1
10
1 1
0 1 0 1
i i is w t
Note: redundancy allows choices for wi and ti+1
How Useful is Unmodified Table?
Works if operands do not contain If operands contain only 0’s and 1’s, no carry generated.
1
0 1 0 1or or
i i is w t
1 1 .... 1 1 1
0 0 .... 0 0 11 1 1 .... 1 1
1 1 .... 1 1 0
1 0 0 .... 0 0 0
i
i
i
t
w
s
Example
Why not use this approach to break carry chain for unsigned binary number?
Limitations of Table
1 1
1 01
1 01, 11
.
i i i
i i i
i
If w x y
and t x y
s has carry
0 1 1 1 1 1
1 0 0 1 0 1
1 1 1 1 1 1
1 1 1 0 1 0
* * * * 1 0 0
i
i
i
t
w
s
carries
Example (-9)10 + (29)10
Does not work if operands contain 1
SD Addition Table Choices
11
01
01
1 0
0
1
1
1
1000
1011
11
11
01
01
00
00
ix iy
i it w
i it w
1 1 0,1i ix or y
1 1 1i ix or y
Takagi, 1985
Modified Binary SD Addition Table
xi,yi
xi-1,yi-1 -neither is at least
one is neither is at least
one is - -
ti+1
wi
1101 11010100,11
1
0
0
0
0 0
1
1 1
1
1
0 11
01
1
11
1
Repeating Example with Modified Table
Example (-9)10 + (29)10
0 1 1 1 1 1
1 0 0 1 0 1
0 0 0 1 1 1
1 1 1 0 1 0
1 1 0 1 0 0
i
i
i
t
w
s
no carries
Two SD Encodings
x
Encoding 1
xh xl
Encoding 2
xh xl
0 00 00
1 01 01
1 10 11
4!=24 possible encodingsOnly nine are distinct under permutation and logical negation two’s complement
Encoding 1
Satisfies simple relation
x = xl - xh
and 11 has a valid numerical value of 0.
SD to two’s complement conversion performed by two’s complement subtraction
1 2 0
1 2 0
, , ,
, , ,
l l ln n
h h hn n
x x x
x x x
Encoding 2
Satisfies relation
xi = -2xih + xi
l
This means that xil and xi-1
h have the same weight
Also simplified addition table possible by regrouping bits
1 ˆ, ,l hi i ix and x can be regrouped to form x
Two’s Complement/BSD Conversion
Two’s Complement to SDBits can be encoded directly with MSB negative one
BSD to Two’s Complement
1
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
1 0 1 1
1 1 0 1
i i i iy c z c
12i i i iy c z c
One algorithm simpler than complete binary adder zi is two’s complement result c0 = 0
0 1 0 1 01 1 1 1 0 0
1 0 1 1 0
i
i
i
yc
z
Example -1010
Binary SD RepresentationsRepresentation of a value with the minimum number of non-zero digits – Important in multiplication and division since each zero eliminates an operation
8 4 2 1
0 1 0 1
1 0 1 1 .
0 1 1 1
1 1 0 1
1 1 1 1
Minimal SD representation of X = 5
X = 5, n = 4, r = 2