![]() |
VOOZH | about |
Boothโs algorithm is a method for multiplying signed binary numbers in twoโs complement representation. It improves efficiency by minimizing the number of required arithmetic operations.
Hardware Implementation of Booth's Algorithm
The hardware implementation of the booth algorithm requires the register configuration shown in the figure below: ๐ Image
We name the registers as AC, BR and QR, respectively. Qn designates the least significant bit of the multiplier in the register QR. An extra flip-flop Qn+1is appended to QR to facilitate a double inspection of the multiplier. The flowchart for the booth algorithm is shown below:
Initialize AC = 0, Qโโโ = 0, and set SC = n (number of bits in the multiplier).
Check the two least significant bits (Qโ and Qโโโ).
If (Qโ, Qโโโ) = 10, perform AC = AC โ BR (subtract multiplicand).
If (Qโ, Qโโโ) = 01, perform AC = AC + BR (add multiplicand).
If (Qโ, Qโโโ) = 00 or 11, no operation is performed (AC remains unchanged).
Perform an arithmetic right shift (ashr) on the combined register (AC, QR, Qโโโ), preserving the sign bit of AC.
Decrement the sequence counter (SC).
If SC โ 0, repeat the steps starting from checking (Qโ, Qโโโ).
After all iterations, the final product is obtained in the combined register (AC, QR).
Example - A numerical example of booth's algorithm is shown below for n = 4. It shows the step by step multiplication of -5 and -7.
Step-by-Step Execution:
Iteration 1:
Qโ Qโโโ = 10
Perform AC = AC โ BR = 0101
Arithmetic right shift of (AC, QR, Qโโโ):
AC = 0010, QR = 1100, Qโโโ = 1
SC = 3
Iteration 2:
Qโ Qโโโ = 01
Perform AC = AC + BR = 1101
Arithmetic right shift of (AC, QR, Qโโโ):
AC = 1110, QR = 1110, Qโโโ = 0
SC = 2
Iteration 3:
Qโ Qโโโ = 00
No operation
Arithmetic right shift of (AC, QR, Qโโโ):
AC = 1111, QR = 0111, Qโโโ = 0
SC = 1
Iteration 4:
Qโ Qโโโ = 10
Perform AC = AC โ BR โ AC = 0100
Arithmetic right shift of (AC, QR, Qโโโ):
AC = 0010, QR = 0011, Qโโโ = 1
SC = 0
Product is calculated as follows:
Product = AC QR
Product = 0010 0011 = 35
Basically, Corner's Calculation finds its application any place productive paired duplication is required, particularly in situations where speed, power proficiency, and equipment streamlining are significant elements.
Best Case and Worst Case : Best case is when there is a large block of consecutive 1's and 0's in the multipliers, so that there is minimum number of logical operations taking place, as in addition and subtraction. Worst case is when there are pairs of alternate 0's and 1's, either 01 or 10 in the multipliers, so that maximum number of additions and subtractions are required. GATE Practice Questions -