Question: a ) ( 1 0 points ) You are given a sequence of RISC - V instructions below. For each instruction, write the register transfer

a)(10 points) You are given a sequence of RISC-V instructions below. For each instruction, write
the register transfer notation that describes the functional behavior of the given instruction. For
example, the register transfer notation of:
add x1,x5,x7 is GPR[x1]- GPR[x5]+ GPR[x7]
i) lw x3,32(x4)
ii) sw x5,64(x6)
iii) addi x11,x2,0x10
iv) sll x2,x2,x4
v) and x2,x20,x21
vi) beq x21,x20,0x16
vii) jalr x5,x7,0x512
viii) jal x7,0x1024
ix) auipc x2,0xEECEE
x) lui x5,0xABCDE
b)(10 points) For the given RISC-V instructions below, what is the corresponding C statement?
You can assume that the statement has two arrays: A and B whose base addresses are stored in
registers x10 and x11, respectively. In addition to arrays A and B, the statement has the following
variables: f, g, h, i and j, which are kept in registers x5, x6, x7, x28 and x29, respectively.
slli x30,x5,2
add x30,x10,x30
slli x31,x6,2
add x31,x11,x31
lw x5,0(x30)
addi x12,x30,4
lw x30,0(x12)
add x30,x30,x5
sw x30,0(x31)
 a)(10 points) You are given a sequence of RISC-V instructions below.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!