in Digital Logic recategorized by
18,347 views
31 votes
31 votes

The number of $1$'s in the binary representation of $(3\ast4096 + 15\ast256 + 5\ast16 + 3)$ are:

  1. $8$
  2. $9$
  3. $10$
  4. $12$
in Digital Logic recategorized by
18.3k views

4 Comments

$4096=2^{12}$ and multiplying a number in binary with $2^x$ means that we are shifting that number to the left by $x$ bits.

So, the number $4096 . 3$ will be $(11)_2$ shifted by $12$ bits to the left which will become $11000000000000$.

Same we can do with other numbers as well and will find that there is no overlapping $1's$. So total $1's = 1's$ in $3,15,5,3$.

So the answer is $10$.

Result =

$11000000000000$ $+$

     $111100000000$ $+$

                 $1010000$ $+$

                             $11$

$=11111101010011$
1
1
But what if the question is like 15*256 + 5*16 – 3?
0
0
they are in hexadecimal notation write 3,15, 5,3  into 4 digits each
0
0

@Nischal Mehta we dont include negative numbers in the notation

0
0

6 Answers

91 votes
91 votes
Best answer
I suggest the following approach, here we can clearly see that numbers are getting multiplied by powers of $16.$ So this is nothing but Hexadecimal number in disguise.

$(3\times 4096 + 15 \times 256 + 5 \times 16 + 3)  = (3F53)_{16} = (0011111101010011)_2$ which has total $2 + 4 + 2 + 2 = 10\;\; 1's$

Correct Answer: C.
edited by

1 comment

awesome
7
7
59 votes
59 votes

We have,  3*4096 + 15*256 + 5*16 + 3

              = (2+1)*212     + (8+4+2+1) * 28          +  (4+1)*24  + 2 + 1

              = 213 + 212      + 211  + 210 + 2+ 28   +   26 + 24   + 2 + 1

              = 1        1            1       1        1      1          1      1      1     1

              = 10  1's     So, OPTION (C) .. 

2 Comments

Thanks @Himanshu it is best approach.
0
0
Best Approach
0
0
40 votes
40 votes
$3 = (11)_2$
$3\times 4096 = 3\times (2^{12}) = (11)_2<< 12 = (11000000000000)_2$

Similarly, $15 \times 256 = (1111)_2 << 8 = (111100000000)_2$ and $5 \times 16 = (101)_2 << 4 = (1010000)_2$

So, $3\times 4096 + 15 \times 256 + 5\times 16 + 3 = (11111101010011)_2$

Number of 1's = 10.
by

1 comment

best approach..
1
1
5 votes
5 votes
Answer is C.

All 4096,256,16 needs only 1 one to be represented in binary

3 - requires 2   1's

15 - requires 4 1's

5 - requires 2 1's

3 - requires 2 1's

so adding all those we get 2+4+2+2= 10
by

1 comment

edited by
10 is correct but the approach works only if no two numbers have a 1 in the same bit position. You have to take care of that.
3
3
Answer:

Related questions