Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MIPS Assembly Language Programming Exercise: Various infinite series for pi have

ID: 3567577 • Letter: M

Question

MIPS Assembly Language Programming Exercise:

Various infinite series for pi have been discovered. The first such series found was the Gregory-Leibniz series:

pi = 4(1 - 1/3 + 1/5 - 1/7 + 1/9 - ...)

This series is of little practical value because enormous numbers of terms are required to achieve a good approximation. However, it does provide good programming practice.

Write a SPIM program that writes out the sum of the first 1000, 2000, 3000, ... , 10000 terms of the series (e.g., count to 10000 stopping to print after every 1000 passes through the loop). Write both iterative and recursive versions of the function to approximate pi. Have the program call the iterative version then the recursive version for each value, saving the results in an array, and print the corresponding values from the two calls, iterative then recursive, one pair per line, with a tab between the values and a newline after the second value.

Can someone post the Assembly Language code for this problem?

Explanation / Answer

http://www.chabotcollege.edu/faculty/kmehl/csci21/Recurse8.pdf

http://www.chabotcollege.edu/faculty/kmehl/csci21.htm

those above 2 links will help you...