IQmath Library
IQmath Library
IQmath Library
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
IQNabs<br />
Absolute value of IQ number<br />
Description<br />
This intrinsic calculates the absolute value of an IQ number:<br />
Declaration<br />
Global IQ function (IQ format = GLOBAL_Q)<br />
_iq _IQabs(_iq A)<br />
Q format specific IQ function (IQ format = IQ1 to IQ30)<br />
_iqN _IQNabs( _iqN A)<br />
Input Format<br />
Global IQ function (IQ format = GLOBAL_Q)<br />
IQ number in GLOBAL_Q format<br />
Q format specific IQ function (IQ format = IQ1 to IQ30)<br />
IQ number in IQN format<br />
Output Format<br />
Global IQ function (IQ format = GLOBAL_Q)<br />
Absolute value of input in GLOBAL_Q format<br />
Q format specific IQ function (IQ format = IQ1 to IQ30)<br />
Absolute value of input in IQN format<br />
Usage<br />
Example:<br />
Calculate the absolute sum of three IQ numbers (GLOBAL_Q=IQ28)<br />
_iq xin1, xin2, xin3, xsum;<br />
_iq20 yin1, yin2, yin3, ysum;<br />
xsum = _IQabs(X0) + _IQabs(X1) + _IQabs(X2);<br />
xsum = _IQ28abs(X0) + _IQ28abs(X1) + _IQ28abs(X2);<br />
©Texas Instruments Inc., June 2002 63