The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+7 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 ______

+17 votes

Best answer

+2 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.1k
- Engineering Mathematics 4.5k
- Digital Logic 1.9k
- Programming & DS 3.3k
- Algorithms 2.9k
- Theory of Computation 3.6k
- Compiler Design 1.4k
- Databases 2.7k
- CO & Architecture 2.4k
- Computer Networks 2.7k
- Non GATE 901
- Others 1.2k
- Admissions 246
- Exam Queries 433
- Tier 1 Placement Questions 17
- Job Queries 42
- Projects 4

32,330 questions

39,146 answers

108,247 comments

36,501 users