31....
Why?
24 + 23 + 22 + 21 + 20 = 16 + 8 + 4 + 2 + 1 = 31
or
25 - 1 = 31
-------------------------------------------------------------------
You can calculate the decimal equivalent of any binary number by adding the powers of two that correspond to each place that a binary digit '1' is in.
With decimal numbers, as you move left one digit, from the rightmost digit, you multiply that digit's value by 10. In binary, you multiply that place value by 2.
For any eight bit binary number (or less) here are the multiples of 2. We always start with (n-1) for the leftmost exponent, because you have to remember that the rightmost exponent is always 0.
27 + 26 + 25 + 24 + 23 + 22 + 21 + 20
which correspond with the following decimal numbers:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
All you have to do is add the decimal numbers that correspond with the each binary digit 1 is in.
ie. 10000000 (binary) = 128
11000000 (binary) = 128 + 64 = 192
FYI here are the decimal equivalents for four bit binary numbers:
0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = 10 = a (in hexadecimal)
1011 = 11 = b (in hexadecimal)
1100 = 12 = c (in hexadecimal)
1101 = 13 = d (in hexadecimal)
1110 = 14 = e (in hexadecimal)
1111 = 15 = f (in hexadecimal)
Chat with our AI personalities