Convert Decimal to Binary and Vice Versa

12,297

23

9

About: http://twitter.com/Mr_Red_Beard

Intro: Convert Decimal to Binary and Vice Versa

This is a technique that helped me out a lot when learning about AND OR NOR gates, creating subnet masks and helped me pass time seeing how high I could get with the binary sequence (not very far). I was able to teach my son this method when he was 7 or 8.

I plan to eventually make this a Computer Science Collection of Instructables to help teach kids. If anyone would like to help out, provide suggestions and/or write Instructables for this collection let me know.

I keep seeing my Assembly Language Quick Reference Guide on my desk.... There's nothing quick about Assembly at least not for me.

Step 1: Binary Sequence

The key to this method is laying out the numbers binary sequence which is powers of 2 since binary is base 2. This that much more difficult than counting by 2's. Note that we use base 10 considering we have 10 digits and computers at their lowest level use base 2. People argue that some computers use base 16 but remember that a switch is either on or off, 1 or 0. The numbers will need to be from right to left the lowest number to the highest number. This is illustrated by the second picture in the collection.

Step 2: Binary to Base 10

Here we will use the sequence table (2nd Image) to find the base 10 number. Use the visual (1st image) to get a better idea of how this works.

So here you have a given binary number.

  1. You will fill in the table from right to left with the 1's & 0's from the binary number.
  2. You will find the decimal numbers that have a 1 and not a zero. Remember that 1 is on and 0 is off.
  3. Add the decimal numbers you found in the previous step together to get the decimal value of the binary number that you were given.

Step 3: Decimal to Binary

Here we will use the sequence table (2nd Image) to find the base 2 number. Use the visual (1st image) to get a better idea of how this works.

So here you have a given decimal (base 10) number.

  1. Find the highest number that will go into your given decimal number.
  2. Place a 1 in the table for each number that you were able to subtract.
  3. Subtract that number from your decimal number.
  4. Find the next highest number that will go into the number from number 3.
  5. Repeat steps 1-5 until you have a zero remainder.
  6. Your binary number will not start with zero but everywhere else that you have a blank fill in a zero (see example)

Step 4: Try It for Yourself

Share

    Recommendations

    • Audio Contest 2018

      Audio Contest 2018
    • Plastics Contest

      Plastics Contest
    • Optics Contest

      Optics Contest

    9 Discussions

    0
    None
    tomatoskins

    3 years ago on Introduction

    Oh so many memories from my Computer Architecture class. Writing in assembly isn't the most fun or happiest of things.

    But this is definitely a good way of doing this!

    3 replies
    0
    None
    Battlespeed

    3 years ago on Introduction

    It's good for kids to do this kind of exercise a few times so they understand the logic behind number system relationships, but for actual coding I'd want them to use a calculator for conversions.

    2 replies
    0
    None
    BattlespeedMrRedBeard

    Reply 3 years ago on Introduction

    Same basic idea with any form of math. Kids should not do their work on a calculator until they know how to solve problems "manually", which requires them to understand the logic of problem solving.

    0
    None
    MrRedBeardhegure_ryu

    Reply 3 years ago on Introduction

    Haha I have to review it before I finish up the hex instructions. The binary was easy because I had committed it to memory.