ON 20060416@11:17:21 AM at page: http://www.piclist.com/microchip/math/div/index.htm#38823.4335185185 James Newton[JMN-EFP-786] published post 38823.4335185185 billyman3@gmail.com
Any reciprocal 1/n where n - 1 = 2^m (and m is an integer)can be represented as a geometric series starting with 1/(n-1) and having a ratio of -1/(n-1). This is convenient because division by n is just a matter of shifting. To expand on that point, dividing by another number, q, when q's factors are made up of the sequence described earlier (3, 5, 9, 17, 33...) and the sequence 2^m (2, 4, 8, 16, 32...) is a breeze.
|Delete 'P-' before: '' but after: 'vivekanand.bollapinni@philips.com
Thank You. This is quite a generic algorithm which can be applied to division of any n-bit number by any m-bit number, when properly tuned.
I have a correction here in step-3: According to me, it should be in the following manner to be generic.

if (remainder >= divisor)
{
remainder = remainder - divisor;
next bit of quotient = 1;
}
else
{
next bit of quotient = 1;
/* Remainder in this case remains unchanged */
}
|Delete 'P-' before: '' but after: '