Base to Base Conversion Techniques

Quick Links

Engineering is (as is programming) all about finding solutions to a problem and then choosing the one most appropriate for the circumstances as dictated by a set of restrictions. These constraints can be any of the following:

Conversion from one numeration system (base) to another provides an excellent example of how these factors can interrelate.

Different Bases

Most humans have used in the past and still use the decimal, base 10, numeration system. Computer programmers and engineers, on the other hand, use binary, octal, and hexadecimal, bases 2, 8, and 16, respectively. Binary is used inside computers because it has only two digits, 0 and 1. This makes designing hardware much easier than if base 10 were used. Octal and hexadecimal were introduced as shorthand for humans to discuss and transmit data orally, because binary representations of numbers very rapidly get very long, i.e., they have lots of digits even to represent numbers which are not very large. For example, while we can count up to 9 before we have to use two digits to represent a number, in binary you can only count up to 1. This results in 25610 being represented by 1000000002.

As with any project, the first goal is to find a solution which actually works. This can be done in a hit-and-miss fashion or with (sometimes) considerable thought and preparatory work.

A prerequisite to converting between systems is understanding what place value means. (See the Numeration Systems page for some details.)

Evaluating Algorithms

Once you understand place value, you are ready to evaluate the four algorithms whose links are given at the top of this page.

Print out and fill in the Evaluation of Conversion Algorithms worksheet, working from left to right for each of the four methods. Leave the rightmost column blank until you understand how the various algorithms work.

If you are new to numeration systems, it is probably best to evaluate the algorithms by converting between decimal and quinary (base 5). Quinary can be understood by relating it to money: the ones, fives, and twenty-fives digits correspond to pennies, nickels, and quarters, respectively. Using this conceptualization, the fewest number of these coins which can be used to constitute 38 cents (decimal) is 1 quarter, 2 nickels and 3 pennies. Thus, 3810 = 1235.


© 2006 DFStermole
Created 11 Mar 06
Last Modified 25 Mar 06