Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Problem 1: Assume address in memory of 'A[0]', 'B[0]' and 'C[0]') are stored in Registers x27, x30, x31

Problem 1: Assume address in memory of 'A[0]', 'B[0]' and 'C[0]') are stored in Registers x27, x30, x31

Electrical Engineering

Problem 1: Assume address in memory of 'A[0]', 'B[0]' and 'C[0]') are stored in Registers x27, x30, x31. Assume values of variables f, g, h, i, and j are assigned to registers x5, x6, x7, x28, x29 respectively.  Write down RISC V Instruction(s) to

(a) Load Register x5 with content of A[10]

(b) Store contents of Register x5 into A[17]

(c) add 2 operands: one in x5 - a register, the other in in Register x6. Assume result of operation to be stored in register x7

(d) copy contents at one memory location to another: C[g] = A[i+j+31]

(e) implement in RISC V these line of code in C:

(i) f = g - A[B[9]]

(ii) f = g - A[C[8] + B[4]]

(iii) A[i] = B[2i+1], C[i] = B[2i]

(iv) A[i] = 4B[i-1] + 4C[i+1]

(v) f = g - A[C[4] + B[12]]

Problem 2:

Assume the following register contents:

x5 = 0x00000000AAAAAAAA, x6 = 0x1234567812345678

a. For the register values shown above, what is the value of x7 for the following sequence of instructions?

srli x7, x5, 16

addi x7, x7, -128

srai x7, x7, 2

and x7, x7, x6

b. For the register values shown above, what is the value of x7 for the following sequence of instructions?

slli x7, x6, 4

c. For the register values shown above, what is the value of x7 for the following sequence of instructions?

srli x7, x5, 3

andi x7, x7, 0xFEF

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

kindly see the pics by number wise i-e pc1,pc2,pc3,pc4

please use this google drive link to download the answer file.

https://drive.google.com/file/d/1UEkxOq8i2Uc8xMePv5U5oatIAJXE4BEp/view?usp=sharing

note: if you have any trouble in viewing/downloading the answer from the given link, please use this below guide to understand the whole process.

https://helpinhomework.org/blog/how-to-obtain-answer-through-googledrive-link