Booth’s algorithm is a multiplication algorithm that multiplies two signed binary numbers in 2’s compliment notation.
Booth used desk calculators that were faster at shifting than adding and created the algorithm to increase their speed. Booth’s algorithm is of interest in the study of computer architecture. Here’s the implememtation of the algorithm.
Input : 0110, 0010 Output : qn q[n+1] AC QR sc(step count) initial 0000 0010 4 0 0 rightShift 0000 0001 3 1 0 A = A - BR 1010 rightShift 1101 0000 2 0 1 A = A + BR 0011 rightShift 0001 1000 1 0 0 rightShift 0000 1100 0 Result=1100
Put multiplicand in BR and multiplier in QR
and then the algorithm works as per the following conditions :
1. If Qn and Qn+1 are same i.e. 00 or 11 perform arithematic shift by 1 bit.
2. If Qn Qn+1 = 10 do A= A + BR and perform arithematic shift by 1 bit.
3. If Qn Qn+1 = 01 do A= A – BR and perform arithematic shift by 1 bit.
qn q[n + 1] BR AC QR sc initial 0000 1010 4 0 0 rightShift 0000 0101 3 1 0 A = A - BR 1010 rightShift 1101 0010 2 0 1 A = A + BR 0011 rightShift 0001 1001 1 1 0 A = A - BR 1011 rightShift 1101 1100 0 Result = 1100
- Multiplication with a power of 2
- Calculate 7n/8 without using division and multiplication operators
- How to avoid overflow in modular multiplication?
- Multiplication of two numbers with shift operator
- Multiply a number with 10 without using multiplication operator
- Right most non-zero digit in multiplication of array elements
- Sum of multiplication of triplet of divisors of a number
- Check for integer overflow on multiplication
- Count divisors of array multiplication
- Multiplication of two complex numbers given as strings
- Multiplication on Array : Range update query in O(1)
- Fast Fourier Transformation for poynomial multiplication
- Divide two integers without using multiplication, division and mod operator
- Multiplying a variable with a constant without using multiplication operator
- Write you own Power without using multiplication(*) and division(/) operators
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.