Booth algorithm (multiplication of signed numbers)

Source: Internet
Author: User
Tags arithmetic

Ask for M3m2m1m0xq3q2q1q0:0110x0101 (signed number is in complement, the highest bit is positive or negative)

1. Add auxiliary bit: a=0000 q-1=0

2. Control logic judgment:

①Q0Q-1=01: A=a+m then A, Q, Q-1 arithmetic right shift (two steps)

②q0q-1=10: A=a-m then A, Q, Q-1 arithmetic right shift (two steps)

Complement plus minus: (A-M) complement =a complement + (-m) complement

③q0q-1=00 or 11 o'clock: A, Q, Q-1 arithmetic right shift (one step)

Complement right shift: empty 1

3, q A few do several right-shift operations. (eg: 01000x011, do 3 right Shift end)

4, the result is AQ (0001 1110, that is, 6x5=30).

operation process and results
A Q Q-1 M
Initial 0000 0101 0 0110
①a-m 1010 0101 0 0110
A,q,q-1 Right Shift 1101 0010 1 0110
②a+m 0011 0010 1 0110
A,q,q-1 Right Shift 0001 1001 0 0110
③a-m 1011 1001 0 0110
A,q,q-1 Right Shift 1101 1100 1 0110
④a+m 0011 1100 1 0110
A,q,q-1 Right Shift 0001 1110 0 0110

Booth algorithm (multiplication of signed numbers)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.