Need some help with this. The code is attached below 1. Translate the following C code to RISC-V assembly code, using the minimum number of instructions you can think of. The values of: w, y, i, j are...


Need some help with this.


The code is attached below


1. Translate the following C code to RISC-V assembly code, using the minimum number of

instructions you can think of. The values of: w, y, i, j are in registers: x4, x5, x6, x7. Register x10

holds the base address of array A.


2. How many RISC-V instructions are needed to implement the above code? If w and y are

initialized to 5 and 10, and elements of A are initially 0, what is the total number of RISC-V instructions

executed to complete the loop?


for (i=0; i<=w; i++)<br>for (j=0; j<y; j+=2)<br>A[3*i + j] = 2*i +3*j;<br>

Extracted text: for (i=0; i<=w; i++)="" for="" (j="0;">

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here