193k views
0 votes
For the following C code assume k and m are passed in x3 and x4 respectively, while result is returned in x4. Compile this code in RISC-V using recursion. C language: int func (unsigned int m, unsigned int k) { if (k <=1) return m; else return 5m + 2k + func (m-2, k-m);

1 Answer

4 votes

Answer:

Check the explanation

Step-by-step explanation:

Using the RISC-V recursion (which is normally pronounced as "risk-five" is a free to use license, modular, extensible instruction set architecture (ISA). initially planned and designed for advance research in computer architecture at Berkeley, RISC-V is now utilized and implemented in everything from $10 microcontroller boards to the pan-European supercomputing initiative.) the full compilation of the code can be seen in the attached image below.

For the following C code assume k and m are passed in x3 and x4 respectively, while-example-1
User Didac Perez Parera
by
5.8k points