定点
在数字硬件中,数字以定点或浮点数据类型的形式来表示。对于这两种数据类型,字长的位数都是固定的。但是,定点值的动态范围远小于字长相同的浮点值。虽然浮点处理器可以大大简化系统的实时实现,有效地估算真实数字,但定点处理器具有许多其他优势。定点处理器通常较小,功耗较低。它们在执行时需要的内存和处理器时间也较少。
要仿真使用定点数字的模型,必须安装 Fixed-Point Designer™。要编辑包含定点模块的模型或者指定定点数据类型,并不需要 Fixed-Point Designer。
函数
fixdt | 创建描述定点或浮点数据类型的 Simulink.NumericType 对象 |
fixptbestexp | Exponent that gives best precision for fixed-point representation of value |
fixptbestprec | Determine maximum precision available for fixed-point representation of value |
主题
- Specify Fixed-Point Data Types
If you do not have Fixed-Point Designer, you can still inspect and use fixed-point models that others share with you.
- 使用数据类型助手指定数据类型
以交互方式将数据类型(如整数、定点和枚举类型)应用于模型中的数据项。
- Share Fixed-Point Models
Inspect and use an existing fixed-point model when you do not have Fixed-Point Designer.
- 控制定点仪表和数据类型覆盖
如果您没有 Fixed-Point Designer,您可以通过关闭定点检测并将数据类型覆盖设置为缩放双精度数来使用包含具有定点设置的 Simulink® 模块的模型。
- 定点数
在 Simulink 中表示和定标定点数。
- 使用定点硬件的好处
与浮点设计相比,定点设计执行速度更快,消耗的计算资源更少。
- Scaling, Range, and Precision
Learn how fixed-point types are scaled and how to interpret the range and precision of a data type from its scaling.
- MATLAB 和 Simulink 中的定点数据
将定点数据类型应用于 Simulink 模型中的数据和 MATLAB® 代码中的数据。