EasyManuals Logo

Texas Instruments C28 Series Student Guide

Texas Instruments C28 Series
342 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #179 background imageLoading...
Page #179 background image
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

Table of Contents

Other manuals for Texas Instruments C28 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments C28 Series and is the answer not in the manual?

Texas Instruments C28 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelC28 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals