Binary Math for Everyone
See also my HEX2DEC page for a
better understanding of conversion between different base numbers.
This is just a quick primer for those wanting to learn how to convert by hand between binary and decimal.
Binary numbers are composed of only 1 and 0. Every positive decimal interger can be expressed in binary.
By contrast, decinal numbers are composed of 0 through 9.
Here is a binary number:
0001101100
To convert this to a decimal number we need to define the placement of the numbers.
| DEC |
512 |
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
| BIN |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
- The Ones position is equal to 1.
- The Tens position is equal to 2.
- The Hundreds position is equal to 4.
- The Thousands position is equal to 8.
- The Ten Thousands position is equal to 16.
- The Hundred Thousands position is equal to 32.
- The Millions position is equal to 64.
- The Ten Millions position is equal to 128.
- The Hundred Millions position is equal to 256.
- The Billions position is equal to 512.
- Reading from left to right, we have a one in the Millions posistion so we start with 64.
- Next, there is a one in the Hundred Thousands posistion so we add 32 to 64 and get 96.
- We have a zero in the Ten Thousands position so we do not add 16 and we are left with 96 still.
- There is a one in the Thousands posistion so we add 8 to 96 and get 104.
- The one in the Hundreds position adds 4 to 104 to get 108.
- There are no ones in the Tens or the Ones posistion. Our final is 108.
- Binary 1101100 equals Decimal 108.
- 1 = 1
- 2 = 10
- 3 = 11
- 4 = 100
- 5 = 101
- 6 = 110
- 7 = 111
- 8 = 1000
- 9 = 1001
- 10 = 1010
Here is a decimal number:
234
To convert this to binary, we need to find the highest of the of these numbers 512, 256, 128, 64, 32, 16, 8, 4, 2, or 1 that is less than the number we are looking at.
| DEC |
512 |
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
| BIN |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
- First we find that 512 and 256 are bigger than 234 but 128 is not. So we place a one in the 128 column.
- We subtract 128 from 234 and get 106. We put a one in the 64 column because it is smaller than 106.
- We subract 64 from 106 and get 42. We put a one in the 32 column because it is smaller than 42.
- We subract 32 from 42 and get 10. We put a zero in the 16 column because it is bigger than 10. We can put a 1 in the 8 column because it is smaller than 10.
- We subract 8 from 10 and get 2. We put a zero in the 4 column because it is bigger than 2. We put a one the 2 column because it is equal to 2.
- We subtract 2 from 2 and get zero. We put a zero in the 1 column because it is smaller than 0.
- Decimal 234 equals Binary 11101010.