The Gateway to Computer Science Excellence
0 votes

In right shift register, right shift operation of binary $11$ gives

  1. $5.5$
  2. $5$
  3. $6$
  4. $\text{none of these}$
in Digital Logic by (5 points)
edited by | 66 views
How many bits to shift?
If we do 1 bit shift then get 1 (in binary)
If do 2 bit shift then get 0 (in binary)
So, the answer should be d) none of these

1 Answer

0 votes

When we do bit shifting, a bit shifting tells to shift each bit left or right of a number's binary representation. The last bit of the direction is lost, and a 0 bit inserted in the other end.

In right shift register, the bits are shifted in the rightmost direction & a single right shift divides the number (binary) by $2$, two bit right shift divides the number by $4$, three bit right shift divides the number by $8$ , and so on throwing out the remainders.

I'm taking $11_2$ 


$11 >> 1$ gives us $01_2$ (in binary) i.e. $1_{10}$ (in decimal)


$11 >> 2$ gives us $00_2$ (in binary) i.e. $0_{10}$ (in decimal).

Now, I'm taking $11_{10}\rightarrow $ i.e. $1011_2$ in binary


$1011 >> 1$ gives $0101_2$ i.e. $5_{10}$

$1011>>2$ gives $0010_2$ i.e. $2_{10}$

by Boss (17.8k points)
edited by

your answer is wrong !

Answer depends on the number of shift(right).As nothing is mentioned in the question ,i assumed the number of shift to be $1$ giving the answer as $5$


int main()
int a = 11;

printf("\nNumber(%d) is Right Shifted By 1 Bit  : %d",a,a >> 1);
@Subarna Das ,you are treating 11 as binary no.but  question about what is output of $(11)_{10}$ in binary when right shift is done

11=1011,when one right shift operation is done data will become 0101 which is equivalent to 5

So answer will be B
if it is $11_2 \rightarrow$ right shift of one bit gives $1_2$

& right shift of two bits give $0_2$
if it is $11_{10} \rightarrow$ right shift of one bit gives $5_{10}$ i.e. $101_2$

& right shift of two bits give $2_{10}$ i.e $10_2$
& if we look at the options then yes, $5$ will be the right option keeping in mind that here $1$ bit right shift occurs on the decimal number $11$ i.e. $11_{10}$.
there is given right shift operation that means only one shift operation.
but that doesn't tell us whether do one bit shift or 2 bit
However, i've covered both.

given as operation not operations 

  if they want more then should have tell us how many 

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,384 answers
105,341 users