2 ms·
Well, -9 isn't 1001010, but we can explore that another time. The real help would be if you showed what you've tried. However: How can you extract the rightm
by RiderOfGiraffes 17y ago
Well, -9 isn't 1001010, but we can explore that another time.
The real help would be if you showed what you've tried. However:
How can you extract the rightmost (least significant) 3 bits of a number x?
How can you move the bits in a number to the left (make them more significant)?
How can you turn off some bits in a number?
Can you puzzle out how these questions/answers can be glued together to do what you want?
Have you tried doing it by hand on paper?
Here:
x = 1010101010101
p = 4
n = 5
y = 11111111
Show us what you actually need to do, step by step.
PS: This probably isn't the forum to have a tutorial on such questions, and I'm going off line in a few minutes. If no one else answers your questions, email me.
PPS: Where does this question come from? What resources do you have?