Final answer:
To multiply signed 2's complement numbers using the Booth algorithm, calculate the complement of B, perform the multiplication, apply Booth's algorithm, and discard the final carry and sign extension bit. For example, A=-010111, B=-100100 results in (-1011010101) and A=-110101, B=-001010 results in (-101101100110).
Step-by-step explanation:
In order to multiply signed 2's complement numbers using the Booth algorithm, we follow these steps:
- Calculate the complement of B (B') by flipping the bits and adding 1.
- Perform the multiplication of A and B' using the standard binary multiplication method, keeping track of carry bits.
- Apply Booth's algorithm to adjust the result by adding or subtracting A based on the value of the previous bit.
- Discard the final carry (if any) and the sign extension bit, keeping only the desired number of bits for the product.
For example, for a) A=-010111 and B=-100100:
- B' = 011011 + 1 = 011100
- Perform the multiplication: (-010111) * (011100) = (-10000001100)
- Apply Booth's algorithm: (-10000001100) - (-010111) = (-01011010101)
- Discard the final carry and sign extension bit, keeping only 11 bits: (-1011010101)
For b) A=-110101 and B=-001010, the process is similar:
- B' = 110110 + 1 = 110111
- Perform the multiplication: (-110101) * (110111) = (-100100100011)
- Apply Booth's algorithm: (-100100100011) + (-110101) = (-110101100110)
- Discard the final carry and sign extension bit, keeping only 12 bits: (-101101100110)