Question

Registers in RISC-V are 64-bit. For the sake of simplicity, consider the following instructions operating on...

Registers in RISC-V are 64-bit. For the sake of simplicity, consider the following instructions operating on 32-bit registers. Assume that registers x5 and x6 hold the values 0xEEEEEEEE and 0x00000000, respectively.

• (2 points) – What is the value in x6 for the following slli x6, x5, 6

• (2 points) – Using the result from the part above, what is the value in x6 for the following instruction. srli x6, x6, 6

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

slli: instruction will perform a logical left shift of the contents of register x5 and stores the shifted value in register x6. The shift amount is taken from the 5-bit immediate field,i.e 6. The value 0 is shifted in from the right to replace lost bits

slli x6, x5, 6

x5 will hold the value 0xBBBB BB80‬

srli: instruction will perform a logical right shift of the contents of register x6 and stores the shifted value in register x6. The shift amount is taken from the 5-bit immediate field,i.e 6. The value 0 is shifted in from the left to replace lost bits .

srli x6, x6, 6

x6 will hold 0x02EEEEEE

Add a comment
Know the answer?
Add Answer to:
Registers in RISC-V are 64-bit. For the sake of simplicity, consider the following instructions operating on...
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