booth multiplication algorithm
Posted
by
grassPro
on Programmers
See other posts from Programmers
or by grassPro
Published on 2011-11-19T03:46:03Z
Indexed on
2011/11/19
10:15 UTC
Read the original article
Hit count: 236
Is booth algorithm for multiplication only for multiplying 2 negative numbers (-3 * -4)
or one positive and one negative number (-3 * 4)
? Whenever i multiply 2 positive numbers using booth algorithm i get a wrong result.
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)
© Programmers or respective owner