Question: You are to write a commented MIPS (Assembly) code in QtSpim that multiplies two signed integers using Booth's Algorithm. The input variables (let us call
"You are to write a commented MIPS (Assembly) code in QtSpim that multiplies two signed integers using Booth's Algorithm. The input variables (let us call them A and B) are two integers (which are 32-bit two's complement integers). These integers will represent numbers in the range from -32768 to +32767; this range requires only 16 bits. This restriction on the range of values means that the loop in your implementation of Booth's algorithm should iterate 16 times.
Since A and B are both 16 bit integers, the product will always fit in a single 32-bit register. Your MIPS code must compute the product (let us call it C) using Booth's algorithm. This computation will require some bit manipulation and shifting operations. In your program use temporary registers ($t0 to $t9) or saved temporary ($s0 to $s7) to avoid any conflicts.
Your program will:
1) get the values for A and B from the user (using the console)
2) multiply A and B to obtain C (C = A * B) USING BOOTH'S ALGORITHM
3) keep track of the number of additions (this number includes the add and subtract)
4) display in the console the value of C and the number of additions"
Thanks!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
