Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3: (16 pts, 4 pts each subpart) Part 0: Suppose the PC is set to 0x20000000. What range of addresses can be reached using

image text in transcribedProblem 3: (16 pts, 4 pts each subpart) Part 0: Suppose the PC is set to 0x20000000. What range of addresses can be reached using the RISC-V a) jal instruction, b) j instruction, c) beq instruction? In other words, what is the set of possible values for the PC after the jump instruction executes? Part 1: Suppose that the current value of PC is 0x00004000. Can we use a single jump instruction to go to PC=0x20014924? (if yes, write the jump instruction and show the value of the immediate field in Hex. If not, use a combinations of instructions to do so and show the immediate values in Hex) Part 2: Suppose that the current value of PC is 0x00004000. Can we use a single branch instruction to go to PC=0x20014924? (if yes, write the branch instruction and show the value of the immediate field in Hex. If not, use a combinations of instructions to do so and show the immediate values in Hex) Part 3: Suppose that the current value of PC is 0x1FFFFF00. Can we use a single branch instruction to go to PC=0x20000C24? (if yes, write the branch instruction and show the value of the immediate field in Hex. If not, use a combinations of instructions to do so and show the immediate values in Hex) Solution: Problem 4: (6 pts) Compile the RISC-V assembly code for the following C code. int func (int a, int b, int c){ if (a20) return 0; else if (n Problem 3: (16 pts, 4 pts each subpart) Part 0: Suppose the PC is set to 0x20000000. What range of addresses can be reached using the RISC-V a) jal instruction, b) j instruction, c) beq instruction? In other words, what is the set of possible values for the PC after the jump instruction executes? Part 1: Suppose that the current value of PC is 0x00004000. Can we use a single jump instruction to go to PC=0x200149242 (if yes, write the jump instruction and show the value of the immediate field in Hex. If not, use a combinations of instructions to do so and show the immediate values in Hex) Part 2: Suppose that the current value of PC is 0x00004000. Can we use a single branch instruction to go to PC 0x20014924? (if yes, write the branch instruction and show the value of the immediate field in Hex. If not, use a combinations of instructions to do so and show the immediate values in Hex) Part 3: Suppose that the current value of PC is 0x1FFFFF00. Can we use a single branch instruction to go to PC-0x20000C24? (if yes, write the branch instruction and show the value of the immediate field in Hex. If not, use a combinations of instructions to do so and show the immediate values in Hex) Solution: Problem 4: (6 pts) Compile the RISC-V assembly code for the following C code int func (int a, int b, int c)( if (a20) return 0 else if (n20) return 0 else if (n

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

How do a product cost and a period cost differ?

Answered: 1 week ago

Question

What are the four functions associated with payroll activities?

Answered: 1 week ago

Question

Different types of Grading?

Answered: 1 week ago

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago