Write a program in RISC-V assembly to calculate a given Fibonacci number. Example: fib(7) will be 13. Use x10=7 as the i
Posted: Fri Jul 08, 2022 7:26 am
Write a program in RISC-V assembly to calculate a givenFibonacci number. Example: fib(7) will be 13. Use x10=7 as theinput and use x10 to hold the calculated results. Refer to slidesfor the Factorial example discussed in the class. Hint: int fib(intn) { if (n==0) return 0; else if (n == 1) return 1; else returnfib(n−1) + fib(n−2); }