Question: 5. (25 Points) Consider the code segment for (i-0: -100; it+) Assume X is an array of 64-bit integer, d is a 64-bit integer, and

5. (25 Points) Consider the code segment for (i-0: -100; it+) Assume X is an array of 64-bit integer, d is a 64-bit integer, and i is a 32-bit integer. Assume XO] is at address O(RO) in memory, X[1] at RO+8, X[2] at RO+ 16, etc. Assume d and i are at addresses d and j in memory. 1. (15 Points) Write the code in RISC-V; include comments on each line. 2. (5 Points) What is the size of the RISC-V code in bytes? 3. (5 Points) What is the RISC-V code CPl? Assume Load and store instructions take 4 cycles each, branches take 3 cycles, and arithmetic/logical instruction each takes one cycle. 5. (25 Points) Consider the code segment for (i-0: -100; it+) Assume X is an array of 64-bit integer, d is a 64-bit integer, and i is a 32-bit integer. Assume XO] is at address O(RO) in memory, X[1] at RO+8, X[2] at RO+ 16, etc. Assume d and i are at addresses d and j in memory. 1. (15 Points) Write the code in RISC-V; include comments on each line. 2. (5 Points) What is the size of the RISC-V code in bytes? 3. (5 Points) What is the RISC-V code CPl? Assume Load and store instructions take 4 cycles each, branches take 3 cycles, and arithmetic/logical instruction each takes one cycle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
