This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
请问一下,我圈出来的这部分:p->SpeedRpm_fr = _IQmpy(p->BaseRpm,p->Speed_fr),
其中 __IQmpy为:#define _IQmpy(A,B) __IQmpy(A,B,GLOBAL_Q),GLOBAL_Q为Q24格式,
最后为何赋值给p->SpeedRpm_fr 为Q0格式呢,
这段代码的注释看不明白,哪位大佬可以帮忙解答一下,谢谢!
您好
这段代码有点久了,能查到的内容不是很多,可以看一下这个链接中的解释。
e2e.ti.com/.../tms320f28335-q-format-in-the-official-routine-of-eqep-module
您好,感谢您的回复!
我后面又查了一下,想问一下我这样想的对不对:
在函数_IQmpy(A,B)中,A为Q0格式,B为Q24格式,GLOBAL_Q为Q24格式,则该函数等同于下式:
(A*B) >> 24
A*B为Q0*Q24 = Q24,右移24位即为Q0格式。