How do you convert a fraction to binary?

1/10(decimal) = 0.0001100110011... (binary)

How do I do that? Am I supposed to convert to binary and then divide? Could someone show me?


In university I learned it this way:

  1. Multiply by two
  2. take decimal as the digit
  3. take the fraction as the starting point for the next step
  4. repeat until you either get to 0 or a periodic number
  5. read the number starting from the top - the first result is the first digit after the comma

Example:

0.1 * 2 = 0.2 -> 0
0.2 * 2 = 0.4 -> 0
0.4 * 2 = 0.8 -> 0
0.8 * 2 = 1.6 -> 1
0.6 * 2 = 1.2 -> 1
0.2 * 2 = 0.4 -> 0
0.4 * 2 = 0.8 -> 0
0.8 * 2 = 1.6 -> 1
0.6 * 2 = 1.2 -> 1
Result: 0.00011(0011) periodic.

 1              1
-- (dec)  =   ---- (bin)
10            1010


       0.000110011...
      -------------
1010 | 1.0000000000
         1010
       ------
         01100
          1010
         -----
          0010000
             1010
            -----
             01100
              1010
             -----
              0010

This may be somewhat confusing, but the decimal positions in binary would represent reciprocals of powers of two (e.g., 1/2, 1/4, 1/8, 1/16, for the first, second, third and fourth decimal place, respectively) just as in decimal, decimal places represent reciprocals of successive powers of ten.

To answer your question, you would need to figure out what reciprocals of powers of two would need to be added to add up to 1/10. For example:

1/16 + 1/32 = 0.09375, which is pretty close to 1/10. Adding 1/64 puts us over, as does 1/128. But, 1/256 gets us closer still. So:

0.00011001 binary = 0.09765625 decimal, which is close to what you asked.

You can continue adding more and more digits, so the answer would be 0.00011001...