This exercise deals with recursive procedure calls. For the following problems, the table has an assembly code
Question:
This exercise deals with recursive procedure calls. For the following problems, the table has an assembly code fragment that computes the factorial of a number. However, the entries in the table have errors, and you will be asked to ix these errors. For number n, factorial of n = 1 x 2 x 3 x .. .. x n.
For the recursive factorial MIPS program above, assume that the input is 4. Rewrite the factorial program to operate in a non-recursive manner. Restrict your register usage to registers $s0-$s7. What is the total number of instructions used to execute your solution from 2.20.2 versus the recursive version of the factorial program?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Computer Organization And Design The Hardware Software Interface
ISBN: 9780123747501
4th Revised Edition
Authors: David A. Patterson, John L. Hennessy
Question Posted: