Example 1 : - (010101011)2 into (Decimal)10
Step 1: - Mark the MSB (Most Significant Bit) and LSB (Least Significant Bit.). The LSB is the number from the right hand side. In the given example the LSB is 1. Similarly we have to mark MSB. The MSB is a number from left hand side. In the given example the MSB is 0.
010101011
| |
MSB LSB
Step 2:- Multiply the each binary numbers with its base i. e 2 with the cumulative power from 0 to n.
0x2^8+1x2^7+0x2^6+1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+1x2^0
Step 3: - Now solve the equation.
=0x2^8+1x2^7+0x2^6+1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+1x2^0
=0+128+0+32+0+8+0+2+1
=(171)10
Step 4: - The (171)10 is the answer.
Now we take another example in this we learn how to convert binary numbers after decimal into decimal number system.
Example 2: - (1100.100)2 into (Decimal)10
Step 1: - Mark the MSB (Most Significant Bit) and LSB (Least Significant Bit.). In this example the seperate MSB and LSB marked for the number before the decimal and after the decimal. For the number before decimal the LSB is 0 and the number after the decimal the LSB is 1 from the right & left hand side respectively. Similarly In the given example for the number before decimal the MSB is 1 and the number after the decimal the MSB is 0 from the left & right hand side respectively.
1 1 0 0 . 1 0 0
| | | |
MSB LSB LSB MSB
Step 2:- Multiply the each binary numbers with its base i. e 2 with the cumulative power from 0 to n.
1x2^3+1x2^2+0x2^1+0x2^0.1x2^-1+0x2^-2+0x2^-3
Step 3: - Now solve the equation.
1x2^3+1x2^2+0x2^1+0x2^0.1x2^-1+0x2^-2+0x2^-3
= 8+4+0+0 (.) 1/2 + 1/4 + 1/8
= 8+4+0+0(.) (0.5+0.25+0.125)
= (12.875)10
Step 4: - The (12.875)10 is the answer.
0 comments:
Post a Comment