I\'ve been reading the classic Hacker\'s delight and I am having trouble understanding the difference between logical shift right,arithmetic shift right, and rotate right. P
Logical right shift means shifting the bits to the right and MSB(most significant bit) becomes 0.
Example: Logical right shift of number 1 0 1 1 0 1 0 1 is 0 1 0 1 1 0 1 0.
Arithmetic right shift means shifting the bits to the right and MSB(most significant bit) is same as in the original number.
Example: Arithmetic right shift of number 1 0 1 1 0 1 0 1 is 1 1 0 1 1 0 1 0.