The Gateway to Computer Science Excellence
+1 vote
2.8k views
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
in CO and Architecture by Active (2.3k points) | 2.8k views

1 Answer

+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..
by Active (3.6k points)
0
The example you gave is actually right shift not left shift. I wonder why no one pointed the mistake out.
0
Exactly it is logical right shift ... Correct it !
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,405 answers
198,628 comments
105,467 users