1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What is 1/7 in base 2?

  1. Dec 7, 2009 #1
    What is 1/7 in base 2? How would you solve for this?

    Thanks!
     
  2. jcsd
  3. Dec 7, 2009 #2

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The same as it is in any other base.

    I assume you meant to ask how to compute its infinite binary expansion? Use long division.
     
  4. Dec 7, 2009 #3
    As perhaps a hint, what is 1/2 in binary?
     
  5. Dec 7, 2009 #4
  6. Dec 7, 2009 #5
    Just multiply your fraction by 2 repeatedly, writing a 0 for products less than 1, and a 1 for products greater than 1 (for the latter, subtract out 1 before continuing with the multiplication). For example:

    1/7 * 2 = 2/7
    2/7 * 2 = 4/7
    4/7 * 2 = 1 1/7
    1/7 * 2 = ... (repeats)

    The binary value is 0.(001), where () indicates the repeating part.

    For a little more detailed explanation, see heading "dec2bin_f()" in my article "http://www.exploringbinary.com/base-conversion-in-php-using-bcmath/". [Broken]
     
    Last edited by a moderator: May 4, 2017
  7. Dec 8, 2009 #6

    wouldn't it be:
    Code (Text):
    1/111
    But in decimal form it would be:
    Code (Text):
    0.100010111000001001
    I'm not sure if it's the correct answer though. My logic was to take the result of 1/7:

    Code (Text):
    0.142857
    remove the decimal (by multiplying it by 1,000,000) then converting that number to binary and then re-placing the decimal.

    Is my method correct?
     
  8. Dec 8, 2009 #7

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    sure but not real interesting.

    No your method is not correct nor is your result. See the post by DoctorBinary for the correct algorithm. Following his process the integer part of each computation yields a digit of the binary number.
     
  9. Dec 8, 2009 #8
    Perhaps another way to look at it, what is 0.537 as a decimal fraction? 5/10 + 3/102 + 7/103, so what is 0.111 as a binary fraction? 1/2 + 1/22 + 1/23 = 0.87510
     
  10. Dec 9, 2009 #9

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    But .111 is NOT the same as 1/111 in decimal or binary.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: What is 1/7 in base 2?
  1. What is -1^1/2 (Replies: 4)

Loading...