Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Consider the following RISC-V program segments. Assume that the variables a, b, c and d are assigned to 

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

Step by Step Solution

3.35 Rating (164 Votes )

There are 3 Steps involved in it

Step: 1

Given Assembly Code a add x10 x10 x11 sub x10 x13 x12 add x10 x10 x11 b addi x21 x20 12 add x21 x21 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Organization and Design The Hardware Software Interface

Authors: David A. Patterson, John L. Hennessy

5th edition

124077269, 978-0124077263

More Books

Students also viewed these Programming questions

Question

What have you learned about sleep that you could apply to yourself?

Answered: 1 week ago