Solution:In order to get the binary code of any number, one should always remember the below mentioned details –
Remember the sequence of numbers from right to left so on... 16, 8, 4, 2, 1
Now whichever number's binary code is to be determined write down 1 below that number (that number's conversion in the form of above numbers e.g. 7 = 4 + 2 + 1) and put 0 on rest. Some examples are as follows:
2 | 0 0 1 0 | (Hence binary code of 2 = 0010) |
3 | 0 0 1 1 | (Hence binary code of 3 = 0011) |
4 | 0 1 0 0 | (Hence binary code of 4 = 0100) |
5 | 0 1 0 1 | (Hence binary code of 5 = 0101) |
6 | 0 1 1 0 | (Hence binary code of 6 = 0110) |
7 | 0 1 1 1 | (Hence binary code of 7 = 0111) |
8 | 1 0 0 0 | (Hence binary code of 8 = 1000) |
9 | 1 0 0 1 | (Hence binary code of 9 = 1001) |
OR
Divide by 2 and record the remainder:
- 7÷2=3 remainder 1
- 3÷2=1 remainder 1
- 1÷2=0 remainder 1
- Read the remainders in reverse order: The remainders, from bottom to top, are 0,1,1,1.
Therefore, the binary code for 7 is 0111.
So by this method, you can calculate binary code of any given number. Hence option (b) is correct.