Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions