Binary To Decimal
Binary To Decimal
We simply add up the place values of each 1 digit in the binary number.
y
32 16 8 4 1 0 0 1 32 + 4
1 1 + 1 = 37
128 64 32 16 8 4 2 1 0 0 0 1 1 1 128 + 8 + 4 + 2
1 0 = 142
1111010002 = 48810:
Exponents Place Values 28 256 27 128 26 64 25 24 32 16 23 22 21 8 4 2 2
0
Bits Value
y
1 1 1 1 0 1 256 + 128 + 64 + 32 + 8
0 = 488
101101012 = 18110:
Exponents Place Values Bits Value 27 1 2 8 1 1 2 8 26 64 0 25 32 1 24 16 1 23 8 0 22 4 1 + 4 21 2 0 20 1 1 + 1 = 181
+ 32 + 16
start from the last digit, which is 1, multiply that digit with 2^0, note that the power of 0 of any 1*(2^0) number is always 1 11101 (current digit is in bold) process the previous digit, which is 0, multiply that digit with the increasing power of 2 0*(2^1)
11101 (current digit is in bold) process the previous digit, which is 1, note that 2^2 means 2*2 1*(2^2) 11101 (current digit is in bold) process the previous digit, which is 1, note that 2^3 means 2*2*2 1*(2^3) 11101 (current digit is in bold) process the previous digit, which is 1, note that 2^4 means 2*2*2*2 1*(2^4) 11101 (current digit is in bold) here, we stop because there's no more digit to process this number comes from thesum of the RESULTS ANSWER 29
16
Basically, this is the same as saying: 1*(2^4) + 1*(2^3) + 1*(2^2) + 0*(2^1) + 1*(2^0) or 1*(16) + 1*(8) + 1*(4) + 0*(2) + 1*(1) The reason it's easier to start backward is because:
y y
Counting the number of digits takes extra time, and you might count wrongly. If you don't remember what a particular power-of-2 value, it's easy to calculate it from the previous value. For instance, if you don't remember what the value of 2*2*2 is, then just double the value of 2*2 (which you already have if you had started backward).
0 2 0 8 10
Is constructing a table like above required? No, it just depends on your preference. Some people are visual, and the table might help. Without a table, it's also easy. If you want to be a speed counter, just remember that the value of the multiplier is always the double of the previous one. 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, ... POWER OF 2s 2^0 2^1 = 2 2^2 = 2*2 2^3 = 2*2*2 2^4 = 2*2*2*2 RESULT 1 2 4 8 16
Example Convert BINARY 1010001 to DECIMAL. Again, I'm starting backward here:
(1*1) + (0*2) + (0*4) + (0*8) + (1*16) + (0*32) + (1*64) = 1 + 0 + 0 + 0 + 16 + 0 + 64 = 81