Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Converting rational number to a new base.

  1. Jan 27, 2009 #1

    I found one excercise - convert a rational number 63/64(base - 10) to a number system with a base of 4 using Radix conversion.

    Searching throught the internet i found this formula (i hope it`s the correct one :) ) -
    http://img255.imageshack.us/img255/903/races3.jpg [Broken]

    Unlike integer type conversion formula, this is a little unclear. As i understand - the "C" is the number that i want to convert and "r" is the new base, but how many steps do i need to perfom (in the formula i = -1,-2,-3,-4....-n )? And how exactly do i sum these coefficients C?

    Thanks in advance.
    Last edited by a moderator: May 3, 2017
  2. jcsd
  3. Jan 29, 2009 #2
    maybe someone has another idea how to turn 63/64 into a number with a base of 4?
  4. Jan 29, 2009 #3


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If the problem asks you to use Radix conversion (I have no idea what that is), perhaps you should learn how that works shouldn't you? Is this for a course on number theory?
  5. Feb 11, 2009 #4
    Last edited by a moderator: Apr 24, 2017
  6. Feb 11, 2009 #5
    Is it just this this problem you want to solve or are you looking for a general solution for all repeating decimals? For this problem, since the denominator is a perfect power of the base, all that needs to be done is convert the numerator to base 4 and shift the decimal to the left by the number of places equal to the power.
  7. Feb 11, 2009 #6
    Yes. Or think of it this way...

    in decimal, one position to the left of the decimal is the 10^0 place, two positions is the 10^1 place, etc. One position to the right of the decimal is the 10^-1 place, two positions is the 10^-2 place, etc.

    To write the number 63/64 in decimal, we look for a sum of the form a10^0 + b10^-1 + c10^-2 + ...

    For 63/64, we com e up with 0.984375 because 9*10^-1, 8*10^-2, 4*10^-3, 3*10^-4, 7*10^-5, and 5*10^-6 all add up to give 63/64.

    To do 63/64, all you have to do is replace 10 with 4 and find new constants. An example:

    (7+13/16) = (1)(4) + (3)(1) + (3)(1/4) + (1)(1/16) so you would get 13.31 as your answer.
  8. Feb 11, 2009 #7


    User Avatar
    Science Advisor

    It's not quite clear to me what you mean. You talk about rational numbers and give an example in which the number as a fraction. Do you mean write it as a fraction (just convert numerator and denominator) in the new base, or in "decimal" (not quite the right word!) form in base 4?

    For the example 63/64, 64= 43 so it is 10004. 63 is one less than 64 so it is 3334. As a fraction 63/64= (333/1000)4. That, of course, is 0.3334.

    If the denominator were not a power of 4, that division would be considerably harder!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook