Is the Booth algorithm for multiplication only for multiplying two negative numbers such as \$-3 * -4\$ or can it also multiply one positive and one negative number such as \$-3 * 4\$? I believe that it's not for multiplying two positive numbers, whenever I multiply 2 positive numbers using booth algorithm i get a wrong result.
For example : \$5 * 4\$
A = 101 000 0 // binary of 5 is 101
S = 011 000 0 // 2's complement of 5 is 011
P = 000 100 0 // binary of 4 is 100
x = 3
y = 3
m = 5
-m = 2's complement of m
r = 4
After right shift of P by 1 bit 0 000 100
After right shift of P by 1 bit 0 000 010
P+S = 011 001 0
After right shift by 1 bit 0 011 001
Discarding the LSB 001100
But that comes out to be the binary of 12 . It should have been 20(010100)