65.6k views
2 votes
Provide the instruction type, assembly language instruction, and binary representation of instruction described by the following RISC-V fields: opcode=0x33, funct3=0x0, funct7=0x20, rs2=5, rs1=7, rd=6

User Alex Mckay
by
5.5k points

1 Answer

6 votes

Answer:

Step-by-step explanation:

Its a R-type instruction:

31 25 24 20 19 15 14 12 11 7 6 0

+------------+---------+---------+------+---------+-------------+

| funct7 | rs2 | rs1 |funct3| rd | opcode |

+------------+---------+---------+------+---------+-------------+

Assembly Language Instruction:

sub rd, rs1, rs2 || 0x0 0x20 || R[rd] ← R[rs1] - R[rs2]

Binary Conversion:

R-TYPE funct7 rs2 rs1 funct3 rd opcode

Bits 7 5 5 3 5 7

Binary 100000 00101 00111 000 00110 0110011

So Binary representation for this is: 0100 0000 0101 0011 1000 0011 0011 0011

User Hofnarwillie
by
5.0k points