# Binary Conversions

### The Binary Numbering System

In everyday life, we normally use a numbering system that is constructed on multiples of ten. We call this numbering system the Base-10 or decimal numbering system. Base-10 numbering systems dictate that the numbering scheme begins to repeat after the tenth digit (in our case, the number 9). When we count, we usually count "0, 1, 2, 3, 4, 5 , 6, 7, 8, 9, 10, 11, 12, ..."

There's more to the numbering scheme than just counting, though. In grade school, we all were taught that each digit to the left and right of the decimal point is given a name which identifies that digit's placeholder. For right now, let's just consider digits to the left of the decimal, or positive numbers. Remember that the first digit to the left of the decimal point is called the "ones" digit. It is followed by the "tens" digit, followed by the "hundreds", followed by the "thousands", and on and on. What they probably didn't tell you in grade school is that each placeholder (ones, tens, hundreds, thousands, etc.) actually represents a multiple of ten (remember -- "Base-10"?).

Each placeholder can be represented by an exponent of ten. For instance, the expression 100 represents the "ones" position, the expression 101 represents the "tens" position, the expression 102 represents the "hundreds" position and so on.

We can begin to see this more clearly if we break down a number into exponents of ten. Let's take a look at the following number: 7408. Starting at the decimal point, we'll work our way left. The first digit to the left of the decimal point is 8. However, we can represent this using the arithmetic expression 100*8. Remember: Anything to the zero power is always equal to 1. If we were to calculate that last expression out it would look like this: 100*8=1*8=8. Examine the following table to see exponential expressions for the other digits:

Table 1: Decimal Placeholders
7 4 0 8
##### PositionName
Thousands Hundreds Tens Ones
##### Exponential Expression
103*7 102*4 101*0 100*8
##### Calculated Exponent
1000*7 100*4 10*0 1*8

Like the decimal numbering system, binary numbering is also based on powers of a number. However, unlike the decimal system (which is based on multiples of ten), the binary numbering system is based on multiples of two. It is a Base-2 numbering system. Remember -- when counting in decimal, the numbering scheme repeats after the tenth digit (the number 9). In binary numbering the numbering scheme repeats after the second digit (the number 1). Let's count to five in binary: "0, 1, 10, 11, 100, 101"

Also like the decimal numbering system, binary numbering includes names for digit placeholders. Instead of "ones, tens, hundreds, thousands, etc.", binary has "ones, twos, fours, eights, sixteens, etc." If the binary system is based on powers of 2, why is there still a "ones" position? Remember: Anything to the zero power is always equal to 1. So, in binary, the "ones" position is represented by the exponential expression 20! Take a look at the following table to see how the binary number 1101 is broken into exponential expressions:

Table 2: Binary Placeholders
1 1 0 1
##### PositionName
Eights Fours Twos Ones
##### Exponential Expression
23*1 22*1 21*0 20*1
8*1 4*1 2*0 1*1

### Binary to Decimal Conversions

So, how can I convert the binary number 1101 to a good-old decimal number? The best way to to this is construct a table in which you can do some simple arithmetic operations to solve the conversion! Let's try it!

1. First, I want to write the binary number in a row, separating the digits into columns:

2. ##### Number
1 1 0 1

3. Next, I want to decide whether each digit placeholder is "ON" or "OFF." The reason for this will become a little clearer in a few minutes, but for right now just remember that a "1" is "ON" and a "0" is "OFF." When we calculate the exponential expressions, we don't have to calculate any digit placeholders that are turned off:

1 1 0 1
##### ON/OFF
ON ON OFF ON

5. In the third step, we write the exponential expressions ("powers of two") that represent each placeholder and multiply each expression by 1. We do this only for the placeholders that are turned ON. For the placeholders which are turned OFF, we simply bring down the zero from the number itself:

1 1 0 1
ON ON OFF ON
##### Exponential Expression
23*1 22*1 0 20*1

7. Now, we can calulate the exponents to get a simple multiplication expression for each placeholder. Again, we do this only for placeholders which are turned "ON." Again, we bring down the zero if the placeholder is turned "OFF":

1 1 0 1
ON ON OFF ON
##### Exponential Expression
23*1 22*1 0 20*1
##### Calculated Exponent
8*1 4*1 0 1*1

9. In the fifth step, we solve the multiplication expressions from step #4. Again, we bring down any zeros for placeholders which are turned OFF:

1 1 0 1
ON ON OFF ON
##### Exponential Expression
23*1 22*1 0 20*1
##### Calculated Exponent
8*1 4*1 0 1*1
##### Solved Multiplication
8 4 0 1

11. In the final step, we add all the multiplication answers from step #5 together to get our decimal number!

1 1 0 1
ON ON OFF ON
##### Exponential Expression
23*1 22*1 0 20*1
##### Calculated Exponent
8*1 4*1 0 1*1
8 4 0 1
##### Add to Calculate Decimal Value
8+4+0+1=13

