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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Modular Multiplication
- Multiplication with a power of 2
- Calculate 7n/8 without using division and multiplication operators
- Multiplication of two numbers with shift operator
- Sum of multiplication of triplet of divisors of a number
- How to avoid overflow in modular multiplication?
- Check for integer overflow on multiplication
- Right most non-zero digit in multiplication of array elements
- Count divisors of array multiplication
- Multiplication of two complex numbers given as strings
- Multiply a number with 10 without using multiplication operator
- Program to print multiplication table of a number
- Exponential Squaring (Fast Modulo Multiplication)
- Fast Fourier Transformation for poynomial multiplication
- Multiplying a variable with a constant without using multiplication operator
- Divide two integers without using multiplication, division and mod operator
- Multiplication on Array : Range update query in O(1)
- Write you own Power without using multiplication(*) and division(/) operators
- Product of Complex Numbers using three Multiplication Operation
- Minimum steps to convert X to Y by repeated division and multiplication
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.