The Gateway to Computer Science Excellence
0 votes
66 views

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
0
How many bits to shift?
0
If we do 1 bit shift then get 1 (in binary)
0
If do 2 bit shift then get 0 (in binary)
0
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$ 

So,

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

And, 

$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
0

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$

#include<stdio.h>

int main()
{
int a = 11;

printf("\nNumber(%d) is Right Shifted By 1 Bit  : %d",a,a >> 1);
}
0
@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
0
if it is $11_2 \rightarrow$ right shift of one bit gives $1_2$

& right shift of two bits give $0_2$
0
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$
0
& 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}$.
0
there is given right shift operation that means only one shift operation.
0
but that doesn't tell us whether do one bit shift or 2 bit
+1
However, i've covered both.
0

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
198,542 comments
105,341 users