mips assembly -- 2


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,

0: not quadratic,

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:

Not a quadratic equation.

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)


solveqe pseudocode:

if a = 0

if b = 0

return 0 (v0)


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

Lihat lagi: write mips assembly language program find, code multiplication single precision floating point mips assembly, write mips assembly program reads integers prints largest, mips array single precision floating point numbers, mips assembly code implement single precision floating point addition, solution counting words text file finding frequency write test mips assembly language program, solution write test mips assembly language program count letters text file, write complete program manage bank accounts, write complete program named buttons implements window buttons left blue reset , write mips assembly language program mars simulator prompt user string process string character time display specific informatio, write mips assembly program calculate sum floating point numbers, mips floating point prompt user enter, write simple program prompts user enter numbers, mips program add single precision floating numbers

Tentang Majikan:
( 1 ulasan ) Woodside, United States

ID Projek: #30134120

4 pekerja bebas membida secara purata $33 untuk pekerjaan ini


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

$40 USD dalam sehari
(4 Ulasan)

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)

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)

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)