In a textbook I'm looking at, it asks me to do an arithmetic right shift to the binary sequence 0110 0100
by 3 (a >> 3
). I thought it was 0000 1100
as I would add 3 zeros at the right considering the most significant bit is 0
(or is it 01
?), but the answer key says the correct answer is 1110 1100
.
An arithmetic shift is defined as follows:
An arithmetic right shift fills the left end with k repetitions of the most significant bit...
As the most significant bit in 0110 0100
is 0
, should I not be adding 0s instead of 1s? Is the most significant bit actually 01
?
As a separate example, if a bit refers to the first two digits and not only the first, why is a right shift of 3 to the binary sequence 0111 0010
, 0000 1110
, instead of 1110 1110
?