The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+10 votes

Consider the number given by the decimal expression:

$$16^3*9 + 16^2*7 + 16*5+3$$

The number of 1’s in the unsigned binary representation of the number is ______

$$16^3*9 + 16^2*7 + 16*5+3$$

The number of 1’s in the unsigned binary representation of the number is ______

+20 votes

Best answer

+3 votes

In Binary representation, each number which can be represented in the power of 2 contains only one 1.

For example 4 = 100, 32 = 100000

$16^3∗9+16^2∗7+16∗5+3$

Convert the given expression in powers of 2.

$16^3∗9+16^2∗7+16∗5+3$

$2^{12}∗(8+1)+2^8∗(4+2+1)+2^4∗(4+1)+(2+1)$

$2^{15}+2^{12}+2^{10}+2^9+2^8+2^6+2^4+2^1+ 2^0$

There are total 9 terms, hence, **there will be nine 1's**. for example 4+2 = 6 and 4 contains two 1's.

- All categories
- General Aptitude 1.2k
- Engineering Mathematics 4.8k
- Digital Logic 2k
- Programming & DS 3.5k
- Algorithms 3k
- Theory of Computation 3.8k
- Compiler Design 1.5k
- Databases 2.8k
- CO & Architecture 2.5k
- Computer Networks 2.9k
- Non GATE 940
- Others 1.2k
- Admissions 322
- Exam Queries 409
- Tier 1 Placement Questions 17
- Job Queries 52
- Projects 8

34,194 questions

40,882 answers

116,023 comments

39,775 users