CMSIS-DSP的手册中说明:The function is implemented using a 64-bit internal accumulator. 请问如何理解这句话?STM32内部有这个64位累加器?如果是只是有那么一个64位变量的话,arm_pid_instance_q15里面也没有64位的变量啊。
手册中只是提到,参考__SIMD32_CONST这个东西,但是其原理又是什么呢?
百思不得其姐,求高人指点
--------------------------------手册说明原文的分界线----------------------------------------
static __INLINE q15_t arm_pid_q15 ( arm_pid_instance_q15 * S , q15_t in)
Parameters
[in,out] S points to an instance of the Q15 PID Control structure
[in] in input sample to process
Returns
out processed output sample.
Scaling and Overflow Behavior:
The function is implemented using a 64-bit internal accumulator. Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. Lastly, the accumulator is saturated to yield a result in 1.15 format.
References __SIMD32_CONST, arm_pid_instance_q15::A0, arm_pid_instance_q15::A1, and arm_pid_instance_q15::state. |