written 7.8 years ago by | • modified 2.9 years ago |
Mumbai University > Information Technology> sem 4> computer organization and architecture
Marks: 5M
Year: May16
written 7.8 years ago by | • modified 2.9 years ago |
Mumbai University > Information Technology> sem 4> computer organization and architecture
Marks: 5M
Year: May16
written 7.8 years ago by |
Shift-and-add multiplication is similar to the multiplication performed by paper and pencil. This method adds the multiplicand X to itself Y times, where Y denotes the multiplier. To multiply two numbers by paper and pencil, the algorithm is to take the digits of the multiplier one at a time from right to left, multiplying the multiplicand by a single digit of the multiplier and placing the intermediate product in the appropriate positions to the left of the earlier results.
As an example, consider the multiplication of two unsigned 4-bit numbers, 8 (1000) and 9 (1001).
In the case of binary multiplication, since the digits are 0 and 1, each step of the multiplication is simple. If the multiplier digit is 1, a copy of the multiplicand (1 × multiplicand) is placed in the proper positions; if the multiplier digit is 0, a number of 0 digits (0 × multiplicand) are placed in the proper positions.
Example Perform the multiplication 9 × 12 (1001 × 1100) using the final version of the multiplication algorithm. Answer Table shows the revised multiplication example for the final version of the algorithm.
Step | A | Q | B | Operation |
---|---|---|---|---|
0 | 0000 | 1100 | 1001 | Initialization |
1 | 0000 | 0011 | 1001 | Shift right A_Q |
2 | 0000 | 0011 | 1001 | Shift right A_Q |
3 | 1001 | 0011 | 1001 | Add B to A |
0100 | 1001 | 1001 | Shift right A_Q | |
4 | 1101 | 1001 | 1001 | Add B to A |
0110 | 1100 | 1001 | Shift right A_Q |