Conversion from Binary to Decimal and Decimal to Binary the Easy way

Ip addressing is a vital knowledge for all the IT and non IT people that are involved with networks, from large enterprise networks to small home networks.

To fully understand Ip addressing it’s necessary to be familiar with binary mathematics and conversions, from the decimal mathematic system to binary and vise versa. I will try to present you an easy procedure that can be used when doing conversions.

Binary to decimal

Binary numbers that are associated with Ip addressing always have eight digits (I like to call these digits “spaces”).
For example the number 11010101 as you can see is an eight digit number.
Now let’s try to convert this number into decimal:


1. Draw eight spaces

Binary to Decimal

2. Apply the decimal value of every space, as shown below

Binary to Decimal

3. Then apply the binary number of our example to it

Binary to Decimal

4. Then add the decimal values of the spaces that have got a binary digit of 1

128 + 64 + 16 + 4 + 1 = 213

5. The decimal equivalent of the binary 11010101 is 213

Now that you can convert a binary number into decimal lets try to do the vise versa.

Decimal to Binary

1. Draw eight spaces

Decimal to Binary

2. Apply the decimal value of its one below

Decimal to Binary

3. Think of the decimal number that you would like to convert (It must be a number from 0 to 255). Let’s pick for example 185. Now think “Can I subtract 185 from the first decimal value of the first space?” The answer is yes; the value is 185 and can be subtracted from 128. Put a 1 above the space of 128 like this:

Decimal to Binary

4. Do the subtraction 185-128= 57. Now think “Can I subtract the value of the second space from 57?” The answer is no; you can’t subtract 64 from 57 (The total must not be a negative number). Put a 0 above the space of 64 like this:

Decimal to Binary

5. Now think “Can I subtract the value of the third space from 57?” The answer is yes; you can subtract 32 from 57. Put a 1 above the space of 32 like this:

Decimal to Binary

6. Do the subtraction 57-32= 25. Now think “Can I subtract the value of the forth space from 25?” The answer is yes; you can subtract 16 from 25. Put a 1 above the space of 16 like this:

Decimal to Binary

7. Do the subtraction 25-16= 9. Now think “Can I subtract the value of the fifth space from 9?” The answer is yes; you can subtract 8 from 9. Putt a 1 above the space of 8 like this:

Decimal to Binary

8. Do the subtraction 9-1= 1. Now think “Can I subtract the value of the sixth space from 1?” The answer is no; you can’t subtract 4 from 1 (The total must not be a negative number). Put a 0 above the space that has a decimal number of 4 like this:

Decimal to Binary

9. Now think “Can I subtract the value of the seventh space from 1?” The answer is no; you can’t subtract 2 from 1 (The total must not be a negative number). Put a 0 above the space that has a decimal value of 2 like this:

Decimal to Binary

10. Now think “Can I subtract the value of the eighth space from 1?” The answer is yes; you can subtract 1 from 1. Put a 1 above the space of 1 like this:

Decimal to Binary

Now the decimal number has been converted into binary.

Keep practicing with conversions. It gets easier and faster with practice!

Hope that this was the fastest and most efficient way for me to explain to you the conversions.

RSS feed | Trackback URI

6 Comments »

Comment by Indiana Jones
2007-09-23 10:42:35
 
Comment by Steve
2007-09-25 12:16:24

Great article, but I suspect that you mean to say “subtract” instead of “abstract”?

Comment by Jim Skenderlis
2007-09-28 19:02:24

Thank you very much for your clarification. Really helps us when we make such mistakes due to the fact that English is not our mother language. Changes applied.

 
 
Comment by Shirl
2007-10-29 02:36:27

This was exactly what I was looking for. Thanks a lot!

 
Comment by haja
2007-11-02 19:12:32

Great!

 
Comment by jaybee
2008-06-26 12:00:38

,,nice galing hehehehe

 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> in your comment.

Close
E-mail It

Proudly hosted @ Web Hosting @ InterServed