- Right shifting by , fills the left end with repetitions of the most significant bit.
- Assuming a bit vector, , will give:
- Almost all machine instructions use arithmetic right shifts for signed data
Example
-
- Here,
MSB = 1
- Here,
-
- The italicised 1s indicate the values that fill the left end
Another example
-
- Here,
MSB = 0
- Here,
-
- The italicised
0s indicate the values that fill the left end
- The italicised