Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 : Translate the following RISC - V function F 1 into machine code both in binary and hexadecimal: F 1 : addi x

Problem 1:
Translate the following RISC-V function F1 into machine code both in binary and hexadecimal:
F1: addi x2,x2,-4
Sw x22,0(x2)
lui x22,1022
ori x22,x22,124
blt x21,x22,L1
add x23,x20,x20
beq x7,x7,Ex
sub x23,x20,x20
lw x22,0(x2)
addi x2,x2,4
jalr x0,O(x1)
If a caller uses the instruction:
jal x1, F1
residing at address 8420 to call the F1 function residing at address 2024 and if the values of x1,x2,x7,x20,x21,
x22, and x23 were 1200,6000,134,-32,385,-738, and 1100 respectively at call time, what would be their final
values at return time? Also, what will be the value of 22 immediately after the execution of the ori instruction?
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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions