Consider the following RISC-V program segments. Assume that the variables a, b, c and d are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following RISC-V program segments. Assume that the variables a, b, c and d are assigned to registers x10, x11, x12 and x13 respectively and the base address of array A is in register x20. a. add x10, x10, x11 sub x10, x13, x12. add x10, x10, x11 b. addi x21, x20, -12 add x21, x21, x11 1w x10, 16 (x21) Answer the following: 1- 2- 3- For the instructions above, what is the corresponding C statement? For the assembly above, assume that the registers x10, x11, x12, x13, contain the values 10, 20, 30, and 40, respectively. Also, assume that register x20 contains the value 800. You can refer to memory locations contents using the notation "Mem[adr]"; e.g., the word stored at address 800 can be refered to as Mem[800]. Find the value of x10 at the end of the assembly code. For each RISC-V R-type instruction, show the values of the of rs1, rs2, and rd fields. For each I-type instruction, show the value of the rs1, rd, and immediate fields. Activate WindowsS Consider the following RISC-V program segments. Assume that the variables a, b, c and d are assigned to registers x10, x11, x12 and x13 respectively and the base address of array A is in register x20. a. add x10, x10, x11 sub x10, x13, x12. add x10, x10, x11 b. addi x21, x20, -12 add x21, x21, x11 1w x10, 16 (x21) Answer the following: 1- 2- 3- For the instructions above, what is the corresponding C statement? For the assembly above, assume that the registers x10, x11, x12, x13, contain the values 10, 20, 30, and 40, respectively. Also, assume that register x20 contains the value 800. You can refer to memory locations contents using the notation "Mem[adr]"; e.g., the word stored at address 800 can be refered to as Mem[800]. Find the value of x10 at the end of the assembly code. For each RISC-V R-type instruction, show the values of the of rs1, rs2, and rd fields. For each I-type instruction, show the value of the rs1, rd, and immediate fields. Activate WindowsS
Expert Answer:
Answer rating: 100% (QA)
Given Assembly Code a add x10 x10 x11 sub x10 x13 x12 add x10 x10 x11 b addi x21 x20 12 add x21 x21 ... View the full answer
Related Book For
Computer Organization and Design The Hardware Software Interface
ISBN: 978-0124077263
5th edition
Authors: David A. Patterson, John L. Hennessy
Posted Date:
Students also viewed these programming questions
-
For the MIPS assembly instructions in Exercise 2.4, rewrite the assembly code to minimize the number if MIPS instructions (if possible) needed to carry out the same function. Exercise 2.4 For the...
-
For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively....
-
Figure shows a cycle consisting of five paths: AB is isothermal at 300 K, BC is adiabatic with work = 5.0 J, CD is at a constant pressure of 5 atm, D E is isothermal, and EA is adiabatic with a...
-
Sketch a phasor diagram to illustrate the resultant of E1 = E01 sin wt and E2 = E02 sin (wt + ), where E02 = 1.50E01 and /6 < < /3. Use the sketch and the law of cosines to show that, for two...
-
Edward is driving 52 mi/h on a one-lane road. He must make a quick stop because there is a stalled car ahead. a. What is his approximate reaction distance? b. What is his approximate braking...
-
Extreme Machine manufactures machines and parts for various industries; they have an office in Youngstown, Ohio. Avery Dennison manufactures and sells labels from a plant in Mentor, Ohio. They use...
-
Lovell Computer Parts Inc. is in the process of setting a selling price on a new component it has just designed and developed. The following cost estimates for this new component have been provided...
-
Q1) Find expressions for the Revenue, Cost, and Profit from selling x thousand items. Item Price Variable Cost $8.00 3816x Fixed Cost $71,174
-
When the pump in Fig P3.130 draws 220 m3/h of water at 20°C from the reservoir, the total friction head loss is 5 m. The flow discharges through a nozzle to the atmosphere Estimate the pump power...
-
For the transfer function Y(s) U(s) 28+3 (s+2s + 2) (s+2) (a) By inspection, write the state space system in reachable canonical form (RCF). (b) Draw the signal flow graph for the state space system...
-
Trevor needs a new computer for college. His uncle lends him $1,000 at 5 percent interest for 3 years. a. What is the total payment after 3 years if simple interest is used? b. How much of the total...
-
Shannon purchases a bond for \($1\),142.38. The bond matures in 3 years, and she will redeem it at its face value of \($1\),200. Interest premiums are paid annually. If Shannon will earn a yield of...
-
If you borrow \($40\),000 at 9 percent annual compound interest and pay it back with 7 equal annual payments, what will be the size of each payment if the first payment occurs 1 year after borrowing...
-
Jayjeet wants to purchase a car but needs $5,000 to do so. His uncle Eswar offers to loan him the money at 8 percent compounded yearly. Uncle Shankar offers to loan him the money at 9 percent simple...
-
A sum of $1,000 is borrowed today. The loan is to be paid off with interest at the end of 3 years with no payments made in between. Calculate the total interest paid using: a. Simple interest of 8...
-
CT-Symphony Orchestra The CT-Symphony Orchestra is a branch of the Center for Performing Arts. It performs regular concerts throughout the year and has been reasonably profitable in the past....
-
Prepare a stock card using the following information A company is registered for GST which it pays quarterly, assume GST was last paid on the 30th of June 2019. It uses weighted average cost...
-
Th e Pentium 4 Prescott processor, released in 2004, had a clock rate of 3.6 GHz and voltage of 1.25 V. Assume that, on average, it consumed 10 W of static power and 90 W of dynamic power. The Core...
-
Write down the binary representation of the decimal number 63.25 assuming the IEEE 754 double precision format.
-
Assume that we would like to expand the MIPS register file to 128 registers and expand the instruction set to contain four times as many instructions. 1. How this would this affect the size of each...
-
We can make a static measurement to deduce the spring constant to use in the model. If a \(61 \mathrm{~kg}\) woman stands on a low wall with her full weight on the ball of one foot and the heel free...
-
A \(1.00 \mathrm{~kg}\) block is attached to a horizontal spring with spring INT constant \(2500 \mathrm{~N} / \mathrm{m}\). The block is at rest on a frictionless surface. A \(10.0 \mathrm{~g}\)...
-
If, during a stride, the stretch causes her center of mass to lower by \(10 \mathrm{~mm}\), what is the stored energy? A. \(3.0 \mathrm{~J}\) B. \(6.0 \mathrm{~J}\) C. \(9.0 \mathrm{~J}\) D. \(12...
Study smarter with the SolutionInn App