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
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
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
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); }