Your system is doing an arithmetic shift, and not a logical shift. This is typical of signed integers, as it more closely simulates a divide-by-2 operation and is much more useful in practice.
A logical shift right uses 0 as input for the shifted in high bit.
An arithmetic shift right uses the value of the current high bit for the shifted in high bit.
IE:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
8-bit signed: 11100101
>> 1 logical: 01110010
>> 1 arithmetic 11110010
For arithmetic: 11100101
v
|
this bit used to shift in
|
+--+
|
+->11110010