The two numbers given below are multiplied using the Booth’s alg...
Apply Booth’s algorithm:
4 additions and 4 substractions total 8 operations.
View all questions of this test
The two numbers given below are multiplied using the Booth’s alg...
Algorithm:
-5 (in 2's complement) x 3 (in 2's complement)
Step 1: Initialize the A, Q, and M registers
A = 0000 0101 (5 in 2's complement)
Q = 1111 1011 (-5 in 2's complement)
M = 0000 0011 (3 in 2's complement)
Step 2: Perform the first iteration of the Booth algorithm
The rightmost bits of Q and A are checked. If they are both 0 or both 1, A is shifted right and the process is repeated. If they are different, either A is added to M or M is subtracted from A depending on whether the rightmost bit of Q is 1 or 0. In this case, the rightmost bits of Q and A are both 1, so A is shifted right.
A = 0000 0010 (2 in 2's complement)
Q = 1111 1101 (-3 in 2's complement)
Step 3: Perform the second iteration of the Booth algorithm
The rightmost bits of Q and A are both 1, so A is shifted right again.
A = 0000 0001 (1 in 2's complement)
Q = 1111 1110 (-2 in 2's complement)
Step 4: Perform the third and final iteration of the Booth algorithm
The rightmost bits of Q and A are different, so A is either added to M or M is subtracted from A depending on whether the rightmost bit of Q is 1 or 0. In this case, the rightmost bit of Q is 0, so A is added to M.
A = 0000 0010 (2 in 2's complement)
Q = 1111 1110 (-2 in 2's complement)
M = 0000 0011 (3 in 2's complement)
Step 5: Result
The result is obtained by concatenating A and Q, giving:
0000 0010 1111 1110
This is equivalent to -15 in 2's complement notation, which is the correct answer for -5 x 3.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).