First remember that machine words are of fixed size. Say 4, and that your input is:
+---+---+---+---+
| a | b | c | d |
+---+---+---+---+
Then pushing everything one position to the left gives:
+---+---+---+---+
| b | c | d | X |
+---+---+---+---+
Question what to put as X?
- with a shift put 0
- with rotate put
a
Now push everything one position to the right gives:
+---+---+---+---+
| X | a | b | c |
+---+---+---+---+
Question what to put as X?
- with a logical shift put 0
- with an arithmetic shift put
a
- with rotate put
d
Roughly.
Logical shift correspond to (left-shift) multiplication by 2, (right-shift) integer division by 2.
Arithmetic shift is something related to 2's-complement representation of signed numbers. In this representation, the sign is the leftmost bit, then arithmetic shift preserves the sign (this is called sign extension).
Rotate has no ordinary mathematical meaning, and is almost an obsolete operation even in computers.
--EDIT---------------------
A note on arithmetic shift and 2-complement numbers.
For the sake of simplicity, suppose we work on binary representation of length 6.
For a digit a
we denote its 2-complement by A
and the converse (~a = A and ~A=a).
Any integer 0≤n<32 has the base 2 representation 0abcde, and its negative counterpart has the representation 1ABCDE + 1. Note that -0 has the same representation as 0.
We want x+-x=0, as 0abcde+1ABCDE = 111111, and 111111+1 = 000000
(fixed length representation we can omit the carry that overflows) we then know that -x is obtained by ~x+1.
Now what is the binary representation of -n/2?
The binary representation of n/2 is 00abcd, and its negative counterpart has the representation 11ABCD + 1, then to divide a 2's-complement binary number by 2 we just have to shift bits to the right and duplicate the original left bit on the same position.
2^k
. – Vela