# mips assembly -- 2

Description:

Write a complete program that prompts the user for the coefficients a, b, and c of a quadratic equation

ax2 + bx + c = 0 and outputs the solutions as shown. discriminant = b2

– 4ac

Use single precision floating point.

1. main() – prompt the user for a, b, and c, call solveqe to solve the equation, and display the results using the

return value from solveqe.

2. int solveqe(float a, float b, float c) – solve for solutions, return status in v0:

a. v0:

-1: imaginary,

1: 1 solution, x in f0, or

2: 2 solutions, x1, x2 in f0 and f1.

b. Must call sqrt to compute the square root.

c. Must be a reentrant subprogram and use register call convention.

3. float sqrt(float x) – return the square root of x

Required I/O:

Quadratic Equation Solver by F. Last

Enter values for a? #

Enter values for b? #

Enter values for c? #

is a blank line. F. Last is your first initial and last name, # is user input.

1. If a = 0 && b = 0:

2. If a = 0 and b != 0, linear equation, x = -c / b

x = #.#

3. If discriminant < 0:

Roots are imaginary.

4. Otherwise

x1 = #.#

x2 = #.#

#.# are replaced with calculated root(s)

Hints:

solveqe pseudocode:

if a = 0

if b = 0

return 0 (v0)

else

x = -c / b

return 1, x (v0, f0)

d = b2

– 4ac

if (d < 0)

return -1 (v0)

else {

compute x1 and x2

return 2, x1, x2 (v0, f0, f1)

}

* ONLY main will output anything

* sovleqe and sqrt DO NOT output anything.

* sqrt.f can be used in procedure sqrt or you can implement your own

Kemahiran: Himpunan

Tentang Majikan:
( 1 ulasan ) Woodside, United States

ID Projek: #30134120

## 4 pekerja bebas membida secara purata \$33 untuk pekerjaan ini

sayanthanpera

I can start now..........................................................................................................

\$40 USD dalam sehari
(4 Ulasan)
2.8
ramyan2021

I have 12+year of experience in C , C++ and MIPS Assembly programming and i can implement implement this. Please ping me so we can work on this.

\$20 USD dalam 7 hari
(1 Ulasan)
2.0
Engrusman877

Hi There, I am an embedded system expert and an electronics engineer having expertise in assembly, MIPS, SIMD, Verilog and vhdl. just share your further details if you have some deadline to work on. Thanks

\$20 USD dalam 7 hari
(1 Ulasan)
0.9
sergidest

Hi, there. I have read your project description very carefully so I had confidence that I can do it. I have experience over 5 years with the skills you required. So this project you post can be completed excellently fo Lagi

\$50 USD dalam sehari
(0 Ulasan)
0.0