Professional Documents
Culture Documents
Hamcher Chapter 6
yn 1
y1
y0
Add/Sub
control
xn 1
x1
x0
nbitadder
cn
sn
Figure6.3.
s1
c0
s0
Binaryadditionsubtractionlogicnetwork.
RegisterA(initially0)
Shiftright
an
a0
qn
q0
MultiplierQ
Add/Noadd
control
nbit
adder
Control
sequencer
MUX
0
mn
0
m0
MultiplicandM
(a)Registerconfiguration
M
1101
0
C
0
0
0000
A
1101
0110
1011
Q
1011
1101
1
0
0011
1001
0
0
1
0
Initialconfiguration
Add
Shift
Firstcycle
1101
1110
Add
Shift
Secondcycle
1001
0100
1110
1111
Noadd
Shift
Thirdcycle
0001
1000
1111
1111
Add
Shift
Fourthcycle
Product
(b)Multiplicationexample
Figure6.7.Sequentialcircuitbinarymultiplier.
0
0
1 0 1 1 0
0 +1 +1 + 1 +1
1
0
0
0
1
1
0
0
1
0
1
0
1
0
1
1
0
1
1
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0 1
0 +1
0
0
1
0
1 0
0 1
1
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
2'scomplementof
themultiplicand
Figure6.9.NormalandBoothmultiplicationschemes .
0 +1 1 +1
0 1
0 +1
0 1 +1 1 + 1
Figure6.10.Boothrecodingofamultiplier.
0 1
0 1 1 0 1
1 1 0 1 0
( + 13)
6
0 1 1 0 1
0 1 +1 1 0
0
1
0
1
0
0
1
0
1
0
0
1
0
1
0
0
1
0
0
0
0
1
1
0
0
0
0
1
1
0
0 0 0 0
0 1 1
0 1
1
1 1 1 0 1 1 0 0 1 0
Figure6.11.Boothmultiplicationwithanegativemultiplier.
78
Multiplier
Biti
Biti 1
Versionofmultiplicand
selectedbybit i
0M
+1M
1M
0M
Figure6.12.Boothmultiplierrecodingtable.
Worstcase
multiplier
+1 1 +1 1 +1 1 +1 1 +1 1 +1 1 +1 1 +1 1
Ordinary
multiplier
0 1 0
0 +1 1 +1
0 1 +1
0 1
0 +1
0 1
0 +1
0 1
Good
multiplier
Figure6.13.Boothrecodedmultipliers.
Signextension
+1
Implied0torightofLSB
(a)ExampleofbitpairrecodingderivedfromBoothrecoding
Multiplierbitpair
i + 1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
Multiplierbitontheright
i 1
0
1
0
1
0
1
0
1
(b)Tableofmultiplicandselectiondecisions
Figure6.14Multiplierbitpairrecoding.
Multiplicand
selectedatposition
+
+
+
0
1
1
2
2
1
1
0
M
M
M
M
M
M
M
M
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
0
0
0
0
1
1
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
0 1 1 0
0 1 +1 1
0 0 0 0
0 0 1 1
1 0 1
1 1
0
1 0 0 1
1
0
0
1
0
0
1
0
0
0
0
0
1
1
1
0 1
1 1
( + 13 )
6
78
1
2
1 0
0
Figure6.15.Multiplicationrequiringonlyn/2summands.
DIVISION
13
21
274
26
10101
1101 100010010
1101
14
13
1
10000
1101
1110
1101
1
Figure6.20.Longhanddivisionexamples.
Shiftleft
an
an 1
a0
q n 1
q0
DividendQ
Quotient
setting
Add/Subtract
n +1bit
adder
Control
sequencer
mn 1
m0
DivisorM
Figure6.21.Circuitarrangementforbinarydivision.
11
10
1000
11
10
Initially
Shift
Subtract
Set q 0
Restore
Shift
Subtract
Set q 0
Restore
Shift
Subtract
Set q 0
Shift
Subtract
Set q 0
Restore
0
0
0
1
1
0
0
0
1
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
0
1
1
0
0
1
1
0
1
1
0
1
1
0
1
0
0
1
1
0
1
0
1
1
1
0
0
0
0
1
1
1
0
1
1
0
1
1
1
0
0
1
1
0
0
0
0
0
0
1
0
1
1
1
0
1
1
1
0
0
0
Remainder
0
Firstcycle
0
Secondcycle
0
0
0
0
0
0
0
Thirdcycle
0
0
0
1
1
Fourthcycle
Quotient
Figure6.22.Arestoringdivisionexample.
Initially
0
0
0
1
1
0
0
0
1
1
0
1
0
0
1
0
1
1
1
0
Shift
Subtract
Set q 0
0
0
0
1
1
Shift
Add
Set q 0
1
0
1
1
0
1
1
0
1
0
1
1
0
1
1
Shift
Add
Set q 0
1
0
0
1
0
0
1
0
0
1
1
0
0
1
1
Shift
Subtract
Set q 0
0
1
1
0
1
1
0
1
1
1
0
1
0
1
1
0
Firstcycle
0
Secondcycle
Thirdcycle
Fourthcycle
Quotient
Add
1
0
0
1
0
0
1
0
0
1
1
1
1
1
0
Remainder
Figure6.23.Anonrestoringdivisionexample.
Restoreremainder
NTK 2009
3.5.
Multiplication
NTK 2009
Multiplicand (+8)
Multiplier
(+9)
Product
(+72)
NTK 2009
Multiplication algorithm
NTK 2009
NTK 2009
Multiplication
Complex
Work out partial product for each
digit
Take care with place value (column)
Add partial products
Execution of Example
Multiplying Negative
Numbers
This does not work!
Solution 1
Convert to positive if required
Multiply as above
If signs were different, negate answer
Solution 2
Booths algorithm
Booths Algorithm
Example of Booths
Algorithm
3*7
First setup the columns and initial
values.
Example of Booths
Algorithm
First cycle: Now look at Q and Q
-1
Example of Booths
Algorithm
nd
2 cycle Result
Example of Booths
Algorithm
Example of Booths
Algorithm
4nd cycle Result
5th
Example of Booths
Algorithm
cycle Result
Example of Booths
Algorithm
Division
More complex than multiplication
Negative numbers are really bad!
Based on long division
Quotient
Dividend
Remainder