Question: Q3 RISC-V Machine Code 5 Points Convert each of the following RISC-V instructions to machine code. Format your answer as 32-bit hexadecimal number, e.g. 0xABADCAFE

Q3 RISC-V Machine Code

5 Points

Convert each of the following RISC-V instructions to machine code.

Format your answer as 32-bit hexadecimal number, e.g. 0xABADCAFE or 0xabadcafe (the cafe just sucks). Leave any unused bits as 0.

Refer to your RISC-V Green Sheet if needed.

Q3.1 sub s0,t0,t1

Q3.2 slli a0, t0, 2

Q3.3 sw t0, 4(s0)

Q3.4 jal ra, fib

Assume PC = 0x0040011CPC=0x0040011C, and NEXT is located at 0x0040010C0x0040010C

Q3.5 beq t3, t5, NEXT

Assume PC = 0x0040011CPC=0x0040011C, and NEXT is located at 0x0040010C0x0040010C.

Q4 Machine Code RISC-V Instructions

Convert each of the following 32-bit machine code instructions into a RISC-V instruction.

Formatting: use register names in your final answer, e.g. a0 instead of x10. The only exception is the zero register, which you should refer to as "x0" instead of "zero".

Example Format: "add t0, a0, x0" or "lw x0, 61(x5)"

For all questions, you can assume

PC = 0x00400010PC=0x00400010

and we have the following labels:

func1: 0x00400000func1: 0x00400000

func2: 0x00400018func2: 0x00400018

Q4.1 0x00598523

Q4.2 0x00b542b3

Q4.3 0x00628463

Q4.4 0xFF1FF06F

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!