please no copy and paste answers MIPS assembly 1. Complete fib_recur function, which recursively calculates the Fibonacci numbers from a given positive integer input. This is the high-level description of the recursive Fibonacci. def fib_recur(x): if (x == 0): return 0; elif (x == 1): return 1; else: return fib_recur(x-1)+fib_recur(x-2); >> a0: the input argument, x must be implemented in recursion and with the given algorithm
please no copy and paste answers
MIPS assembly
1. Complete fib_recur function, which recursively calculates the Fibonacci numbers from a given positive integer input. This is the high-level description of the recursive Fibonacci.
def fib_recur(x):
if (x == 0):
return 0;
elif (x == 1):
return 1;
else:
return fib_recur(x-1)+fib_recur(x-2);
>> a0: the input argument, x
must be implemented in recursion and with the given
###############################################################
# Text Section
.text
#DO NOT ADD OR CHANGE ANYTHING HERE
###############################################################
###############################################################
###############################################################
# PART 1 (fib_recur)
#a0: input number
###############################################################
fib_recur:
############################### Part 1: your code begins here ##
############################### Part 1: your code ends here ##
jr $ra
Obtained output: Testing fib_recur:
Program input: 0 1 2 3 6 9 10 13
Expected output: 0 1 1 2 8 34 55 233
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images