IQmath
All “IQmath” operations have an equivalent floating-point operation
IQmath
IQmath
Approach
Approach
Targeting Fixed
Targeting Fixed
-
-
Point or Floating
Point or Floating
-
-
Point device
Point device
Compile & Run
using floating-point math on
C3x, C67x,C28x (RTS), PC,..
Compile & Run
using “IQmath” on
C28x
User selects target math type
(in “IQmathLib.h” file)
Y = _IQmpy(M, X) + B;
#if MATH_TYPE == IQ_MATH
#if MATH_TYPE == FLOAT_MATH
Y = (float)M * (float)X + (float)B;
Selecting FLOAT_MATH Or IQ_MATH Mode:
As was highlighted in the introduction, we
would ideally like to be able to have a single source code that can execute on a floating-point or
fixed-point target device simply by recompiling the code. The "IQmath" library supports this by
setting a mode, which selects either IQ_MATH or FLOAT_MATH. This operation is performed
by simply redefining the function in a header file. For example:
#if MATH_TYPE == IQ_MATH
#define _IQmpy(M , X) _IQmpy(M , X)
#elseif MATH_TYPE == FLOAT_MATH
#define _IQmpy(M , X) (float) M * (float) X
#endif
Essentially, the programmer writes the code using the "IQmath" library functions and the code
can be compiled for floating-point or "IQmath" operations.
C28x - Numerical Concepts & IQmath
8 - 23
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...