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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:30, yudayang2012pa9u8p
Consider the following statements: #include #include class temporary { private: string description; double first; double second; public: temporary(string = "", double = 0.0, double = 0.0); void set(string, double, double); double manipulate(); void get(string& , double& , double& ); void setdescription(string); void setfirst(double); void setsecond(double); }; write the definition of the member function set() so that the instance variables are set according to the parameters. write the definition of the constructor so that it initializes the instance variables using the function set() write the definition of the member function manipulate() that returns a decimal number (double) as follows: if the value of description is "rectangle", it returns first * second if the value of description is "circle" it returns the area of a circle with radius first if the value of description is "cylinder" it returns the volume of a cylinder with radius first and height second. hint: the volume of a cylinder is simply the area of the circle at the base times the height. if the value of description is "sphere" it returns the volume of the sphere with radius first. otherwise it returns -1.0;
Answers: 1
image
Computers and Technology, 23.06.2019 07:00, Dvrsug8598
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
image
Computers and Technology, 24.06.2019 12:00, violetagamez2
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
image
Computers and Technology, 24.06.2019 18:20, seema12
7. design a circuit with three inputs (x, y, and z) representing the bits in a binary number, and three outputs (a, b, and c) also representing bits in a binary number. when the input is 1, 2, or 3, the binary output should be one lesser than the input. when the input is 4, 5, or 6, the binary output should be one greater than the input. when the input is 0, the output is 0, and when the input is 7, the output is 7. show your truth table, all computations for simplification, and the final circuit.
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 in other subjects:

Konu
English, 10.11.2020 18:50
Konu
History, 10.11.2020 18:50
Konu
History, 10.11.2020 18:50
Konu
Mathematics, 10.11.2020 18:50