Main Content

定标

可以根据如下方案对定点数进行编码:

real-world value=(slope×integer)+bias

其中斜率可以表示为

slope=slope adjustment factor × 2fixed exponent

整数有时称为存储的整数。这是原始二进制数字,其中假定二进制小数点位于字的最右侧。在 Fixed-Point Designer™ 文档中,固定指数的负值通常称为小数长度

斜率和偏置一起表示定点数的定标。在零偏置的数字中,只有斜率影响定标。仅由二进制小数点位置定标的定点数相当于以偏置为零、斜率调整因子为 1 的 [Slope Bias] 表示的数。这称为二进制小数点定标或二次幂定标:

real-world value=2fixed exponent×integer

real-world value=2-fraction length×integer

Fixed-Point Designer 软件支持二进制小数点定标和 [Slope Bias] 定标。

注意

有关纯二进制小数点定标的示例,请参阅 Fixed-Point Designer Perform Binary-Point Scaling 示例。

关于如何在 MATLAB® 中计算斜率和偏置的示例,请参阅计算斜率和偏置