Question: ***MUST BE IN MIPS*** Square Root Problem Description: Write and test the square root function in two linked files. Your solution must include a function
***MUST BE IN MIPS***
Square Root
Problem Description:
Write and test the square root function in two linked files. Your solution must include a function called sqrt that accepts a 32-bit single precision floating point number in register $a0 and returns its square root as a 32-bit single precision floating point in $v0. Your solution must also include an assembly 'main' program that accepts a float from the user, calls the sqrt function and prints the resulting value. Prompt the user for the input and label your output.
Use Newtons method to compute the square root. If the input argument is negative, return the value NaN.
Submit the Following File(s):
sqrt.asm, sqrt_main.asm
Required Input:
A 32-bit single precision floating point number
Required Output:
Your output should look something like the following example.
Value: 234.56 Square Root: 15.315351775
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
