Largest number with n bits
The largest number we can make with n bits where n is the number of bits we use can be found by the formula (2^n)-1 where n is the number of bits used. This is always one less than the number of different
combinations that can be made with n bits because one combination it males is 0.
Converting binary to decimal
For our example let's convert the binary number 01001011 to it's decimal equivalent.
The first step is to draw out a table and fill it in with the column headings for binary. Remember, the column headings in binary start at 1 on the right and double as you move left like below.
Then it's just a matter of adding up the column headings of the columns that have a 1 in them.
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
64 + 8 + 2 + 1 = 75
Test yourself
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
Click the button to generate a binary number to convert
Decimal to binary example
For our example let's convert the decimal number 113 to it's binary equivalent.
The first step is to draw out a table and fill it in with the column headings for binary. Remember, the column headings in binary start at 1 on the right and double as you move left like below.
We start on the left. If the column heading is bigger than our number we put a 0 in that column and carry on.
If the column heading is equal to or smaller than our number we put a 1 in it. Then subtract the column heading from our number such as in this case 113 - 64 = 49
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
0 |
1 |
1 |
|
|
|
|
|
And we carry on following those same two rules until we have a total of 0, then any remaining columns are 0s
So to continue our example 49 - 32 = 17
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
0 |
1 |
1 |
1 |
|
|
|
|
17-16 = 1
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
0 |
1 |
1 - 1 = 0
So 113 in binary is 01110001
Test yourself
Make sure to include leading zeros. if you start on the left then the cursor will automatcally move to the next box after you type a 1 or 0
Click the button to get a number to convert
<< Previous: Units Next: Hexadecimal >>