Question

What is the binary encoding of the following RISC-V assembly instruction? Please write your answer as...

What is the binary encoding of the following RISC-V assembly instruction? Please write your answer as an 8-digit hexadecimal number.

addi x1, x2, -3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

What is the binary encoding of the following RISC-V assembly instruction:

addi x1, x2, -3

Answer: FFD10093 (8- digit hexadecimal)

Description:

• Instruction format: ADDI dest, src1, const

• The above instruction performs the addition of src1 and constant that is immediate value and stores in destination.

• addi x1, x2, -3 means that  x1 ← x2  - 3

• Instruction field representation as follows:

31 20 19 15 14 12 11 7 6 0 imm[11:0 rd opcode rs1 Funct3 7 bits 12 bits 5 bits 3 bits 5 bits I-Immediate [11:01 OP-IMM ADDI d

• Writing provided instruction as above format: addi x1, x2, -3

1111111101 00010 0010011 000 00001

ͦ I-Immediate: -3 = 111111111101 (sign-extended or 2's compliment representation)

ͦ src: x2 = 00010

ͦ  funct3: 000

ͦ dest: x1 = 00001

ͦ opcode: 0010011

• Binary: 11111111110100010000000010010011

• Hexadecimal: 0xFFD10093

Add a comment
Know the answer?
Add Answer to:
What is the binary encoding of the following RISC-V assembly instruction? Please write your answer as...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT