title: How to convert an integer fractional part to the correspondent binary fractional part in assembly 8086
body: <p>For example, on the paper if I have: </p>
  
  <blockquote>
    <p>14.6875</p>
  </blockquote>
  
  <p>in decimal notation, it's simple obtaining the binary notation's counterpart: </p>
  
  <blockquote>
    <p>1101.1011</p>
  </blockquote>
  
  <p>.</p>
  
  <p>This because: <code>1*2^(3)+1*2^(2)+0*2^(1)+1*2^(0)+1*2^(-1)+0*2^(-2)+1*2^(-3)+1*2^(-4)</code>.</p>
  
  <p>This it's all ok.</p>
  
  <p>I can implement easily the conversion from a fractional binary part to the decimal notation. The problem is the reverse. If I have </p>
  
  <blockquote>
    <p>0.4321</p>
  </blockquote>
  
  <p>for example, how I do in assembly 8086 a procedure that converts only the fractional part: </p>
  
  <blockquote>
    <p>4321</p>
  </blockquote>
  
  <p>in binary notation?</p>
  
  <p>I should to do this (more or less):</p>
  
  <pre><code>(Iteration) Multiplicand    Multiplier  Carry
  0           0.432100        2           0
  1           0.864200        2           0
  2           1.728400        2           1
  3           1.456800        2           1
  4           0.913600        2           0
  5           1.827200        2           1
  6           1.654400        2           1
  7           1.308800        2           1
  8           0.617600        2           0
  9           1.235200        2           1
  10          0.470400        2           0
  11          0.940800        2           0
  12          1.881600        2           1
  13          1.763200        2           1
  14          1.526400        2           1
  15          1.052800        2           1
  16          0.105600        2           0
  17          0.211200        2           0
  18          0.422400        2           0
  19          0.844800        2           0
  20          1.689600        2           1
  21          1.379200        2           1
  22          0.758400        2           0
  23          1.516800        2           1
  24          1.033600        2           1
  25          0.067200        2           0
  26          0.134400        2           0
  27          0.268800        2           0
  28          0.537600        2           0
  29          1.075200        2           1
  30          0.150400        2           0
  31          0.300800        2           0
  32          0.601600        2           0
  33          1.203200        2           1
  34          0.406400        2           0
  35          0.812799        2           0
  36          1.625599        2           1
  37          1.251198        2           1
  38          0.502396        2           0
  39          1.004791        2           1
  40          0.009583        2           0
  41          0.019165        2           0
  42          0.038330        2           0
  43          0.076660        2           0
  44          0.153320        2           0
  45          0.306641        2           0
  46          0.613281        2           0
  47          1.226562        2           1
  48          0.453125        2           0
  49          0.906250        2           0
  50          1.812500        2           1
  51          1.625000        2           1
  52          1.250000        2           1
  53          0.500000        2           0
  54          1.000000        2           1
  </code></pre>
  
  <p>Considering the column of remainder in the same sense (in accord to the iterations) the fractional part in binary is:</p>
  
  <ul>
  <li>considering no limits in number of digits:</li>
  </ul>
  
  <blockquote>
    <p>0.4321 &lt;=> 0.0011011101001111000011011000010001001101000000010011101</p>
  </blockquote>
  
  <ul>
  <li>consider a fixed point notation (16 digits for bin, 4 digits for dec):</li>
  </ul>
  
  <blockquote>
    <p>0.4321 &lt;=> 0.0011011101001111[TRUNCATED WITH ROUNDING]
    .</p>
  </blockquote>
  
  <p>How I do all that in a very efficient way in FLAT 8086?</p>
  
  <p>(I apologize to everyone for writing of bestiality previously.)</p>