HarryW
Dec 6th, 2000, 09:43 PM
Hi all.
I have been trying to get my head around the Booth Algorithm (http://ivs.cs.uni-magdeburg.de/EuK/Lehre/booth.html) and I'm having some trouble working figuring out how it works. In particular I am having trouble trying to work out one of the examples given on that site, and how they have done it:
M A Q Qprev
01001 00000 01110 0 Load
01001 00000 00111 0 Shift only
01001 11011 10011 1 Subtract and shift
01001 11101 11001 1 Shift only
01001 11110 11100 1 Shift only
01001 00011 11110 0 Add and shift
The bolded line is the one I am having difficulty with. How did they get to that line by doing a 'subtract and shift'?
When I subtract 01001 from 00111 I get a series of 1s depending on the size of the variable, ending in 10.
I suppose I must have understood it wrong, so could someone please explain this to me?
I have been trying to get my head around the Booth Algorithm (http://ivs.cs.uni-magdeburg.de/EuK/Lehre/booth.html) and I'm having some trouble working figuring out how it works. In particular I am having trouble trying to work out one of the examples given on that site, and how they have done it:
M A Q Qprev
01001 00000 01110 0 Load
01001 00000 00111 0 Shift only
01001 11011 10011 1 Subtract and shift
01001 11101 11001 1 Shift only
01001 11110 11100 1 Shift only
01001 00011 11110 0 Add and shift
The bolded line is the one I am having difficulty with. How did they get to that line by doing a 'subtract and shift'?
When I subtract 01001 from 00111 I get a series of 1s depending on the size of the variable, ending in 10.
I suppose I must have understood it wrong, so could someone please explain this to me?