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 #178 background imageLoading...
Page #178 background image
IQmath
IQmath
IQmath
Approach
Approach
GLOBAL_Q simplification
GLOBAL_Q simplification
#define GLOBAL_Q 18 // set in “IQmathLib.h” file
_iq Y, M, X, B;
Y = _IQmpy(M,X) + B; // all values are in Q = 18
GLOBAL_Q
GLOBAL_Q
User selects “Global Q” value for the whole application
User selects “Global Q” value for the whole application
based on the required dynamic range or resolution, for example:
based on the required dynamic range or resolution, for example:
The user can also explicitly specify the Q value to use:
The user can also explicitly specify the Q value to use:
_iq20 Y, M, X, B;
Y = _IQ20mpy(M,X) + B; // all values are in Q = 20
0.000 000 06
0.000 000 06
-
-
128.000 000 00
128.000 000 00
127.999 999 94
127.999 999 94
24
24
0.000 001
0.000 001
-
-
2048.000 000
2048.000 000
2047.999 999
2047.999 999
20
20
0.000 000 004
0.000 000 004
-
-
8.000 000 000
8.000 000 000
7.999 999 996
7.999 999 996
28
28
Resolution
Resolution
Min Val
Min Val
Max Val
Max Val
GLOBAL_Q
GLOBAL_Q
The basic "IQmath" approach was adopted in the creation of a standard math library for the Texas
Instruments TMS320C28x DSP fixed-point processor. This processor contains efficient hardware
for performing 32x32 bit multiply, 64-bit shifts (logical and arithmetic) and 32-bit add/subtract
operations, which are ideally suited for 32 bit "IQmath".
Some enhancements were made to the basic "IQmath" approach to improve flexibility. They are:
Setting Of GLOBAL_Q Parameter Value: Depending on the application, the amount of nu-
merical resolution or dynamic range required may vary. In the linear equation example, we used
a Q value of 24 (Q24). There is no reason why any value of Q can't be used. In the "IQmath"
library, the user can set a GLOBAL_Q parameter, with a range of 1 to 30 (Q1 to Q30). All func-
tions used in the program will use this GLOBAL_Q value. For example:
#define GLOBAL_Q 18
Y = _IQmpy(M, X) + B; // all values use GLOBAL_Q = 18
If, for some reason a particular function or equation requires a different resolution, then the user
has the option to implicitly specify the Q value for the operation. For example:
Y = _IQ23mpy(M,X) + B; // all values use Q23, including B and Y
The Q value must be consistent for all expressions in the same line of code.
8 - 22 C28x - Numerical Concepts & IQmath

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