The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Converting any Number Base to Another

Date: 05/11/2001 at 10:38:58
From: Trish
Subject: Converting any number base to another

Dear Dr. Math,

This site has been extremely useful; however, I am still having 
problems with the concept of number systems and their conversion from 
one to another. How can you convert numbers from any base into any 
other base?

Q1) Is there a particular technique for the conversion of any number 
base into any other base?

In addition to the above I also require information on basic numeric 
calculations within a base 5 system.

I have played around with this and think the technique is correct, 
except for division; however, I could really use some input.

     - 24113
        4403 (base 5)

     + 24113
      102134 (base 5)

     x    2
      10424 (base 5)
Q2) How do I apply basic calculation of addition, subtraction, 
multiplication, and division in base 5?

I would really appreciate the least complex answer you could give.

Hope to hear from you soon. Regards,

Date: 05/11/2001 at 14:43:56
From: Doctor TWE
Subject: Re: Converting any number base to another

Hi Trish! Thanks for writing to Dr. Math.

A good place to start learning about different bases is the Dr. Math 
Number Bases FAQ at:   

Some good archive entries to look at for how to convert to and from 
another base to decimal (base 10) are:

   Binary Conversion   

   Converting Binary to and From Decimal   

   Converting Bases   

   Mensa: Numbering for an Alternate World   

In order to convert directly from one base to another, you have to be 
able to do arithmetic either in the base you are going to, or the base 
you are going from. Thus if you want to convert, for example, a value 
in base 12 to base 5 directly, you'd have to be comfortable either with 
addition and multiplication in base 5, or with subtraction and division 
in base 12. Since most people aren't that comfortable with alternate 
base arithmetic, I'd recommend doing this in two steps: first convert 
from base 12 to base 10 (our familiar decimal system), then convert 
from base 10 to base 5. For example, if I wanted to convert 3A7 (base 
12) to base 5, I would first convert to decimal:

     144   12   1
     ---   --   -
      3     A   7   =      3 * 144 = 432
            ^           + 10 *  12 = 120
          A=10          +  7 *   1 =   7
                                     559 (base 10)

Then I'd convert 559 to base 5:

     5 ) 559
     5 ) 111 r 4
      5 ) 22 r 1
       5 ) 4 r 2
           0 r 4   =   4214 (base 5)

As for doing arithmetic in other bases, check out:

   Adding in Base 9 and Base 5   

   Binary Subtraction   

   Binary Operations   

   Operations in Nondecimal Bases   

   Multiplying and Dividing Computer Style   

   Long Division in Binary   

   Fraction/Decimal Conversion to Other Bases   

If you are still confused or have any further questions, write back. 
I hope this helps. 

- Doctor TWE, The Math Forum   

Date: 06/06/2001 at 11:27:27
From: Trish
Subject: Full Marks on Assignment, Thanks 
Thank you so very much for all your help with my questions relating to 
base conversion.

With the information Dr. Math provided and the book _A Survey of 
Mathematics_, by Vivian Shaw Groza (Holt, Rinehart & Winston, New York, 
1968), I managed to complete the assignment and obtain full marks.

Thanks again,
Associated Topics:
High School Number Theory

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.