03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.82.1 Declaration<br />

tFrac32 GFLIB_Sqrt_F32(tFrac32 f32In);<br />

4.82.2 Arguments<br />

Table 4-104. GFLIB_Sqrt_F32 arguments<br />

Type Name Direction Description<br />

tFrac32 f32In input The input value.<br />

4.82.3 Return<br />

The function returns the square root of the input value. The return value is within the [0,<br />

1) fraction range.<br />

4.82.4 Description<br />

The GFLIB_Sqrt_F32 function computes the square root of the input value.<br />

Chapter 4 API References<br />

The computations are made by a simple iterative testing of each bit starting from the most<br />

significant one. In total, 15 iterations are made, each per<strong>for</strong>ming the following steps:<br />

1. Add to the tentative square root value a single testing bit.<br />

2. Square the tentative square root value <strong>and</strong> test whether it is greater or lower than the<br />

input value.<br />

3. If greater, then clear the bit in the tentative square root value.<br />

4. Shift the single testing bit right<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

Freescale Semiconductor, Inc. 413

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!