| Motorola DSP Developer's Kit | ![]() |
y = mot###_sqrt(x)
Description
This function calculates the square root of single input positive real data
Input/Output
Algorithm
Full 23(15) bit precision square root routine using a successive
y = 0;
guess = factor = 0.5;
for(i = 0; i < loopnum; i++)
{
flag = x - guess*guess;
if(flag >= 0) y = guess;
factor /= 2;
guess = y + factor;
}
Memory & Register
r6 = loop number(23 for 56300, 15 for 56600)
Status Register
The assembly function sqrt-sr.asm does not explicitly set any status registers/bits during the function execution.
Data Size Limit
Data Range Limit
The value of input X must be between -1.0 and +1.0.
Precision
In the case of DSP563, precision is 23 bits.
In the case of DSP566, precision is 15 bits.
| sort-c.asm | sqrt-pr.asm | ![]() |