Specifying Data Type for Code Generation with IQmath Library

17 views (last 30 days)
I am using the Embedded Coder Support Package for TI C2000 Processors. How do I specify the output data type for a Simulink block to be in the 'Q' format, as used in the TI IQmath library?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Apr 2023
Edited: MathWorks Support Team on 7 Apr 2023
The correct way to configure a block to use the Q format is to specify a fixed-point output data type that matches the particular Q format in use. For example, to configure a block for a Q23 representation, specify the data type as "fixdt(1, 32, 23)" under Block Parameters > Signal Attributes > Output data type. This indicates a signed 32-bit fixed-point number with 23 fraction bits, which matches the Q23 representation. This is described on the following documentation page, under the heading "Q Format Notation":
Please see the documentation page of "fixdt" for more information on creating Fixed-Point Numbers in Simulink:
Additionally, please refer to the user's guide for the 
C28x IQmath Library - A Virtual Floating Point Engine
, Literature Number SPRC087, available at the Texas Instruments Web site for more information on the IQmath library.

More Answers (0)

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!