Reputation:
I know that arithmetic shift right preserves the MSB and logical shift right doesn't. But what is the difference between arithmetic shift left and logical shift left?
Upvotes: 1
Views: 1077
Reputation: 66
The purpose of arithmetic shift is to preserve the MSB.
In the case of a left shift, arithmetic and logic shift do the same operation.
In the case of a right shift, arithmetic shift preserves MSB and rest of the bits are shifted right
Upvotes: 1
Reputation: 60
They are the same operation. Both shift the bits to the left and adds a '0' to the LSB.
Upvotes: 3