Specifying Data Type for Code Generation with IQmath Library
16 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2018-2-21
编辑: MathWorks Support Team
2023-4-7
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?
采纳的回答
MathWorks Support Team
2023-4-7
编辑:MathWorks Support Team
2023-4-7
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.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!