Booth's Algorithm (Ques Included in This)
Booth's Algorithm (Ques Included in This)
Introduction
Multiplication was generally implemented via a sequence of addition, subtraction, and shift
operations. Multiplication can be considered as a series of repeated additions. The number to
be added is the multiplicand, the number of times that it is added is the multiplier, and the
result is the product. Each step of addition generates a partial product. In most computers, the
operand usually contains the same number of bits. When the operands are interpreted as
integers, the product is generally twice the length of operands in order to preserve the
information content. This repeated addition method that is suggested by the arithmetic
definition is slow that it is almost always replaced by an algorithm that makes use of
positional representation. It is possible to decompose multipliers into two parts. The first part
is dedicated to the generation of partial products, and the second one collects and adds them.
The basic multiplication principle is twofold i.e. evaluation of partial products and
accumulation of the shifted partial products. It is performed by the successive additions
of the columns of the shifted partial product matrix. The ‘multiplier’ is successfully
shifted and gates the appropriate bit of the ‘multiplicand’. The delayed, gated instance of
the multiplicand must all be in the same column of the shifted partial product matrix. They are
then added to form the product bit for the particular form.
Booth’s algorithm
Booth's algorithm is a multiplication algorithm that multiplies two signed binary numbers
in two's complement notation. The algorithm was invented by Andrew Donald Booth in 1950
while doing research on crystallography at Birkbeck College in Bloomsbury, London. Booth
used desk calculators that were faster at shifting than adding and created the algorithm to
increase their speed. Booth's algorithm is faster than the normal Multiplication Algorithm by
using a shifting operation instead of addition operation. Booth's algorithm is a multiplication
algorithm which worked for two's complement numbers. It is similar to our paper-pencil
method, except that it looks for the current as well as previous bit in order to decided what to
do. Booth's algorithm is of interest in the study of computer architecture. It is widely used in
the implementations of hardware or software multipliers because its application makes it
possible to reduce the number of partial products. It can be used for both sign magnitude
numbers as well as 2’s complement numbers.
1
In Booth's algorithm, if the multiplicand and multiplier are n-bit two's complement numbers,
the result is considered as 2n-bit two's complement value. The overflow bit (outside 2n bits)
is ignored.
Booth's algorithm is a multiplication algorithm which worked for two's complement numbers.
Booth invented this approach in a quest for speed because in machines of his era shifting was
faster than addition.
Process
Booth’s algorithm changes the first step of the algorithm—looking at LSB bit of the multiplier
and booth bit. The new first step, then, has four cases, depending on the values of the 2 bits.
Let’s assume that the pair of bits examined consists of the current bit (xi) and the bit to the
right (xi-1) —which was the current bit in the previous step. With this we will have four cases
00, 11, 10 and 01 as shown in the table below. The second step is still to shift the product
right. The following are rules.
In Booth's algorithm, if the multiplicand and multiplier are n-bit two's complement numbers,
the result is considered as 2n-bit two's complement value. The overflow bit (outside 2n bits)
is ignored.
The hardware consists of 32-bit register M for the multiplicand, 64-bit product register P, and
a 1-bit register C, 32-bit ALU and control. Initially, M contains multiplicand, P contains
multiplier (the upper half Ph = 0), and C contains bit 0. The algorithm is the following steps.
Repeat 32 times:
2
Logical shift vs. arithmetic shift
The above mentioned shift is arithmetic shift. We have learned the logical shift. For example,
shift right logical (srl) 0100 ... 111 -> 00100 ... 11
1100 ... 111 -> 01100 ... 11
shift right arithmetic (sra) 0100 ... 111 -> 00100 ... 11
1100 ... 111 -> 11100 ... 11.
Multiplicand, 5 = 0101
Multiplier (Q), -3 = 1101
Now to find the two's compliment of our Multiplicand value so that we can do subtraction of
multiplicand from A. We do this by keeping all 0's up until, and including, the first 1 the
same. We then flip all the remaining bits. So two's compliment of 0101 becomes 1011.
The next step is to set registers, which we name as Multiplicand, A, Q and C. where A is
accumulator, Q is multiplier and C is booth bit. A and C are initially set to be zero. A and Q
going to be the registers where we get our product result after the working of the problem.
Multiplicand A Q C
0101 0000 1101 0
The next step is to look at the LSB of Q multiplier and the number in the C register which is
called booth bit. If the LSB of Q is one, and C is zero, we subtract multiplicand from A. If
LSB of Q is zero, C is 1, and then we add multiplicand to A. If both LSB of Q and C are
equal, you do nothing and skip to the shifting stage. In our case, the LSB of Q is one, and C is
zero, so we subtract multiplicand from A. We then do an arithmetic right shift on A and Q,
and also copying the LSB of Q into C. This gives the table:
Multiplicand A Q C
0101 0000 1101 0
+ 1011
1011 1101 0
3
We then go through the process again using the same rules. This time we see that the LSB of
Q is 0 and C is 1. We must now add multiplicand to A. Once added, we then do an arithmetic
right shift on A and Q, with copying the LSB of Q into C. This gives the table:
Multiplicand A Q C
0101 0000 1101 0
+1011
1011 1101 0
Again, we repeat the process again. This time LSB of Q is 1 and C is zero. So like we did on
the first pass, we subtract multiplicand from A. We then do an arithmetic right shift on A and
Q, and also copy the LSB of Q into C. This gives the table:
Multiplicand A Q C
0101 0000 1101 0
+ 1011
1011 1101 0
Now on the fourth and final pass, we see that the LSB of Q is 1 and so is C. This makes it
easier for us because now we don't have to add the numbers. We only have to do an
arithmetic right shift on A and Q, and copy the LSB of Q into C. This gives the table:
Multiplicand A Q C
0101 0000 1101 0
+ 1011
1011 1101 0
4
0101 1101 1110 1
+0101
0101 0010 1110 1
And we are finished. The answer is contained in A and Q registers. In this case the answer is
1111 0001 which is -15 in 2’s complement notation. This is of course the correct answer.
Now that we have seen Booth’s algorithm work, we are ready to see why it works for two’s
complement signed integers. Let a be the multiplier and b be the multiplicand and we use ai
to refer to bit i of a. Recasting Booth’s algorithm in terms of the bit values of the multiplier
yields this table: [2]
ai ai-1 Operation
0 0 Do nothing
0 1 Add b
1 0 Subtract b
1 1 Do nothing
(ai-1 – ai)
0: do nothing
+1: add b
–1: subtract b
Since we know that shifting of the multiplicand left with respect to the Product register can
be considered multiplying by a power of 2, Booth’s algorithm can be written as the sum
(a-1 – a0) × b × 20
+ (a0 – a1) × b × 21
+ (a1 – a2) × b × 22
5
.... ....
b x ( (a31 x -231) + (a30 x 230) + (a29 x 229) + . . . + (a1 x 21) + (a0 x 20) )
The long formula in parentheses to the right of the first multiply operation is simply the two’s
complement representation of a. Thus, the sum is further simplified to
bxa
Hence, Booth’s algorithm does in fact perform two’s complement multiplication of a and b.
Example: Multiply 14 times -5 using 5-bit numbers (i.e 10-bit result). [3]
14 in binary: 01110
-5 in binary: 11011
6
-14 in binary: 10010 (so we can add when we need to subtract the multiplicand)
2. Show that booth’s algorithm holds good for 2’s complement method. How it is
different from normal multiplication method?
Ans : Refer page no 5