2023 24 2b

Computer Organization and Architecture2023-247 marksNumericalMultiplication

Show the multiplication process using Booth's algorithm when the following numbers are multiplied: (-12) * (-18).

Show the multiplication process using Booth's algorithm when the following numbers are multiplied: (-12) * (-18).

We use 6-bit registers, because $-18$ needs 6 bits in 2's complement. The numbers are:

$$M = -12 = 110100 \qquad -M = +12 = 001100 \qquad Q = -18 = 101110$$

$A$ and $Q_{-1}$ start at 0. In each cycle we read the pair $Q_0Q_{-1}$. The pair $10$ means $A = A - M$. The pair $01$ means $A = A + M$. The pairs $00$ and $11$ mean no operation. Then $A$, $Q$ and $Q_{-1}$ shift one place right with the sign bit of $A$ copied (arithmetic shift right, ASR). There are 6 cycles.

CycleQ0 Q-1OperationAQQ-1
Start-initial0000001011100
10 0no change, ASR0000000101110
21 0A = A - M, ASR0001100010111
31 1no change, ASR0000110001011
41 1no change, ASR0000011000101
50 1A = A + M, ASR1110101100010
61 0A = A - M, ASR0000110110001

The product is in $AQ$ joined:

$$AQ = 000011011000$$

The leading bit is 0, so the product is positive. Its value is:

$$2^7 + 2^6 + 2^4 + 2^3 = 128 + 64 + 16 + 8 = 216$$

Therefore $(-12) \times (-18) = +216$.

Check: $12 \times 18 = 216$, and two negative numbers give a positive product, so the answer is correct. Booth's algorithm gave the correct sign without any separate sign handling, because it works on 2's complement numbers directly. Cycles 1, 3 and 4 needed no addition or subtraction, so the multiplier $101110$ was handled with only three arithmetic operations instead of four.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.

Up nextWhat is pipelining? What are the different stages of pipelining? Explain in detail.