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.
在使用IQmath 过程当中参考了官方手册 IQmath Library A Virtual Floating Point Engine的一个 例子
如下
Example 1: Implementing equation in IQmath way
Floating point equation: Y = M*1.26 + 2.345
IQmath equation (Type 1): Y =_IQmpy(M, _IQ(1.26)) + _IQ(2.345)
IQmath equation (Type 2): Y =_IQ23mpy(M, _IQ23(1.26)) +_IQ23(2.345)
为什么宏定义M在使用_IQmpy函数的时候不写成这样_IQmpy(_IQ(M), _IQ(1.26)) ?
还有_IQdiv(A,B)的是怎么实现的?个人理解为(A/B)<< GLOBAL_Q 能否写下具体过程?谢谢!
您好,一般情况下1-2天会给到您答复。
您可以选择任意IQ multiply variants:
_IQmpyI32int(_iq A, long B)
_IQNmpyI32int(_iqN A, long B)
_IQmpy(_iq A, _iq B).
根据您选择的参数,可以相应地传递参数。 您可以参阅 <c2000ware>\libraries\math\IQmath\c28\docs 中的文档。
还有_IQdiv(A,B)的是怎么实现的?个人理解为(A/B)<< GLOBAL_Q 能否写下具体过程
对的,将两个长输入相除,返回的结果为 IQN 格式。TI不发布IQ library functions的源代码。您能否具体说下您想了解的是什么?
好的 谢谢您的解答
Example 1: Implementing equation in IQmath way
Floating point equation: Y = M*1.26 + 2.345
IQmath equation (Type 1): Y =_IQmpy(M, _IQ(1.26)) + _IQ(2.345)
IQmath equation (Type 2): Y =_IQ23mpy(M, _IQ23(1.26)) +_IQ23(2.345)
上面的疑问不知道英文论坛回复没?谢谢!
您好关于这个问题,如果 M 是处于悬浮状态,那么应该在参数中使用 _IQ (M) 转换为 IQ 格式。 除此之外您无需使用 _IQ()。
Example 1: Implementing equation in IQmath way
Floating point equation: Y = M*1.26 + 2.345
IQmath equation (Type 1): Y =_IQmpy(M, _IQ(1.26)) + _IQ(2.345)
IQmath equation (Type 2): Y =_IQ23mpy(M, _IQ23(1.26)) +_IQ23(2.345)为什么宏定义M在使用_IQmpy函数的时候不写成这样_IQmpy(_IQ(M), _IQ(1.26)) ?
If M is in float, you should use _IQ(M) in the arguments to convert to IQ format. Othewise, no need to use _IQ()
您看下。
我都开过两次了 贵公司为这个而且还做了方案 链接为https://ticsc.service-now.com/csm?id=csm_ticket&table=sn_customerservice_case&sys_id=720eec8f478809105c930541e36d43d6&view=csp
关于这个问题还有正弦波的问题 我都发了不止一次了
https://e2echina.ti.com/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/214279/pwm
您看下以上链接是否满足您的需求,如果没什么问题的话请您关注以上帖子的情况,如有其他需要补充的信息请您在评论区进行回复。我们会将这个帖子关闭。非常感谢!