You are on page 1of 6

23-03-2022

MULTIPLICATION
ALGORITHMS

ATHAK YADAV
ID: 202151033

SECTION - 1
 BOOTS ALGORITHM:
INTRODUCTION: In a nutshell, this algorithm multiplies two signed binary numbers in 2's
complement notation.

One thing to notice about this algorithm, is you never multiply while you compute your
desired result of multiplication, while in simple multiplication you take single digits of the
multiplier and multiply it with the multiplicand, Boots algorithm takes the help of arithmetic
shift and (+) operand which are way much faster than the multiplier (*) operand and
computes the desired result.

Taking an example of a 4-bit number = 15, wherein normal multiplication takes 15 steps
boots only takes only 4, which is a surprise because it is equal to the number of bits, so we
are given a 16-bit number we can compute the result in 16 steps whereas the traditional
multiplication method would take 65535 steps to compute the result, so in comparison to the
traditional method, it is very, very fast.

 How does this algorithm work?


Here Q is our multiplicand.
B = M is our multiplier.
A one-bit register Q- 1 is initialized to zero (0).
A register (A) just registers our values of M which is also initialized to zero (0).
here in this example:
Multiplier B = M is (2).
Multiplicand Q = (6).
 KARATSUBA MULTIPLICATION:
INTRODUCTION: The Karatsuba algorithm is a fast multiplication algorithm that uses a
divide and Conquer approach to multiply two numbers. Considering the native approach of
multiplication which has a run time of θ(n2) Karatsuba algorithm has a runtime of approximately,
Θ(n1.58) which is really efficient compared to the traditional system of multiplication, Karatsuba
algorithm works by breaking large numbers so that the multiplication that happen in the algorithm
only happen with the small numbers. The Karatsuba algorithm decreases the number of
subproblems from 4 to 3 and ends up calculating the product of a n-bit number with more time
efficiency than the regular method of multiplication.
One flaw of Karatsuba is when starting to compute the result by following the steps, first you
have to convert the multiplier and multiplicand into same number of digits, and it must be even.
Time efficiency: In comparison to our traditional model of multiplication Karatsuba is much more
efficient for ex, The Karatsuba algorithm requires 59,049 single digits multiplication but in case of
traditional multiplication it takes 1,048,576 single digits multiplication.

How it works:
Taking two no X and Y where they are represented in a manner.
X = Xh*Bm +Xl and Y = Yh*Bm +Yl
Here B = 10, m = number of digits.
for example. X = 12345678 and Y = 23456789 then,
Xh = 1234, Xl = 5678; Yh = 2345, Yl = 6789;
Steps to solve the algorithm,
Step 1: Xh* Yh store in S1
Step 2: Xl* Yl store in S2
Step 3: (Xh + Xl )*( Yh + Yl) store in S3
Step 4: S3 – S2 – S1 store in S4
Step 5: S1 * (Bm) + S4 * (Bm/2) +S2 store in S5
Step 5 is the result of our multiplication.

Complexity in comparison to the traditional method:


 RUSSIAN PEASANT METHOD:
INTRODUCTION:
Origin:
This multiplication algorithm is commonly known as the Russian peasant multiplication. It is said that
the algorithm is still used by peasants in some areas such as Russia. Thus giving it its name Russian
peasant method.
Russian peasant method allows us to find the multiplication of two numbers without using multiplication
tables, it is similar to the Egyptian multiplication. Suppose that you have to multiply two numbers (e.g.,
21 and 18). The basic operation for them was multiplying or dividing a number by 2.
Consider two numbers to multiply let 21 and 18.
The multiplication goes like:
21 18
10 36
5 72
2 144
1 288
The multiplication goes like taking the elements in the first column and dividing it by 2 until we get a
zero, and for the second column keep doubling the elements of the column the number of times it took
for you to get 1 in the first column.
Once you completed the process choose the rows with odd numbers in the first column then
corresponding to those numbers add the 2nd element of rows, in this case we have row 1, row 3, and
row 5, now add the corresponding second element of the row.
Answer = 18 + 72 + 288 = 378.
Although this algorithm involves multiplication and division, we can increase the efficiency by using
left shift (<<) and right shift (>>) operand to make the algorithm more efficient because, left shift
and right operands takes much less time as compared to multiplication.
 REFERENCES
BOOTS ALGORITHM:
https://www.sanfoundry.com/c-program-implement-booths-multiplication-algorithm-
multiplication-2-signed-numbers/

https://www.researchgate.net/figure/Flowchart-for-radix-4-booth-algorithm_fig3_341668858

https://youtu.be/vcvgvqnH7GA

KARATSUBA ALGORITHM:
https://www.codingninjas.com/codestudio/library/karatsuba-algorithm-for-fast-multiplication-of-
large-decimal-numbers-represented-as-strings

https://iq.opengenus.org/karatsuba-algorithm/

https://youtu.be/JCbZayFr9RE?list=TLPQMjUwMzIwMjL8sQkAwaiZ4w

https://youtu.be/cCKOl5li6YM?list=TLPQMjUwMzIwMjL8sQkAwaiZ4w

RUSSIAN PEASANT METHOD:


https://www.geeksforgeeks.org/russian-peasant-multiply-two-numbers-using-bitwise-operators/

https://www.cut-the-knot.org/Curriculum/Algebra/PeasantMultiplication.shtml

https://circles.math.ucla.edu/circles/lib/data/Handout-1902-1772.pdf

You might also like