Quote:
|
Originally Posted by Kevin Watson
Well, I shouldn't have made such a generalization. Integer division by powers of two is very fast (if the compiler is designed for such an optimization) because you only need to do a binary right shift to divide a number by two (multiplication works by shifting left). Division of two eighty-bit IEEE floating-point numbers on an eight-bit microcontroller is very painful.
-Kevin
|
I forgot to point out that with timer support, it would be very easy to profile the different algorithms to see which is most efficient on the PIC18F8520. I just happened to have written some
example timer code that might help.
-Kevin