Question: Write and test a MIPS function to do single-precision floating-point multiplication using only integer instructions. The function fmul should receive its parameters in $a0

Write and test a MIPS function to do single-precision floating-point multiplication using only integer

Write and test a MIPS function to do single-precision floating-point multiplication using only integer instructions. The function fmul should receive its parameters in $a0 and $a1 (as single-precision floating-point numbers) and produce its result in $v0 (as single-precision float). You cannot use the floating-point multiply instruction mul.s to do the multiplication. Only integer instructions are allowed. Extract the fields, multiply, normalize, round, and pack the final result in $v0. You should also make sure to handle special cases: Zero, infinity, and NaN Overflow and underflow Round the result to the nearest even, which is the default rounding mode in IEEE 754 standard. This is the only rounding mode that should be supported. Write a main function to input two floating-point numbers and move their values into $a0 and $a1. It should then call the fmul function to compute and return the floating-point product in $v0. Move the floating-point product in $v0 into floating-point register $f12 and print it. Then use the mul.s instruction to compute the floating-point product and print it. Compare the two results to ensure the correctness of the fmul function. A sample run should look as follows. Allow the user to repeat the execution of the program. Enter 1st float: 5.2e-12 Enter 2nd float: 7.3e+13 Result of fmul: 379.6 Result of mul.s: 379.6 Repeat (Y/N)? Ac Go

Step by Step Solution

3.37 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To achieve singleprecision floatingpoint multiplication using only integer instructions in MIPS asse... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!