Let's take a look at another conversion. This time, we'll try 101101:

1 0 1 1 0 1
##### ON/OFF
ON OFF ON ON OFF ON
##### Exponential Expression
25*1 0 23*1 22*1 0 20*1
##### Calculated Exponent
32*1 0 8*1 4*1 0 1*1
32 0 8 4 0 1
##### Add to Calculate Decimal Value
32+0+8+4+0+1=45

Why not try some on your own? Convert the following from binary to decimal. Click the answers link for each table for that table's correct answers:

1 1 1

1 0 1 1

1 0 1 1 1

1 1 1 1 0 0

##### Add to Calculate Decimal Value

[Top of the Page]

### Decimal to Binary Conversions - Method I: Using Binary Exponential Placeholders

One method of converting from a decimal value to a binary value is to consider the values of the exponents that represent binary placeholders. Remember that each binary placeholder, like each decimal placeholder, can be represented by an exponential expression:

Table 3: Exponential Expressions for Binary Placeholders
##### Placeholder Exponential Expressions
27 26 25 24 23 22 21 20
##### Calculated Exponent
128 64 32 16 8 4 2 1

Okay, so how can we use the exponential expressions to convert from decimal to binary? For an example let's use the decimal number 97:

1. Similar to binary to decimal conversions, we are going to construct a table. We begin by finding the greatest binary placeholder exponential that is less than or equal to our decimal number. We put that exponential expression in the left-most column of our table. In this example, the 26 placeholder is the placeholder that we place in the left-most column. Since 26 is equal to 64, we know that it is less than 97 (our decimal number). The next placeholder, the 27 placeholder, is too big. 27 is equal to 128, which is greater than 97. Below the exponential, we put a "1":

2. Decimal Number: 97
##### Placeholder Exponential Expression
26 25 24 23 22 21 20
##### Calculated Exponent
64 32 16 8 4 2 1
##### 1/0
1

3. In the second step, we take the value of the exponent from step #1 and add it to the value of the next exponent to the right. If the sum is less than or equal to our decimal number, then we put a "1" underneath the second placeholder. Otherwise, we put a "0" underneath. For our example, we know that 26+25 is less than 97 (26=64, 25=32, 64+32=96, 96‹97). We put a "1" underneath 25:

4. Decimal Number: 97
##### Placeholder Exponential Expression
26 25 24 23 22 21 20
##### Calculated Exponent
64 32 16 8 4 2 1
##### 1/0
1 1

5. We continue to add the values of subsequent placeholders to the values of the placeholders under which we put a "1". If the result is less than or equal to our decimal value, we put a "1" underneath that placeholder. If the result is greater than our decimal value, then we put a "0" underneath:

##### Calculated Exponent
26+25+24?97
64+32+16?97
112?97
112>97
0 24 16
26+25+23?97
64+32+8?97
104?97
104>97
0 23 8
26+25+22?97
64+32+4?97
100?97
100>97
0 22 4
26+25+21?97
64+32+2?97
98?97
98>97
0 21 2
26+25+20?97
64+32+1?97
97?97
97=97
1 20 1

7. We now can transpose our 1s and 0s to our original table to find our binary number!

8. Decimal Number: 97
##### Placeholder Exponential Expression
26 25 24 23 22 21 20
##### Calculated Exponent
64 32 16 8 4 2 1
##### 1/0
1 1 0 0 0 0 1
Binary Number: 1100001

### Decimal to Binary Conversions - Method II: Using Division

The second method of converting from decimal to binary also involves constructing a table. This time, instead of using binary placeholder exponential expressions, we'll do some simple division. Again, let's use the decimal number 97 as our example:

1. The first step in the conversion is to take the decimal number and divide it by 2. Put the division expression in the upper left-most cell of our table. Take the quotient of the division result and put it in the second cell of the row. Put the remainder in the last cell of the row. Important: NEVER carry your divisions past the decimal point!

2. Decimal Number=97
##### Remainder
97/2 48 1

3. For each subsequent row, we take the quotient from the previous row and divide it by two. We put the new quotient in the second cell of the row and put the remainder in the last cell of the row:

4. Decimal Number=97
##### Remainder
97/2 48 1
48/2 24 0
24/2 12 0
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1

5. The last step in the proces is concerned only with the last column in our table -- the "Remainder" column. Notice that the remainder column only has ones or zeros. Also note that the cell in the remainder column of the last row must be a "1". If we read the 1s and 0s in the remainder column from the bottom to the top, we'll have our binary number!

6. Decimal Number=97
##### Direction
97/2 48 1
48/2 24 0
24/2 12 0
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1
Binary Number=1100001

### Decimal to Binary Exercises

Now, try some binary to decimal problems on your own. Try each of the following conversions. Below each are solutions to the conversions using Method I and Method II. Try each of the methods in doing the conversions: