5,056 views
1 votes
1 votes
what is the differernce between logical shift left (or right) and arithmetic shift left (or right)

e.g if  IN SOME REGISTER 10100110 IS STORED THEN  WHAT WILL BE THE RESULT IF WE APPLY THEM

1 Answer

3 votes
3 votes
logical shift: all bits move towards left pr right including the sign bit.. generally used in serial data communication to transfer the data bit by bit or for multiplying unsigned numbers by power of 2.
Arithmetic shift:all bits move towards left or right except the sign bit.. used in signed arithmetic computations..

ex: 10100110
after logical left shift:01010011
arithmetic left shift: since MSB is signed bit.. so msb will not shift.. 10010011..

Related questions

1 votes
1 votes
0 answers
3
VS asked Jan 13, 2018
659 views
a) Shifting a Unsigned integer right by one bit, and filling from the left with 0, is always equivalent to dividing by 2. (True/False)b) Shifting a Unsigned integer left ...