In: Computer Science
The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly instruction. What is the RISC-V instruction format and specific assembly language instruction?
0xfe810113
Solution -:
This 32- bit instruction given in hexadecimal is I-Format instruction.
and function performed by this instruction is ADDI (ADD immediate)
Explanation -:
In risc-v technology instruction size is 32-bit.
different type of instruction format are
So here rightmost 7 bits are for opcode.
and opcode for different format is different.
In given instruction opcode is 0010011. This opcode belongs to I-Format risc-v instruction. So that's how format is identified.
Now instruction format for I type is given below
Here
immediate is of 12-bits (immediate word)
rs1 is of 5-bits (register oprand)
fun3 is of 3-bits (function to be performed)
rd is of 5-bits (destination register)
opcode is of 7-bits
So in given question fun3 is 000 that is ADDI (ADD immediate)