Write and test a MIPS function to do single-precision floating-point multiplication using only integer instructions. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
To achieve singleprecision floatingpoint multiplication using only integer instructions in MIPS asse... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Ornithologists have determined that some species of birds tend to avoid flights over large bodies of water during daylight hours. It is believed that more energy is required to fly over water than...
-
Brisky Corporation had net sales of $2,400,000 and interest revenue of $31,000 during 2019. Expenses for 2019 were cost of goods sold $1,450,000, administrative expenses $212,000, selling expenses...
-
A large state university requires each college to submit an annual report that includes the average salary of teaching faculty by rank, by rank and gender, and by rank, gender and racial diversity....
-
What are the different methods of administering a questionnaire?
-
Examine the following pairs of puts, which differ only by exercise price. Determine whether either of them violates the rules regarding relationships between American options that differ only by...
-
Besides the effect on the tax rates that will apply, filing status also has an impact on the amount of the standard deduction that is allowed. A taxpayer who is unmarried or separated from their...
-
Use the following information for the remainder of the questions. Dan has finally decided to create his own product line of cat related items hosted at his new business the Cat Empurrium. Dan wants...
-
Think about ChatGPT for a second and share your thoughts about what industries it will change and what are competitive advantages of ChatGPT? Don't like ChatGPT - state at least 3 reasons why
-
You have $2,000 that you want to invest at the beginning of each of 5 years. The following alternatives are available to you: An investment that pays 7 percent for year 1, 6 percent for year 2, 5...
-
Catherine Valentine wants to start saving for retirement as soon as she gets a job upon graduation with an MS degree at age 24. She plans to deposit $1,500 at the end of her first year of work, at...
-
If you invest \($2\),000 today, \($3\),000 in 2 years, \($4\),000 in 5 years, and \($1\),000 in 7 years, how much will be in the bank 15 years from today if interest is 6 percent compounded annually?
-
A man lends $2,500 at 8 percent per year simple interest for 4 years. At the end of this time, he invests the entire amount (principal plus interest) at 6 percent compounded annually for 9 years. How...
-
Based on Exhibit 1 and Wakuluks assumptions about short-term rates and expected inflation, short-term rates in Country X are most likely to be: A. low and bottoming. B. approaching a peak. C. above...
-
Lusambo Ltd produces and sells chemical XYZ. The standard cost per unit of XYZ as follows; Direct material 7.5 Ltr @ K4.5 per liter Director labour 2.5 hours @ K6 per hour Variable overheads 2.4...
-
6. (Potential Energy and Conservation of Energy) What should be the spring constant k of a spring designed to bring a 1200-kg car to rest from a speed of 95 km/h so that the occupants undergo a...
-
Bea Jones (age 32) moved from Texas to Florida in December 2011. She lives at 654 Ocean Way, Gulfport, FL 33707. Bea's Social Security number is 466-78-7359 and she is single. Her earnings and income...
-
In 2012, Lou has a salary of $54,000 from her job. She also has interest income of $1,700. Lou is single and has no dependents. During the year, Lou sold silver coins held as an investment for a...
-
Professor Patricia (Patty) Pate is retired from the PalmSprings Culinary Arts Academy (PSCAA). She is a single taxpayer and is 68 years old. Patty lives at 98 Colander Street, Henderson, NV 89052....
-
Classify these Bluetooth layers using the OSI model: a. baseband; b. L2CAP; c. RFCOMM.
-
Use the power state machine of Fig. 8.12 to determine the energy used in these use cases: a. idle 1 s; receive 10 ms; idle 0.1 s; transmit 5 s; b. sleep 1 min; receive 50 ms; idle 0.1 s; receive 100...
-
What are the main phases of a design review?
Study smarter with the SolutionInn App