Main Content

C2000 Square Root IQN

Square root or inverse square root of IQ number

Description

This block calculates the square root or inverse square root of an IQ number and returns an IQ number of the same Q format. The block uses table lookup and a Newton-Raphson approximation.

Negative inputs to this block return a value of zero.

Note

The implementation of this block does not call the corresponding Texas Instruments® library function during code generation. The TI function uses a global Q setting and the MathWorks® code used by this block dynamically adjusts the Q format based on the block input. See Using the IQmath Library for more information.

Parameters

Function

Whether to calculate the square root or inverse square root

  • Square root (_sqrt) — Compute the square root.

  • Inverse square root (_isqrt) — Compute the inverse square root.

References

For detailed information on the IQmath library, see the user's guide for the C28x IQmath Library - A Virtual Floating Point Engine, Literature Number SPRC087, available at the Texas Instruments Web site. The user's guide is included in the zip file download that also contains the IQmath library (registration required).