The number system with which you are probably most familiar is a base ten system. This simply means that there are ten possible symbols, or digits, which can be combined to represent a number. These are 0 through 9. If we want to represent a number higher than 9, we combine two digits. You may remember that the right-most digit is the "ones" digit, the next one is the "tens" digit, next is the "hundreds", etc. Note that each place is a subsequent power of 10: 1 = 10^0, 10 = 10^1, 100 = 10^2, 1000 = 10^3.

      Binary numbers work much the same way. The only difference is that only two digits exist: 0 and 1. Rather than each place being a power of 10, it is a power of 2. The right-most digit is the "ones" digit, next is the "twos" digit, then the "fours", then the "eights", etc. The power rule still holds: 1 = 2^0, 2 = 2^1, 4 = 2^2, 8 = 2^3.

      So it is a simple process to translate a number from decimal (base 10) to binary (base 2). Let's translate 654 into base 2. It's usually easiest to start out by writing out the values of the columns in base 2 first. Write out the columns until you hit a number that is larger than the number to be translated.
      1024 512 256 128 64 32 16 8 4 2 1
      Now it's just a simple matter of subtraction. There are no 1024's in 654, so we start with 512. There is one 512 in 654. So the first (left-most) digit of our binary number is a 1. Now, subtract.

       654
      -512
      ----
       142
      

      Now go back to our list of column values. The next number is 256. There are no 256's in 142, so the next digit of our binary number is a 0. We repeat this process all the way until we get to 1.

       142
      -128 - There's one 128 in 142, so we have another "1" digit.
      ----
        14 - Since 14 is smaller than 64, 32, and 16, we have a string of 3 "0"s.
      -  8 - There's one 8 in 14, so we have another "1" digit.
      ----
         6
      -  4 - There's one 4 in 6, so we have another "1" digit.
      ----
         2
      -  2 - There's one 2 in 2, so we have another "1" digit.
      ----
         0 - There are no 1's in 0, so we have another "0" digit.
      

      So our binary number is 1010001110.

      Translating from binary to decimal is even easier. This time, let's take the binary number 1100110. Start again with the list of binary columns. You'll need as many columns as there are digits in the number.
      64 32 16 8 4 2 1
      Now, simply multiply each digit in the binary number by the corresponding column, and add all the values together.
      1*64 + 1*32 + 0*16 + 0*8 + 1*4 + 1*2 + 0*1 = 64 + 32 + 4 + 2 = 102.

      Once you understand how to translate between binary and decimal, any other number system is easy. You follow the exact same procedure, making sure that your list of columns is composed of powers of the base number. So, for trinary (base 3), your list might be: 729 243 81 27 9 3 1. Keep in mind that when using base 3, you can use 3 digits: 0, 1, and 2. So you may end up with a number from your list going into the translated number twice, i.e. 486 in base 3 is 200000.

      [Bar]

      [Back] [TOC] [Think Quest]

      Back | Table of Contents | ThinkQuest