Convert decimal into binary
Example 7:
We have to find out binary value in given decimal number 30 and tell me which class it comes from ?
Note: You should always follow from left to right
Solution:
It comes from class A value given in above
Base position 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Decimal value 128 64 32 16 8 4 2 1
Binary value 0 0 0 1 1 1 1 0
After completing we can check by adding all "1"s given below;
16 + 8 + 4 + 2 = 30
Rough note:
We can do this adding method given below;
Decimal calculations Bit in binary
128 is greater than 30 off the bit
0 + 64 = 64 is greater than to 30 off the bit
0 + 0 + 32 = 32 is greater than 30 off the bit
0 + 0 + 0 + 16 = 16 is less than 30 on the bit
0 + 0 + 0 + 16 + 8 = 24 is less than 30 on the bit
0 + 0 + 0 + 16 + 8 + 4 = 28 is less than 30 on the bit
0 + 0 + 0 + 16 + 8 + 4 + 2 = 30 is equivalent to 30 on the bit
0 + 0 + 0 + 16 + 8 + 4 + 2 + 1 = 31 is greater than 30 off the bit
This is another way of doing through subtracting method which is done in a simple and easy way given below;
Decimal calculation Bit in binary
30 - 128 cannot be subtracted off the bit
30 - 64 cannot be subtracted off the bit
30 - 32 cannot be subtracted off the bit
30 - 16 = 14 is less than 30 on the bit
14 - 8 = 6 is less than 30 on the bit
6 - 4 = 2 is less than 30 on the bit
2 - 2 = 0 is less than 30 on the bit
0 - 1 cannot be subtracted off the bit
Therefore, this is our binary value 00011110.
Example 7:
We have to find out binary value in given decimal number 30 and tell me which class it comes from ?
Note: You should always follow from left to right
Solution:
It comes from class A value given in above
Base position 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Decimal value 128 64 32 16 8 4 2 1
Binary value 0 0 0 1 1 1 1 0
After completing we can check by adding all "1"s given below;
16 + 8 + 4 + 2 = 30
Rough note:
We can do this adding method given below;
Decimal calculations Bit in binary
128 is greater than 30 off the bit
0 + 64 = 64 is greater than to 30 off the bit
0 + 0 + 32 = 32 is greater than 30 off the bit
0 + 0 + 0 + 16 = 16 is less than 30 on the bit
0 + 0 + 0 + 16 + 8 = 24 is less than 30 on the bit
0 + 0 + 0 + 16 + 8 + 4 = 28 is less than 30 on the bit
0 + 0 + 0 + 16 + 8 + 4 + 2 = 30 is equivalent to 30 on the bit
0 + 0 + 0 + 16 + 8 + 4 + 2 + 1 = 31 is greater than 30 off the bit
This is another way of doing through subtracting method which is done in a simple and easy way given below;
Decimal calculation Bit in binary
30 - 128 cannot be subtracted off the bit
30 - 64 cannot be subtracted off the bit
30 - 32 cannot be subtracted off the bit
30 - 16 = 14 is less than 30 on the bit
14 - 8 = 6 is less than 30 on the bit
6 - 4 = 2 is less than 30 on the bit
2 - 2 = 0 is less than 30 on the bit
0 - 1 cannot be subtracted off the bit
Therefore, this is our binary value 00011110.
No comments:
Post a Comment