Livoa LogoLivoa
Start
Load the multiplicand into register M.
Load the multiplier into register Q.
Clear the accumulator A (set A = 0).
Initialize the extra bit Q₋₁ = 0.
Set the counter n to the number of bits (e.g., n = 4).
Repeat until the counter becomes zero:


a. Check the last two bits (Q₀, Q₋₁):

  i. If (Q₀, Q₋₁) = 01, then A ← A + M

  ii. If (Q₀, Q₋₁) = 10, then A ← A − M

  iii. Else, do nothing

b. Perform arithmetic right shift on (A, Q, Q₋₁)

c. Decrement the counter (n ← n − 1)

End loop
Result: The final product is the combined content of A and Q
START
A ← 0, Q₋₁ ← 0


M ← Multiplicand

Q ← Multiplier

Count ← n

Check Q₀, Q₋₁
If (Q₀, Q₋₁) = 10


A ← A − M

If (Q₀, Q₋₁) = 01


A ← A + M

Arithmetic shift right:


A, Q, Q₋₁

Count ← Count − 1

Count = 0?
END

jj

by kk

0
0 uses