Professional Documents
Culture Documents
Lecture8 PDF
Lecture8 PDF
ALU
Shift P
Computer Architecture & Arithmetic Group 1 Stanford University Computer Architecture & Arithmetic Group 2 Stanford University
X
Data
R
Parallel generation of partial products Y
X7 X6 X5 X4 X3 X2 X1 X0
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
Using AND gate as 1x1-bit multiplier DOT representation x
.. ... .. .
X3 X2 X1 X0 * Y3 Y2 Y1 Y0
X2 X1 X0 X2 X1 X0
x Y2 Y1 Y0 x Y2 Y1 Y0 X7 X6 X5 X4* Y3 Y2 Y1 Y0
R5 R4 R3
X2Y0 X1Y0 X0Y0
X2Y1 X1Y1 X0Y1
X2Y2 X1Y2 X0Y2
R2 R1 R0
.
.. . . ..
X3 X2 X1 X0 * Y7 Y6 Y5 Y4
X7 X6 X5 X4 * Y7 Y6 Y5 Y4
Computer Architecture & Arithmetic Group 3 Stanford University Computer Architecture & Arithmetic Group 4 Stanford University
Computer Architecture & Arithmetic Group 5 Stanford University Computer Architecture & Arithmetic Group 6 Stanford University
M.J. Flynn 1
Lecture 7 EE 486
Computer Architecture & Arithmetic Group 7 Stanford University Computer Architecture & Arithmetic Group 8 Stanford University
Computer Architecture & Arithmetic Group 9 Stanford University Computer Architecture & Arithmetic Group 10 Stanford University
Computer Architecture & Arithmetic Group 11 Stanford University Computer Architecture & Arithmetic Group 12 Stanford University
M.J. Flynn 2
Lecture 7 EE 486
• The multiplicand may be represented in 2’s complement code. • Booth 3 Encoding Scale Scale
Yi+2 Yi+1 Yi Yi-1 Factor Yi+2 Yi+1 Yi Yi-1 Factor
• The scale factors (0, +X, +2X, -X, and -2X) are handled correctly. 0 0 0 0 +0 1 0 0 0 -4X
• Shift left for 2 times weighting. 0 0 0 1 +X 1 0 0 1 -3X
Note: 3x is a hard 0 0 1 0 +X 1 0 1 0 -3X
•2’s complement the multiplicand for subtraction. multiple that must 0 0 1 1 +2X 1 0 1 1 -2X
0 1 0 0 +2X 1 1 0 0 -2X
be precomputed 0 1 0 1 +3X 1 1 0 1 -X
0 1 1 0 +3X 1 1 1 0 -X
0 1 1 1 +4X 1 1 1 1 -0
Computer Architecture & Arithmetic Group 13 Stanford University Computer Architecture & Arithmetic Group 14 Stanford University
Computer Architecture & Arithmetic Group 15 Stanford University Computer Architecture & Arithmetic Group 16 Stanford University
M.J. Flynn 3