ISRO-2007
August 18, 2024Compiler-Design
August 20, 2024ISRO-2007
Question 17 |
The number of digit 1 present in the binary representation of
3 × 512 + 7 × 64 + 5 × 8 + 3
8 | |
9 | |
10 | |
12 |
Question 17 Explanation:
3 × 512 + 7 × 64 + 5 × 8 + 3
= (2 + 1)× 512 + (4 + 2 + 1)× 64 + (4 + 1)× 8 + 2 + 1
= 1024 + 512 + 64 x 4 + 64 x 2 + 64 + 32 + 8 + 2 + 1
= 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 2 + 1
As 1024 has ten 0’s followed by 1, 512 has nine 0’s followed by 1 and so on..
So, the expression will contain total nine 1’s and will be be represented as 11111101011.
= (2 + 1)× 512 + (4 + 2 + 1)× 64 + (4 + 1)× 8 + 2 + 1
= 1024 + 512 + 64 x 4 + 64 x 2 + 64 + 32 + 8 + 2 + 1
= 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 2 + 1
As 1024 has ten 0’s followed by 1, 512 has nine 0’s followed by 1 and so on..
So, the expression will contain total nine 1’s and will be be represented as 11111101011.
Correct Answer: B
Question 17 Explanation:
3 × 512 + 7 × 64 + 5 × 8 + 3
= (2 + 1)× 512 + (4 + 2 + 1)× 64 + (4 + 1)× 8 + 2 + 1
= 1024 + 512 + 64 x 4 + 64 x 2 + 64 + 32 + 8 + 2 + 1
= 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 2 + 1
As 1024 has ten 0’s followed by 1, 512 has nine 0’s followed by 1 and so on..
So, the expression will contain total nine 1’s and will be be represented as 11111101011.
= (2 + 1)× 512 + (4 + 2 + 1)× 64 + (4 + 1)× 8 + 2 + 1
= 1024 + 512 + 64 x 4 + 64 x 2 + 64 + 32 + 8 + 2 + 1
= 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 2 + 1
As 1024 has ten 0’s followed by 1, 512 has nine 0’s followed by 1 and so on..
So, the expression will contain total nine 1’s and will be be represented as 11111101011.
Subscribe
Login
0 Comments