# Q（数字格式）

**Q（数字格式）** 是一种定点二进制数的记法，它规定了一个补码（或无符号）整数字中有多少位表示整数部分、多少位表示小数部分，从而固定一个隐含的缩放因子 \( 2^{-n} \)，使存储值等于原始整数乘以 \( 2^{-n} \)。<sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> 这种记法由德州仪器（Texas Instruments）提出，广泛应用于数字信号处理（DSP）和嵌入式编程中——在没有浮点硬件的处理器上，算术运算针对的是普通整数，而二进制小数点只存在于程序员的记录中。<sup>[2](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)</sup>

| 关键事实 | 详情 |
|---|---|
| Qm.n 的含义 | m 个整数位，n 个小数位；所表示的值为存储整数乘以 \( 2^{-n} \)<sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> |
| Q15（Q1.15） | 16 位有符号字，15 个小数位，范围 [−1, +1 − 2⁻¹⁵)，分辨率 \( 2^{-15} \approx 3.05 \times 10^{-5} \)<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> |
| 乘法规则 | 两个 Q15 值在 32 位中产生一个 Q30 乘积，右移 15 位回到 Q15；乘积格式按 \( m_z = m_x + m_y \)、\( n_z = n_x + n_y \) 组合<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup><sup> • </sup><sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> |
| 边界情况 | 唯一会溢出的 Q15 乘积是 −1 × −1；真实结果 +1 无法表示，必须饱和到 32767<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup> |
| 精度与浮点对比 | 32 位定点格式具有 32 位精度；IEEE binary32 从其 23 位尾数获得 24 位精度<sup>[5](https://re.public.polimi.it/bitstream/11311/1207476/6/preprint.pdf)</sup> |
| 硬件支持 | ARMv7-M 内核提供 SSAT、USAT 和 QADD 饱和指令；CMSIS-DSP 提供 Q7、Q15 和 Q31 内核<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> |
| TI IQmath 阶梯 | 32 位字上支持 Q1 到 Q30，分辨率从 IQ1 的 0.5 到 IQ30 的 0.000000001<sup>[6](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)</sup> |

## 记法与约定

在最常见的形式中，**Qm.n** 表示一个有符号定点数，具有 m 个整数位和 n 个小数位。两种计数约定并存。按照 TI 和 MathWorks 的约定，有符号 Q 格式总共需要 m + n + 1 位，多出的一位是符号位，因此 Q.15 是一个有符号 16 位数，具有 0 个整数位和 15 个小数位。<sup>[7](https://www.mathworks.com/help/ti-c2000/ug/using-the-iqmath-library.html)</sup><sup> • </sup><sup>[2](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)</sup> 按照 fixedpoint 模块和大多数学术文献使用的约定，总字长为 w = m + n，符号由 m 个整数位中负权重的最高有效位承担，给出有符号范围 \( [-2^{m-1},\ 2^{m-1}) \) 和分辨率 \( 2^{-n} \)。<sup>[8](https://fixedpoint.readthedocs.io/en/latest/basics.html)</sup><sup> • </sup><sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> 在独立符号位读法下，W 位字中的 Qm.n 有符号格式满足 m + n = W − 1。<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup>

这种简写在不同厂商之间确实存在歧义。为 Digital Signal Labs 撰稿的 DSP 工程师 Randy Yates 记录道，ARM 将 Q15 定义为无符号 Q1.15 的简写，将 Q31 定义为有符号 Q1.31 的简写，而 TI 将 Q15 定义为等价于有符号 A(1, 15) 记法。<sup>[9](http://www.digitalsignallabs.com/downloads/fp.pdf)</sup> 有些记法将 m 和 n 颠倒，有些用 A 和 U 分别表示有符号和无符号，还有些在整数计数中省略符号位。<sup>[8](https://fixedpoint.readthedocs.io/en/latest/basics.html)</sup> Microchip 的 LibQ 库使用 Qn_m，其中 n 是整数计数，m 是小数计数，与更常见的顺序相反，并假定最高有效位为符号位。<sup>[10](https://onlinedocs.microchip.com/oxy/GUID-9A1A39D4-F5A9-4AB5-89CC-20C51E2EECD5-en-US-2/GUID-3ED447D8-D99A-4C6B-8FC6-D18BFEA65B2B.html)</sup> Intel 的 FPGA 文档写作 Qm.f，表示 m 个整数位和 f 个小数位，因此 Q4.12 描述的是 16 位字中的 4 个整数位和 12 个小数位。<sup>[11](https://www.intel.com/content/www/us/en/docs/programmable/683750/23-1/non-ieee-754-standard-format.html)</sup> 大学教学材料警告不要使用裸写的“Qf 格式”——其中 Q15 意味着 Qg.15，整数计数未知——正是因为这会带来不确定性，并建议在命名格式时始终说明总宽度。<sup>[12](https://hps.hs-regensburg.de/scm39115/homepage/education/lessons/FixedPointNumbers/FixedPointNumbers.pdf)</sup><sup> • </sup><sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup>

## 算术运算

**加法和减法**原封不动地复用处理器的整数加法器：定点硬件执行有符号或无符号整数算术，就好像二进制小数点位于第 0 位右侧，而程序员决定它实际在哪里。<sup>[7](https://www.mathworks.com/help/ti-c2000/ug/using-the-iqmath-library.html)</sup> 两个数必须具有相同的缩放才能相加；两个缩放为 X(e, f) 的数之和的缩放为 X(e+1, f)，这意味着两个 M 位数的和需要 M + 1 位，当结果可能超出输入动态范围时，必须多保留一个整数位。<sup>[9](http://www.digitalsignallabs.com/downloads/fp.pdf)</sup><sup> • </sup><sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> 更一般地，将 k 个各为 n 位的数相加，需要 n + ⌈log₂ k⌉ 位才能在不溢出的情况下容纳所有可能的结果。<sup>[13](https://doppler-dsp.github.io/doppler/guide/fixed-point/)</sup>

**乘法**组合格式。z = x × y 的输出格式遵循 \( m_z = m_x + m_y \) 和 \( n_z = n_x + n_y \)，在这些条件下将字宽扩展到 \( w_x + w_y \) 位且无溢出风险。<sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> 在 Yates 描述的有符号 A 格式约定中，乘积格式多出一个符号位：A(a1, b1) × A(a2, b2) = A(a1+a2+1, b1+b2)，因为这种小数乘法约定产生一个冗余符号位，必须通过将双宽乘积左移一位来去除，MIPS32 DSP ASE 的小数乘法指令会自动执行这一修正。<sup>[9](http://www.digitalsignallabs.com/downloads/fp.pdf)</sup><sup> • </sup><sup>[14](https://dl.icdst.org/pdfs/files3/c61c8d92f598c36ccec4f1e2693bb521.pdf)</sup> 在 Q1.15 工作约定中，同样的重新对齐被描述为右移：两个 Q15 数在 32 位中间值中产生一个 Q30 乘积，右移 15 位将其带回 Q15。<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup> 忘记乘法后的重新对齐被描述为最常见的定点编程错误，即使不发生溢出，它也会使有效噪声底翻倍。<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> 除法同样需要在之后重新缩放。<sup>[2](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)</sup>

**标度跟踪**是使这一切得以运转的记录工作。由于缩放因子 \( 2^{-n} \) 是隐含的，程序员或代码生成工具必须跟踪每个变量在每次运算中的格式；一次移位可能意味着一条实际的位移动指令，也可能仅仅是对缩放因子的重新解释而不移动任何位。<sup>[9](http://www.digitalsignallabs.com/downloads/fp.pdf)</sup> TI 的 IQmath 直接暴露了这一点：格式编号表示小数位数 n，存储值为 \( x_i \times 2^{-n} \)，GLOBAL_Q 设置让设计者在确定之前权衡动态范围与分辨率。<sup>[15](https://software-dl.ti.com/msp430/esd/MSPM0-SDK/latest/docs/english/middleware/iqmath/doc_guide/doc_guide-srcs/Users_Guide.html)</sup><sup> • </sup><sup>[6](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)</sup>

## 饱和、舍入与溢出

当结果超出数据类型所隐含的范围时，硬件或库可以选择回绕——如同普通补码整数算术那样——或饱和，即钳制到该类型的极值，例如 Q15 中的 0x7FFF（最大正值）或 −0x8000（−1）。<sup>[14](https://dl.icdst.org/pdfs/files3/c61c8d92f598c36ccec4f1e2693bb521.pdf)</sup> 对于音频、控制和通信信号，饱和优于回绕。<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> 一个实例：将 0.75 和 0.5 相加会使 Q15 溢出，饱和加法会钳制到最大值，而不是回绕到一个很大的负数。<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup>

Q15 乘法有一个不可避免的溢出。真实乘积 −1 × −1 = +1 比最大 Q15 值高一步；用整数表示，−32768 × −32768 右移 15 位是 32768，在 int16_t 中回绕为 −32768，因此如果两个输入都可能出现 −1，结果必须饱和到 32767。<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup>

**舍入模式**在长时间运行中很重要。截断向较低的可表示值舍入，引入非零均值量化误差的偏置，但它被广泛使用，因为它是实现成本最低的模式。<sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> 普通移位向负无穷方向截断，因此每次乘法平均在同一方向上损失半步；在每秒运行数千次的滤波器中，这会变成直流偏移，而在移位前加上除数的一半反而会产生一个小的正偏置。<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup> 对于 FIR 滤波器，截断使每个输出样本的直流增益偏移约 −0.5 LSB，而四舍六入五成双避免了这种向下偏置。<sup>[13](https://doppler-dsp.github.io/doppler/guide/fixed-point/)</sup> 加上半步并右移则相反，将恰好位于两个可表示值正中间的数向正无穷方向舍入，产生一个小的正偏置；四舍六入五成双以多几条指令为代价消除了偏置。<sup>[4](https://www.embedcalc.com/guides/fixed-point-q-format/)</sup> 在算子层面，舍入比截断意味着更多硬件，因为 w×w 位乘法器需要额外电路在递增结果之前检查 k 个被丢弃的最低有效位中的最高位。<sup>[16](https://www.eurasip.org/Proceedings/Eusipco/Eusipco2010/Contents/papers/1569292231.pdf)</sup>

## 数据一览

| 格式 | 字 | 范围 | 分辨率 |
|---|---|---|---|
| Q15（Q1.15） | 16 位有符号 | [−1, +1 − 2⁻¹⁵] | \( 2^{-15} \approx 3.05 \times 10^{-5} \)<sup>[13](https://doppler-dsp.github.io/doppler/guide/fixed-point/)</sup> |
| Q31（Q1.31） | 32 位有符号 | 符号位，0 个整数位，31 个小数位<sup>[14](https://dl.icdst.org/pdfs/files3/c61c8d92f598c36ccec4f1e2693bb521.pdf)</sup> | \( 2^{-31} \) |
| Q4.12 | 16 位 | 4 个整数位，12 个小数位<sup>[11](https://www.intel.com/content/www/us/en/docs/programmable/683750/23-1/non-ieee-754-standard-format.html)</sup> | \( 2^{-12} \) |
| Q15.16 | 32 位 | −2¹⁵ 到 2¹⁵ − r | \( 2^{-16} \)<sup>[12](https://hps.hs-regensburg.de/scm39115/homepage/education/lessons/FixedPointNumbers/FixedPointNumbers.pdf)</sup> |
| _Q16（Q15_16，Microchip） | 32 位 | −32768.0（0x8000 0000）到 32767.99998474 | \( 2^{-16} = 0.000015259 \)<sup>[10](https://onlinedocs.microchip.com/oxy/GUID-9A1A39D4-F5A9-4AB5-89CC-20C51E2EECD5-en-US-2/GUID-3ED447D8-D99A-4C6B-8FC6-D18BFEA65B2B.html)</sup> |
| _iq30（TI） | 32 位 | −2 到 1.999999999 | 0.000000001<sup>[6](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)</sup> |
| _iq15（TI） | 32 位 | −65536 到 65535.999969482 | 0.000030518<sup>[6](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)</sup> |

转换为 Qn 时，将实值乘以 \( 2^n \)，舍入，然后钳制；采用就近舍入时，每次转换的误差至多半步，即 \( 2^{-(n+1)} \)。十进制 0.1 存储在 Q15 中变为整数 3277，解码为 0.100006，误差约为 \( 6.1 \times 10^{-6} \)，在半步界限 \( 1.5 \times 10^{-5} \) 之内。<sup>[17](https://aicassindra.com/blogs/algorithms/algo_fixed_point.html)</sup>

## 硬件与软件支持

**ARM Cortex-M。** ARM 面向 Cortex-M 的开源 CMSIS-DSP 库使用 Q7、Q15 和 Q31 格式，并提供针对滤波器、FFT 和矩阵运算的内建函数优化内核。<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> 其类型头文件将 q15_t 定义为 1.15 格式的 16 位小数类型，将 q31_t 定义为 1.31 格式的 32 位小数类型，基于 int16_t 和 int32_t 构建，并提供加宽转换，例如 arm_q7_to_q15 实现为左移 8 位。<sup>[18](https://arm-software.github.io/CMSIS_5/latest/DSP/html/arm__math__types_8h.html)</sup> 较新的 CMSIS-DSP 版本增加了模板化 Q 类型，以尾数位、小数位和饱和行为为参数。<sup>[19](https://arm-software.github.io/CMSIS-DSP/main/group__FIXED.html)</sup> 在 Cortex-M3/M4 等 ARMv7-M 内核上，饱和是一条硬件指令：在存在 DSP 扩展的情况下使用 SSAT、USAT 和 QADD。<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> 将浮点值转换为 Q15 时，通过 arm_float_to_q15 除以 32768（\( 2^{15} \)），arm_mult_q15 的 Q30 乘积通过 arm_sat_q30_to_q15 缩放回来。<sup>[20](https://www.systemonchips.com/optimizing-fixed-point-calculations-on-arm-cortex-m4-without-fpu-using-cmsis-dsp/)</sup>

**德州仪器。** IQmath 在 32 位字上支持 Q1 到 Q30，但需要注意的是，IQNsin、IQNcos、IQNatan2、IQNatan2PU 和 IQatan 等三角函数不支持 Q30，因为它们的输入或输出在 −π 到 π 弧度之间变化。<sup>[6](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)</sup> IQ 乘法内建函数不执行饱和或舍入，占用周期最少、代码最少，建议在乘积不会超出范围时使用。<sup>[6](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)</sup> MSP430 DSP 库复用相同的类型，将 Q15 定义为 16 位有符号整数中的 _q15，将 IQ31 定义为 32 位有符号整数中的 _iq31。<sup>[21](https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/DSPLib/latest/exports/html/usersguide_fixed.html)</sup>

**Microchip 与 MIPS。** Microchip 的 DSP 定点库支持 Q15 和 Q31，分别作为 int16_t 和 int32_t，将等效数值范围限制在约 −1.0 到 0.999999999，所有库函数都会对超出可表示范围的输出进行饱和处理；由于并行性，16 位版本比 32 位版本更高效。<sup>[22](https://onlinedocs.microchip.com/oxy/GUID-9A1A39D4-F5A9-4AB5-89CC-20C51E2EECD5-en-US-2/GUID-11F5F64C-F334-4DD1-93F5-7C37BCC523F1.html)</sup> LibQ 将其扩展到 PIC32MZ 微控制器，为 microAptiv 内核提供从汇编派生的可 C 调用函数。<sup>[10](https://onlinedocs.microchip.com/oxy/GUID-9A1A39D4-F5A9-4AB5-89CC-20C51E2EECD5-en-US-2/GUID-3ED447D8-D99A-4C6B-8FC6-D18BFEA65B2B.html)</sup> 在指令层面，MIPS32 DSP ASE 的小数乘法指令自动处理冗余符号位修正；MIPS32 汇编中的 Q15 点积循环需要 15·N/4 + 19 个周期，N = 100 时为 394 个周期，共 29 条指令。<sup>[14](https://dl.icdst.org/pdfs/files3/c61c8d92f598c36ccec4f1e2693bb521.pdf)</sup>

**FPGA。** Intel FPGA IP 通过 ALTFP_CONVERT 和 FP_FUNCTIONS IP 并选择转换函数来支持定点格式；小数宽度为 0 会将数据简化为普通有符号整数。<sup>[11](https://www.intel.com/content/www/us/en/docs/programmable/683750/23-1/non-ieee-754-standard-format.html)</sup>

## 与浮点数的比较

在相同字长下，精度比较是精确的：32 位定点格式具有 32 位精度，而 32 位 binary32 IEEE 浮点格式具有 24 位精度，对应其 23 位尾数。<sup>[5](https://re.public.polimi.it/bitstream/11311/1207476/6/preprint.pdf)</sup> TI 的 TMS320C67x 浮点 DSP 将 32 位数据通路分为 24 位尾数和 8 位指数，因此 24 位提供约 1600 万步的精度，而指数换取范围。<sup>[23](https://www.ti.com/lit/wp/spry061/spry061.pdf)</sup> 在误差行为方面，权衡则相反：由于定点中相邻数之间的间隔可能比浮点处理中大得多，舍入误差可能明显得多，浮点处理总体上产生更高的精度。<sup>[24](https://www.analog.com/en/resources/technical-articles/fixedpoint-vs-floatingpoint-dsp.html)</sup> 将 Q 格式值转换为单精度浮点数也可能损失精度，因为对应的 32 位定点数无法匹配 24 位尾数分辨率。<sup>[7](https://www.mathworks.com/help/ti-c2000/ug/using-the-iqmath-library.html)</sup>

在没有硬件浮点单元（FPU）的处理器上，速度和成本论据有利于定点：浮点运算几乎总是比等效的定点运算慢，这就是许多 DSP 代码用定点编写的原因。<sup>[2](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)</sup> 在一般的混合信号 DSP 设计中，定点算术因其在能耗、面积和延迟方面的效率而受到青睐，代价是理想值与有限精度值之间存在不可避免的误差，需要通过字长优化来管理。<sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup> 代价是开发工作量：文献中专门存在一种浮点到定点转换方法，用于确定使代码执行时间最小化的定点规格，这反映了定点移植所需的分析。<sup>[25](https://asp-eurasipjournals.springeropen.com/articles/10.1155/ASP/2006/96421)</sup> libfixmath 等库提供转换、平方根和三角函数，减少但并未消除这种工作量。<sup>[2](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)</sup>

## 应用与实践

定点 Q 算术出现在整数硬件与信号数学相遇的所有地方：音频 FIR 和 IIR 滤波、控制环路和电信处理。在定点实现中，滤波器参数本身被量化为有限字长，乘法或加法的每个中间结果都被量化，而浮点实现则近似无限精度计算。<sup>[26](http://www2.ensc.sfu.ca/people/faculty/ho/ENSC429/Chapter%207%20-%20Quantization%20Noise%20in%20DSP.pdf)</sup> 因此，系数量化和中间结果量化是 Q 格式设计者必须分析的两个失效面。

两个实际陷阱说明了这一类问题。将两个 Q16.16 值相乘到 32 位时，一旦实际乘积的幅度超过 0.5 就会溢出，因为未移位的乘积包含 32 个小数位；因此必须事先加宽操作数。<sup>[17](https://aicassindra.com/blogs/algorithms/algo_fixed_point.html)</sup> 在乘累加链中，累加器通常加宽到 32 或 40 位，以在最终舍入之前容纳部分和。<sup>[3](https://www.dsprelated.com/glossary/fixed-point)</sup> 当目标缺乏 FPU、功耗或面积预算紧张，或算法的动态范围事先已知时，工程师会选择 Q 格式，接受手动标度跟踪、饱和分析和舍入模式设计的成本。<sup>[2](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)</sup><sup> • </sup><sup>[1](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)</sup>

## 近期发展

Q 格式的思想已经延续到纯整数机器学习推理中。gemmlowp 谱系的纯整数运行时，包括 TensorFlow Lite 的参考内核，将重新量化乘数 M 存储为 Q31 中的 int32 尾数加上右移指数，在运行时应用 SaturatingRoundingDoublingHighMul 和 RoundingDivideByPOT。<sup>[17](https://aicassindra.com/blogs/algorithms/algo_fixed_point.html)</sup> 在 RISC-V 上，开源 ZTA-Q 平台通过将实值乘数乘以 \( 2^{15} \) 缩放为有符号 16 位整数，并在向量 ALU 中应用两个舍入阶段来执行逐通道量化 CNN 推理，非负乘积的移位舍入偏移设为 \( 2^{14} \)，负乘积设为 \( 1 - 2^{14} \)；据报道，保持移位舍入对于防止小的数值偏差在整个网络中累积至关重要。<sup>[27](https://arxiv.org/html/2610.01867)</sup> 在微控制器上，Armv7E-M 上的 W16A16 16 位量化方法实现的量化误差比 8 位方案低约 10 倍，同时达到相似或更好的推理时间和能耗。<sup>[28](https://arxiv.org/abs/2610.03402)</sup>

在 FPGA 神经网络加速器中，标准量化通过带缩放 s 和零点 z 的仿射变换将 float32 映射到低精度整数，权重通常 z = 0，激活 z ≠ 0；在 1 位量化的 ResNet-50 上，使用 float32 缩放因子时，逐组缩放比逐张量缩放增加约 16% 到 30% 的计算成本，但将缩放因子约束为 2 的幂 \( 2^{-i} \) 允许用简单的位移重新缩放，使该技术回归其 Q 格式根源。<sup>[29](https://dl.acm.org/doi/abs/10.1145/3807510)</sup> 在 CPU 方面，Cortex-A76 上的 INT8 QDQ 推理产生的输出在不同执行提供程序之间具有调度不变性，而仅改变执行提供程序时，FP32 输出在每张 CIFAR-10 图像上都不一致。<sup>[30](https://arxiv.org/abs/2607.23227)</sup> 对于在 W4A8 下评估的大型语言模型，E2M5 等 E2 系列格式比从 E5M2 到 INT8 的格式实现了更好的精度-效率权衡，因为它们缩小的动态范围使采用类似于 INT8 的紧凑定点数据通路成为可能，同时提高了尾数精度。<sup>[31](http://arxiv.org/abs/2609.00450v1)</sup>

## References

1. [Fixed-Point Refinement of Digital Signal Processing Systems (Menard et al., IET, 2019)](https://people.rennes.inria.fr/Olivier.Sentieys/publications/2019/Menard19IET.pdf)
2. [Integer & Fixed Point Representation, Circuit Cellar](https://circuitcellar.com/resources/quickbits/integer-fixed-point-representation/)
3. [Fixed-Point Arithmetic, DSPRelated Glossary](https://www.dsprelated.com/glossary/fixed-point)
4. [Fixed-Point Arithmetic in Q Format, EmbedCalc](https://www.embedcalc.com/guides/fixed-point-q-format/)
5. [Cost-effective fixed-point hardware support for RISC-V embedded systems (PoliMi preprint)](https://re.public.polimi.it/bitstream/11311/1207476/6/preprint.pdf)
6. [IQmath Quickstart, Texas Instruments](https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/5287.IQmath_5F00_Quickstart.pdf)
7. [Using the IQmath Library, MathWorks](https://www.mathworks.com/help/ti-c2000/ug/using-the-iqmath-library.html)
8. [Fixed Point Basics, fixedpoint module documentation](https://fixedpoint.readthedocs.io/en/latest/basics.html)
9. [Fixed-Point Arithmetic: An Introduction, Randy Yates, Digital Signal Labs](http://www.digitalsignallabs.com/downloads/fp.pdf)
10. [LibQ Fixed-Point Math Library, Microchip](https://onlinedocs.microchip.com/oxy/GUID-9A1A39D4-F5A9-4AB5-89CC-20C51E2EECD5-en-US-2/GUID-3ED447D8-D99A-4C6B-8FC6-D18BFEA65B2B.html)
11. [Non-IEEE-754 Standard Format, Intel FPGA IP user guide](https://www.intel.com/content/www/us/en/docs/programmable/683750/23-1/non-ieee-754-standard-format.html)
12. [Using Fixed-Point Numbers, University of Regensburg lecture notes](https://hps.hs-regensburg.de/scm39115/homepage/education/lessons/FixedPointNumbers/FixedPointNumbers.pdf)
13. [Getting Started with Fixed-Point Arithmetic, doppler](https://doppler-dsp.github.io/doppler/guide/fixed-point/)
14. [Effective DSP Programming using MIPS DSP Application Specific Extensions](https://dl.icdst.org/pdfs/files3/c61c8d92f598c36ccec4f1e2693bb521.pdf)
15. [MSPM0 IQMath User's Guide, Texas Instruments](https://software-dl.ti.com/msp430/esd/MSPM0-SDK/latest/docs/english/middleware/iqmath/doc_guide/doc_guide-srcs/Users_Guide.html)
16. [Quantization mode opportunities in fixed-point system design, EUSIPCO 2010](https://www.eurasip.org/Proceedings/Eusipco/Eusipco2010/Contents/papers/1569292231.pdf)
17. [Fixed-Point Arithmetic in depth, Belgavi.AI Lab](https://aicassindra.com/blogs/algorithms/algo_fixed_point.html)
18. [arm_math_types.h File Reference, CMSIS-DSP](https://arm-software.github.io/CMSIS_5/latest/DSP/html/arm__math__types_8h.html)
19. [CMSIS-DSP Fixed point datatypes, ARM](https://arm-software.github.io/CMSIS-DSP/main/group__FIXED.html)
20. [Optimizing Fixed-Point Calculations on ARM Cortex-M4 Without FPU Using CMSIS-DSP, SystemOnChips](https://www.systemonchips.com/optimizing-fixed-point-calculations-on-arm-cortex-m4-without-fpu-using-cmsis-dsp/)
21. [MSP DSP Library: Fixed-Point Data Types, Texas Instruments](https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/DSPLib/latest/exports/html/usersguide_fixed.html)
22. [DSP Fixed-Point Math Libraries, Microchip](https://onlinedocs.microchip.com/oxy/GUID-9A1A39D4-F5A9-4AB5-89CC-20C51E2EECD5-en-US-2/GUID-11F5F64C-F334-4DD1-93F5-7C37BCC523F1.html)
23. [Fixed vs. Floating Point white paper, Texas Instruments](https://www.ti.com/lit/wp/spry061/spry061.pdf)
24. [Fixed-Point vs. Floating-Point Digital Signal Processing, Analog Devices](https://www.analog.com/en/resources/technical-articles/fixedpoint-vs-floatingpoint-dsp.html)
25. [Floating-to-Fixed-Point Conversion for Digital Signal Processors, EURASIP JASP](https://asp-eurasipjournals.springeropen.com/articles/10.1155/ASP/2006/96421)
26. [Chapter 7, Quantization Noise in DSP, Simon Fraser University](http://www2.ensc.sfu.ca/people/faculty/ho/ENSC429/Chapter%207%20-%20Quantization%20Noise%20in%20DSP.pdf)
27. [ZTA-Q: an Open-source RISC-V Platform for Accurate Quantized CNN Inference, arXiv](https://arxiv.org/html/2610.01867)
28. [16-bit Precision of Convolutional Neural Networks on Microcontroller Units for 8-bit Costs, arXiv](https://arxiv.org/abs/2610.03402)
29. [SIRA: Scaled-Integer Range Analysis for Optimizing FPGA Dataflow Neural Network Accelerators, ACM TRETS](https://dl.acm.org/doi/abs/10.1145/3807510)
30. [INT8 Quantization Makes ARM Edge Inference Dispatch-Invariant, arXiv](https://arxiv.org/abs/2607.23227)
31. [HBQ: Hierarchical Scaling Block Quantization for Accurate LLM Inference, arXiv](http://arxiv.org/abs/2609.00450v1)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Computational arithmetic › Fixed-point arithmetic

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/q-number-format

English original: https://www.edgepedia.org/q-number-format
