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.
- Multiply two integers without using multiplication, division and bitwise operators, and no loops
- Write you own Power without using multiplication(*) and division(/) operators
- How to avoid overflow in modular multiplication?
- Count divisors of array multiplication
- Program to print multiplication table of a number
- Exponential Squaring (Fast Modulo Multiplication)
- Check for integer overflow on multiplication
- Fast Fourier Transformation for poynomial multiplication
- Multiplication of two complex numbers given as strings
- Divide two integers without using multiplication, division and mod operator | Set2
- Sum of multiplication of triplet of divisors of a number
- Right most non-zero digit in multiplication of array elements
- Multiplication on Array : Range update query in O(1)
- Multiplication table till N rows where every Kth row is table of K upto Kth term
- Recursive Program to print multiplication table of a number
- Find minimum number K such that sum of array after multiplication by K exceed S
- Modular Multiplication
- Minimum steps to convert X to Y by repeated division and multiplication
- Product of Complex Numbers using three Multiplication Operation
- Smallest string without any multiplication sign that represents the product of two given numbers
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.