Question
Instructions Write a MIPS32 program to simulate the multiplication of two integer values by using repeated addition, implemented recursively . Specifically, implement this relationship: Multiplicand
Instructions
Write a MIPS32 program to simulate the multiplication of two integer values by using repeated addition, implemented recursively. Specifically, implement this relationship:
Multiplicand Multiplier = Multiplicand + ((Multiplicand -1) Multiplier)
where Multiplicand 1 = Multiplicand
Your program should prompt for and accept the numbers, and display the result, similar to the following:
Enter the multiplicand: 7
Enter the multiplier: 9
7 * 9 = 63
Implement your recursive function as a MIPS32 subroutine that conforming to this:
Inputs:
$a0 : multiplicand
$a1 : multiplier
Outputs:
$v0 : product
You may assume that the final product will fit within a 32-bit value
Be sure to save & restore the necessary registers to/from the stack appropriately.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started