-
Hi all.
I have been trying to get my head around the Booth Algorithm 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:
Code:
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?
-
Aha, I have found the reason for my problems: I'm meant to subtract from A :rolleyes:
I still have to implement this in microcode though, if you know what that is. Basically it's what ASM's programmed in. Take a look if you think you might be able to help, or if you're just interested: http://forums.vb-world.net/showthrea...threadid=43228