m booth al
TRANSCRIPT
-
8/6/2019 M BOOTH AL
1/34
Multiplication
-
8/6/2019 M BOOTH AL
2/34
Multiplier Notation
Partial Products
Logical-AND
-
8/6/2019 M BOOTH AL
3/34
Shift and Add Paradigm
-
8/6/2019 M BOOTH AL
4/34
Shift and Add Examples
-
8/6/2019 M BOOTH AL
5/34
Programmed Multiplication
-
8/6/2019 M BOOTH AL
6/34
Programmed Multiplication (cont.)
-
8/6/2019 M BOOTH AL
7/34
Hardware Shift and Add (right)
-
8/6/2019 M BOOTH AL
8/34
Hardware Shift and Add
-
8/6/2019 M BOOTH AL
9/34
Hardware Shift and Add (left)
-
8/6/2019 M BOOTH AL
10/34
Signed Number Multiplication(positive case)
-
8/6/2019 M BOOTH AL
11/34
Signed Number Multiplication(negative case)
-
8/6/2019 M BOOTH AL
12/34
Booths Recoding (or encoding)
Developed for Speeding Up Multiplication in Early Computers
When a Partial Product of 0 Occurs, Can Skip Addition and
Just Shift
Doesnt Help Multipliers Where Datapaths Go ThroughAdder
Such as Previous Examples Does Help Designs for Asynchronous Implementation or
Microprogramming Since Shifting is Faster Than Addition
Variable Delay Depends on Number of Ones in
Booth Observed that a String of 1s May be Replaced as:
1 1 12 2 2 2 2 2j j i i j i
! L
-
8/6/2019 M BOOTH AL
13/34
Booths Recoding Example
xn
xn-1 ... xi xi-1 ... x0 (0)
yn
... yi ... y0
yi=xi-1 - xi
xi xi-1 peration omments yi
0 0 shi t only string o zeros 0
1 1 shi t only string o ones 0
1 0 subtract shi t beg. string o ones -1
0 1 addition shi t end string o ones 1
EXAMPLE
0011110011(0)
0100010101
-
8/6/2019 M BOOTH AL
14/34
Booths Recoding
Maps Words With Digit Set [0,1] to ThoseWith [-1,1]
-
8/6/2019 M BOOTH AL
15/34
Sequential Multiplication
A 1011 (-510)
X 1101 (-310)
Y 0111 (recoded)
(-1) Add A 0101
Shift
00101(+1) Add+A 1011
11011
Shift 111011
(-1) Add A 0101
001111Shift 0001111 (+1510)
-
8/6/2019 M BOOTH AL
16/34
Booth Multiplier Example
-
8/6/2019 M BOOTH AL
17/34
Booths Recoding Drawbacks
Number of add/sub Operations are Variable
Some Inefficiencies
EXAMPLE
001010101(0)011111111
Can Use Modified Booths Recoding to Prevent
W
ill Look at Th
is in Later Class
-
8/6/2019 M BOOTH AL
18/34
Sign Extension Consider 6-bit 2s Complement Number
s=0 Positive Value; s=1 NegativeValue
Show Sign Extension Works:
4 3 2 1 0
9 8 7 6 5 4 3 2 1 0
4 3 2 1 04
9 8 7 6 5
0
49 9 5
0
45
0
2 2 2 2 2 2 2 2 2 2
2 (2 2 2 2 ) 2
2 (2 2 ) 2
2 2
i
i
i
i
i
i
i
i
i
s s s s s p p p p p
s s s s s p p p p p
s s p
s s p
s p
!
!
!
!
!
!
!
Definition of 2s Complement
-
8/6/2019 M BOOTH AL
19/34
Sign Extension Example
A 010110 (+2210)
X 001011 (+1110)
Y 010101 (recoding)
11111101010 (neg. A)0000000000 (0 A)
111101010 (neg. A)
00000000 (0 A)
0010110 (neg. A)
000000 (0 A)
00011110010 (24210)
-
8/6/2019 M BOOTH AL
20/34
Sign Extension Example
1
001010 (neg. A)100000 (0 A)
001010 (neg. A)
100000 (0 A)
110110 (neg. A)
100000 (0 A)
00011110010 (24210)
Same Trick as Before, Complement Original Sign BitAdd 1 to Column 5
-
8/6/2019 M BOOTH AL
21/34
Methods for Fast Multiplication
Reduce Number of Partial Products to be Added
Group MultiplierBits Together
Higher Radix Multiplier
Add the Partial Products Faster
-
8/6/2019 M BOOTH AL
22/34
Radix-rShift and Add
-
8/6/2019 M BOOTH AL
23/34
Radix-4 Multiplication
Shifter is Multi-bit
No Longer a Simple AND ofxi witha
Need 4:1 MUX wit
h0,a
, 2a
, 3a
as Inputs
-
8/6/2019 M BOOTH AL
24/34
Partial Product Selection
0, a and 2a are easy
3a=a+2ap Requies an Adder!
Need a Way to Compute 3a Efficiently
-
8/6/2019 M BOOTH AL
25/34
Example With 3aAvailability
-
8/6/2019 M BOOTH AL
26/34
Computing 3a
One Way is to Precompute 3a and Store in Register Initially
AnotherWay is When 3a Occurs Add -a
Send Carry of 1 to Next into Next Radix-4 Digit of Multiplier
Causes Incoming Multiple to be [0,4] Versus [0,3]
4 Because incoming carry to 112 Causes Digit 1002
Multiples 0, 1, 2 Handled Easily
Multiple 3 Converted to 1 With Outgoing Carry of 1
Multiple 4 Converted to 0 With Outgoing Carry of 1
Requires Extra Cycle of Computation Since MSD May Have Carry
-
8/6/2019 M BOOTH AL
27/34
Example With 3aAvailability
-
8/6/2019 M BOOTH AL
28/34
Using Radices >4
Could Also Use Radices of 8, 16, ...
Bit Groupings of Size 3, 4, ...
Multiple Generation Hardware Becomes More Complex
Must Precompute 3a, 5a, 7a, ....
Or Use 3aWith a Carry Scheme
Carry Scheme Converts Multipliers 5a, 6a, 7a
to 3a, -2a, -a, etc.
Carry Digit in This Form Becomes a 1
-
8/6/2019 M BOOTH AL
29/34
Booth Recoding
Modern Arit
hmetic Circuits
DO NOTApply
Booth Recoding Directly
Useful in Understanding Higher-radixVersions of
Booth RecodingNo Consecutive 1s or 1s Occur Using Previously Seen
Booth Recoding
Booth Recoding in Radix-4 Results in the Following: Only Multiples ofsa ors2a are Required
These are Easily Obtained Using Shifting and Complementation
-
8/6/2019 M BOOTH AL
30/34
Modified Booth Recoding
Booth Recoding Results From xi and xi-1
Radix-4 Multiplier Digits Implies Booth Recoding
Based on xi+1, xi and xi-1
Similar to Classical
Boot
hRecoding, Modified
Boot
h
Recoding Encodes Multipliers into [-2,2]
-
8/6/2019 M BOOTH AL
31/34
Modified Booth Recoding
-
8/6/2019 M BOOTH AL
32/34
Example Modified Booth Recoding
-
8/6/2019 M BOOTH AL
33/34
Example Multiplication with MBR
-
8/6/2019 M BOOTH AL
34/34
Hardware MBR Example