Results 1 to 1 of 1

Math Help - Base conversion from any radix base to any other radix base

  1. #1
    Newbie
    Joined
    Jan 2010
    Posts
    4

    Base conversion from any base to any other base

    Hello Math Help Forum members --

    I've searched Google in vain, trying to determine a simple algorithm for converting any number in any base, to any other number in any other base. (For example -- 1234 base 3 to base 14).

    Right now, I can convert from base 10 number to any other base, and any base to base 10. I'm going to describe what I do below for documentation's sake --

    To convert from base 10 number to any other base, I simply continuously divide the number by the base to convert to, and the remainders become the number in the new base (basically, I use long division). Simple example -- 123 base 10 in base 16 (hex).

    Steps I take --

    * Divide number to convert by new base, writing out remainder: Divide 123 by 16, get 7 R 11.
    * Divide result from last division by new base, writing out remainder: Divide 7 by 16, get 0 R 7.
    * The remainders are 11 and 7. "11" in hex is actually B, so the remainders are B and 7. Print this out in reverse and you have 7B. That is the answer.

    To convert from a number in any base to base 10, I multiply each "place" in the number, starting from the right, by the new base raised to the "place" number. Then I add the results together. Simple example -- 7B base 16 (hex) in base 10.

    Steps I take --

    * Multiply number on very right by base raised to placeholder number: B x (16^0) = (11) * (1) = 11
    * Multiply next number, going left, by base raised to placeholder number: 7 x (16^1) = (7) * (16) = 112
    * Add products: 11 + 112 = 123

    My question is: How do I reliably go from base x to base y on paper, if they do not fall into these two categories? I can't figure it out! I've searched for a day. I have a feeling it requires converting the number to base 10, using my second method, and converting that to the new base. But is there a shortcut? And if there is not, what is the theory behind why, on paper, you can't do a direct conversion?

    Thanks for any and all help.
    Last edited by andrewtheart; January 29th 2010 at 09:07 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: December 13th 2011, 04:21 AM
  2. Base Conversion - Negative Base
    Posted in the Number Theory Forum
    Replies: 7
    Last Post: August 3rd 2010, 05:13 AM
  3. Replies: 4
    Last Post: May 26th 2010, 01:36 PM
  4. Replies: 2
    Last Post: April 24th 2010, 07:38 PM
  5. Replies: 1
    Last Post: March 7th 2010, 06:14 PM

Search Tags


/mathhelpforum @mathhelpforum