Russian Multiplication Loop
I have got knowledge yesterday from my lecturer when i study algorithm …
It’s about Russian Multiplication ….
To multiply two numbers A and B … you can just write A*B …
For example 11 * 11 = 121 …
You can do it with Russian Multiplication Loop with rule like this :
You can make to column A and B and Total…
- Under A … just write result of floor(A/2) … do itt until floor(A/2) = 1
- Under B … just write result of B*2
- Under Total
- If floor (A/2) is even then Total = Total + B*2
- If floor (A/2) is odd then do nothing
Here is the example :
|
A |
B |
Description |
|
11 |
11 |
|
|
5 |
22 |
|
|
2 |
44 |
Not Added because odd |
|
1 |
88 |
|
|
Total |
11+22+88 = 121 |
|
The result is sama 11*11 = 121 …