One very common and relatively quick method for find-
ing the square root of a number is the Newton-Raphson
method. Although this method is quick in terms of
mathematics, it also requires extensive use of division
to produce results, usually iterating many times. In the
PIC18CXX2 microcontroller family, though not difficult,
division does requires several basic operations. How-
ever, with the help of the single cycle hardware multi-
plier, one of the many nice features in the PIC18CXX2
and the use of a technique different from the Newton-
Raphson method, division is avoided. The following TB040
Fast Integer Square Root
algorithm demonstrates how the single cycle multiplier
Author: Ross M. Fosler is useful in calculating a square root and at the same
Microchip Technology Inc. time, save processor time.
THE ALGORITHM
INTRODUCTION
Using the binary nature of the microcontroller, the
One very common and relatively quick method for find- square root of a f……