subject

Compile the RISC-V assembly code for the following C code. Assume that k and mare passed in x8 and x9 respectively. Assume that result returned in x8. This function does not have to make sense, it is a test on your knowledge of writing nested/recursive routines. Compile the assembly code for the following C code. int func (unsigned int m, unsigned int k){ if (k <= 0) return 4; else if (m <=2) return k; else return 2m + 4*func(m-1, k-2) + 6*func(m, k-13); Part 2 (6 marks) How many RISC-V instructions does it take to implement the C code from Part 1? If the variables m and k are initialized to 10 and 10 what is the total number of RISC-V instructions that is executed to complete the loop?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:40
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
question
Computers and Technology, 22.06.2019 15:10
Consider a direct-mapped cache with 216 words in main memory. the cache has 16 blocks of 8 words each. it is a word-addressable computer (rather than a byte-addressable computer which we normally discuss). (a) how many blocks of main memory are there? (b) what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, cache block, and block offset fields (if they apply)? (c) to which cache block will the memory reference db6316 map?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
You know the right answer?
Compile the RISC-V assembly code for the following C code. Assume that k and mare passed in x8 and x...
Questions
question
Mathematics, 26.02.2021 06:20
question
Mathematics, 26.02.2021 06:20
question
Mathematics, 26.02.2021 06:20
question
Mathematics, 26.02.2021 06:20
question
Mathematics, 26.02.2021 06:20
question
Mathematics, 26.02.2021 06:20
question
Social Studies, 26.02.2021 06:20
Questions on the website: 13722360