Hi,

Form the way you wrote your algorithm I assume that your 16-bit processor has the ability to give the integer part of the quotient of a division if N(numerator) and D(denominator) are both integers. If that is true here is how I go about doing the division.

Step1. Take D in integer.

Enter D in integer by multiplying with suitable 10's power. (Here it is 100)We handle values of 0<N<655 will be contained in 16 bits after multiplication with 100.Real Divisor value is in the range 50 to 500 with 2 decimal precision

Step2. if (N <= 655)

{

N = N * 100;

Qi = (N / D);(integer part of quotient)

R = N - Qi * D; (remainder)

R = R * 100;

Qf = (R / D);(fractional part of quotient)

}

We handle values of 655<N<1023 after halving N and D values as then we can represent the values in 16-bits and as we have divided both N and D by 2 our result is still accurate enough.

Step3. if (N > 655)

{

N = N/2;

D = D/2;

N = N * 100;

Qi = (N / D); (integer part of quotient)

R = N - Qi * D; (remainder)

R = R * 100;

Qf = (R / D);(fractional part of quotient)

}

We can represent the quotient as an integer as below

Q = Qi.Qf;

Rounding to two decimal places of Qf needs extracting them from the result recursively.

Kalyan.