Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm in terrible need for help with this assembly language program. Please help, I need the code ASAP. This are the instructions for the program:

I'm in terrible need for help with this assembly language program. Please help, I need the code ASAP.

This are the instructions for the program:

For programming assignment 4, you are required to develop MIPS assembly language programs that allow the user to create and evaluate polynomial functions of degree n.

All polynomial functions of variable x have the form

P(x) = a0 + a1x + a2x2 + + an-1xn-1 + anxn

For this assignment, we will assume that all of the coefficients ai and the exponents of x are integers, and the largest exponent n called the degree of the polynomial is greater than or equal to 0. For example, the polynomial

P(x) = 3 + 5x + 2x3

is of degree 3 and has coefficients a0 = 3, a1 = 5, a2 = 0, and a3 = 2. An evaluation of this polynomial with variable x = 7 should produce the result 3 + 5 x 7 + 0 x 72 + 2 x 73 = 724.

For this assignment, you are required to write a MIPS assembly language program that accomplishes each of the following tasks:

1. First, your program should interactively prompt for and read an integer value between 0 and 10 representing the degree of a given polynomial. Display an appropriate error message and repeat this step until a valid degree has been entered.

2. Next, your program should interactively prompt for and read signed integer values representing each of the polynomials coefficients (a0 an). Store the value of each coefficient in an array.

3. Next, your program should enter a loop that interactively reads integer values of x; for each value, your program should compute and interactively display the value of the result (P(x)) for the user-specified polynomial from step 2. Your program should then ask whether to compute P(x) for a different value of x, and repeat the process of calculating P(x) until the user says not to.

4. Finally, your program should ask the user whether he or she would like to evaluate a different polynomial, and repeat all of the above steps until the user says not to.

Your program will be expected to make use of subroutines, including (at a minimum):

1. getDegree

2. resetCoefficients

3. getCoefficients

4. evaluatePolynomial

I would be so thankful if you assis with this one, please!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions