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

Option 1

Low Cost Option
Download this past answer in few clicks

2.87 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE