Results 1 to 2 of 2

Thread: Maths/binary question - Booth Algorithm

  1. #1

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Question

    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?
    Harry.

    "From one thing, know ten thousand things."

  2. #2

    Thread Starter
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Aha, I have found the reason for my problems: I'm meant to subtract from A


    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
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width