Binary Conversions [Binary to Decimal,Decimal to Binary (Method I) ,Decimal to Binary (Method II)

0 views
Skip to first unread message

Vipin Hole

unread,
Sep 21, 2013, 6:35:22 AM9/21/13
to bsc...@googlegroups.com

Binary Conversions

[Binary to Decimal | Decimal to Binary (Method I) | Decimal to Binary (Method II)]

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
Number
7408
Position
Name
ThousandsHundredsTensOnes
Exponential 
Expression
103*7102*4101*0100*8
Calculated 
Exponent
1000*7100*410*01*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
Number
1101
Position
Name
EightsFoursTwosOnes
Exponential 
Expression
23*122*121*020*1
Calculated 
Exponent
8*14*12*01*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
    1101


  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:


  4. Number
    1101
    ON/OFF
    ONONOFFON


  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:


  6. Number
    1101
    ON/OFF
    ONONOFFON
    Exponential 
    Expression
    23*122*1020*1


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


  8. Number
    1101
    ON/OFF
    ONONOFFON
    Exponential 
    Expression
    23*122*1020*1
    Calculated 
    Exponent
    8*14*101*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:


  10. Number
    1101
    ON/OFF
    ONONOFFON
    Exponential 
    Expression
    23*122*1020*1
    Calculated 
    Exponent
    8*14*101*1
    Solved 
    Multiplication
    8401


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


  12. Number
    1101
    ON/OFF
    ONONOFFON
    Exponential 
    Expression
    23*122*1020*1
    Calculated 
    Exponent
    8*14*101*1
    Solved 
    Multiplication
    8401
    Add to Calculate 
    Decimal Value
    8+4+0+1=13


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

Number
101101
ON/OFF
ONOFFONONOFFON
Exponential 
Expression
25*1023*122*1020*1
Calculated 
Exponent
32*108*14*101*1
Solved 
Multiplication
3208401
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:

Number
111
ON/OFF
   
Exponential 
Expression
   
Calculated 
Exponent
   
Solved 
Multiplication
   
Add to Calculate 
Decimal Value
 
Answer
Number
1011
ON/OFF
    
Exponential 
Expression
    
Calculated 
Exponent
    
Solved 
Multiplication
    
Add to Calculate 
Decimal Value
 
Answer
Number
10111
ON/OFF
     
Exponential 
Expression
     
Calculated 
Exponent
     
Solved 
Multiplication
     
Add to Calculate
Decimal Value
 
Answer
Number
111100
ON/OFF
      
Exponential 
Expression
      
Calculated 
Exponent
      
Solved 
Multiplication
      
Add to Calculate 
Decimal Value
 
Answer
[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 
Name
One-Hundred 
Twenty-Eights
Sixty-Fours
Thirty-Seconds
Sixteens
Eights
Fours
Twos
Ones
Placeholder Exponential 
Expressions
2726252423222120
Calculated 
Exponent
1286432168421

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
    26252423222120
    Calculated 
    Exponent
    6432168421
    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
    26252423222120
    Calculated 
    Exponent
    6432168421
    1/0
    11     


  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 thanour decimal value, then we put a "0" underneath:


  6. Expression
    1 or 0?
    Placeholder 
    Exponential 
    Expression
    Calculated 
    Exponent
    26+25+24?97 
    64+32+16?97 
    112?97 
    112>97
    02416
    26+25+23?97 
    64+32+8?97 
    104?97 
    104>97
    0238
    26+25+22?97 
    64+32+4?97 
    100?97 
    100>97
    0224
    26+25+21?97 
    64+32+2?97 
    98?97 
    98>97
    0212
    26+25+20?97 
    64+32+1?97 
    97?97 
    97=97
    1201


  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
    26252423222120
    Calculated 
    Exponent
    6432168421
    1/0
    1100001
    Binary Number: 1100001

[Top of the Page | Decimal to Binary Exercises]




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
    Division Expression
    Quotient
    Remainder
    97/2481


  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
    Division Expression
    Quotient
    Remainder
    97/2481
    48/2240
    24/2120
    12/260
    6/230
    3/211
    1/201


  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
    Division Expression
    Quotient
    Remainder
    Direction
    97/2481
    48/2240
    24/2120
    12/260
    6/230
    3/211
    1/201
    Binary Number=1100001

[Top of the Page | Decimal to Binary Exercises]


Reply all
Reply to author
Forward
0 new messages