The number of 1’s in the binary representation of below decimal number :
(5*512 + 7*64 + 3*8 + 1)
5 x 512 = (101)_2 x (2^9)→ number of 1s = 2
7 x 64 = (111)_2 x (2^6) → number of 1s = 3
3 x 8 = (11)_2 x (2^3) → number of 1s = 2
1 x 1 = (1)_2 × 1. → number of 1s = 1
Note : Multiplication by 2^n only shifts bits left, it does not change the number of 1s.
Total 1’s = 2+3+2+1=8