The Gateway to Computer Science Excellence

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

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

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

So answer will be B

0

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$

& right shift of two bits give $2_{10}$ i.e $10_2$

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,384 answers

198,542 comments

105,341 users