Question: Consider the following Fibonacci function definitions in C and RISC - V respectively: int fib ( int x ) ( if ( x = =
Consider the following Fibonacci function definitions in C and RISCV respectively:
int fibint x
if x
return ;
else if x
return ;
else
fib:
beq x x addi x x beq x x addi x sd xl xx done dorte
return fibxfibn;
addi x x
Id xx
addi x x jal xld x fib x
addi x x done:
jalr x x
Note: xzero, xstack pointer, xreturn value
Each line in RISCV code represents a missing instruction. Find the missing instructions in t
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
