Question: MUST WRITE IN MIPS ASSEMBLY CODE Problem 4: Calculate Sums Problem Description: You are probably familiar with the formula: Suppose that you were skeptical of

MUST WRITE IN MIPS ASSEMBLY CODE

Problem 4: Calculate Sums

Problem Description:

You are probably familiar with the formula:

Suppose that you were skeptical of this formula and no one showed you a proof. You try it for a few cases and it works, but you are having difficulty finding a proof yourself. Before looking harder for a proof you'd like to verify it for a few hundred cases or more, by computer.

Write an Assembly program which verifies this equation (i.e. that the two sides are indeed equal), for any N

When your program completes, the answers computed from the left and right sides of the equation should both be labelled and printed.

Note: Test your program for values up to and including 10,000. You do not need a loop in your program, just run it a couple times with different values in this range. Also, there is no need to test to make sure that the user inputs a number of 10,000 or less. This is just a limit to the numbers I will test it with. Also, the pseudoinstruction for multiply is mul.

Required Input:

A single 32-bit signed integer.

Required Output:

Your output should look something like the following example.

Value of N to try? 10000 Iterative Sum: 50005000 Formula Sum: 50005000 

Obviously, both should be the same value (if the equation is true for the selected N).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!