I am trying to divide two numbers, a numerator N by a divisor D. I am using the Newton–Raphson method which uses Newton\'s method to find the reciprocal of D (1/D). Then th
To set the sign bit correctly, perform the XOR on the sign of the original dividend and divisor.
Make the sign of the divisor and dividend positive now.
First set the dividend exponent equal to dividend_exponent- 1 - divisor_exponent - 1 + 127. The +127 is for the bias since we just subtracted it out. This scales the dividend by the same amount we will scale the divisor by.
Change the divisor exponent to 126 (biased) or -1 (unbiased). This scales the divisor to between 0.5 and 1.
Proceed to find Xo with the new scaled D value from step one. Xo = 48/17-32/17 * D.
Proceed to find Xn using the new D until we have iterated enough times so that we have the precision we need. X(i+1) = X(i) * (2-D*X(i)). Also, the number of steps S we need is S = ceil(log_2((P + 1)/log_2(17))). Where P is the number of binary places
Multiply Xn * N = 1/D * N = N/D and your result should be correct.
Update: This algorithm works correctly.