In: Computer Science
I need this as soon as possible, please. It is due two hours and I need to check my answers.
Problem-1
Calculate the Product of the following using refined multiplication method (show all steps in table)
6 X 3
Problem-2
Calculate the Product of the following using Booth’s Multiplication Algorithm (show all steps in table)
Problem 1:- The flow chart of refined multiplication method is as follows:-
Using above algorithm, the multiplication is done as follows:-
Multiplicand = 6 =0110, Multiplier = 0011
Iteration | Step | Product |
---|---|---|
0 | initial values | 0000 0011 |
1 | Add multiplicand to left half of product | 0110 0011 |
Shift Product right | 0011 0001 | |
2 | Add multiplicand to left half of product | 1001 0001 |
Shift Product right | 0100 1000 | |
3 | Shift Product right | 0010 0100 |
4 | Shift Product right | 0001 0010 |
Since we iterate the loop 4 times (number of bits in multiplicand) therefore we stop the iteration, and hence get the result 00010010 which is decimal equivalent to 18 which is correct as 6*3 = 18.
Problem 2:- The flow chart of Booth's multiplication is as follows:-
Using above algorithm, the multiplication is done as follows:-
(a.) 5*(-4)
M = 5 = 0101, M'+1 = 1011
Q = -4 = 1100
Q0Q-1 | Operation | A | Q | Q-1 | Count |
---|---|---|---|---|---|
0000 | 1100 | 0 | 100 | ||
00 | ASHR A,Q,Q-1 | 0000 | 0110 | 0 | 011 |
00 | ASHR A,Q,Q-1 | 0000 | 0011 | 0 | 010 |
10 |
A = A-M ASHR A,Q,Q-1 |
1011 1101 |
1001 |
1 |
001 |
11 | ASHR A,Q,Q-1 | 1110 | 1100 | 1 | 000 |
Since the value of Count become 0, therefore the iteration will stop and we get the result R = AQ = 11101100 which is 2's complement of 00010100 that is 20, therefore R = -20 which is correct.
(b.) -3*(-6)
M = -3 = 1101, M'+1 = 0011
Q = -6 = 1010
Q0Q-1 | Operation | A | Q | Q-1 | Count |
---|---|---|---|---|---|
0000 | 1010 | 0 | 100 | ||
00 | ASHR A,Q,Q-1 | 0000 | 0101 | 0 | 011 |
10 |
A = A-M ASHR A,Q,Q-1 |
0011 0001 |
1010 |
1 |
010 |
01 |
A=A+M ASHR A,Q,Q-1 |
1110 1111 |
0101 |
0 |
001 |
10 |
A=A-M ASHR A,Q,Q-1 |
0010 0001 |
0010 |
1 |
000 |
Since the value of Count become 0, therefore the iteration will stop and we get the result R = AQ = 00010010 which is equivalent to 18, which is correct.