Professional Documents
Culture Documents
Architecture
Presented by
Dr. Preetha K G
Department of Computer Science & Engineering
Rajagiri School of Engineering & Technology
Module 3
2
Introduction
3
Multiplication
• Repeated addition: add the multiplicand to itself
“multiplier” times.
• Repeated addition- Limitations
– Least sophisticated method
– Just use adder over and over again
– If the multiplier is n bits, can have as many as
– 2n iterations of addition -- O(2n)
– Not used in an ALU
4
Multiplication
• Shift and add -- traditional “pen and paper” way of
multiplying (extended to binary format)
5
Multiplication
• In the binary system, multiplication of the
multiplicand by 1 bit is easy. If the multiplier bit is 1,
the multiplicand is entered in the appropriate position
to be added in the partial product. If the multiplier is
zero then zeros are entered.
6
Multiplication
7
Array Multiplier
• Binary multiplication of positive operands can be
implemented in a combinational two dimensional
array
8
Array Multiplier
9
Sequential Binary Multiplier
10
Sequential Binary Multiplier
11
Sequential Binary Multiplier
• Example
12
Signed Multiplication- Booth’s Algorithm
13
Signed Multiplication- Booth’s Algorithm
Solution 1
• Convert to positive if required
• Multiply as above
• If signs of both operands were different, take the 2’s
complement of the result.
Solution 2
• Booth’s algorithm
14
Signed Multiplication- Booth’s Algorithm
Booth algorithm uses the following principle
Multiplication can be achieved by adding
appropriately shifted copies of the multiplicand
15
Signed Multiplication- Booth’s Algorithm
Example: M*(01111010)=M*(+1 0 0 0 -1 +1 -1 0)
• When moving from 0 to 1 then -1 is selected and
moving from 1 to 0 then +1 is selected as the
multiplier scanning from right to left. This
algorithm clearly extends to any number of blocks
of 1s in a multiplier, including the situation in
which a single 1 is considered as a block. If the first
bit is 1 then consider the previous bit is 0.
• Advantages of Booths algorithm
• Treats positive and negative numbers uniformly.
• String of 1’s and 0’s can be skipped with shift
operation for faster execution
16
Signed Multiplication- Booth’s Algorithm
• Booth recording table
Multiplier Multiplicand
0 0 0*M
0 1 +1*M
1 0 -1*M
1 1 0*M
• Example
7*3
7*-3
-7*3
-7*-3
17
Signed Multiplication- Booth’s Algorithm
18
Signed Multiplication- Booth’s Algorithm
19
Signed Multiplication- Booth’s Algorithm
20
Fast Multiplication-BIT –Pair recoding of multipliers
starting
i+1 fromi the right. i-1 selected at i
0 0 0 0*M
0 0 1 +1*M
0 1 0 +1*M
0 1 1 +2*M
1 0 0 -2*M
1 0 1 -1*M
1 1 0 -1*M
1 1 1 0*M
21
Fast Multiplication-BIT –Pair recoding of multipliers
22
Division
• Unsigned Division
23
Division
24
Division
Algorithm:
• Do the following n times
• Shift A & Q left one bit
• Subtract M from A and place the result back
to A.
• If the sign of A is 1 then set q0to 0 and add
M back to A, otherwise set q0 to 1.
25
Division
26
Division
• Example:1000/11
A= 000000, M=00011, Q=1000
A Q M=00011
00000 1000 Initial value
00001 000- Shift
11110 0000 Subtract/set q0
00001 Restore
00010 000- Shift
11111 0000 Subtract/set q0
00010 Restore
00100 000- Shift
00001 0001 Subtract/set q0
00010 001- Shift
11111 0010 Subtract/set q0
00010 Restore
27
28