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.

[参考译文] TMS320F28335:IQMath 库

Guru**** 2609955 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/689721/tms320f28335-iqmath-lib

器件型号:TMS320F28335

您好!  

我尝试从浮点数学转到定点数学以优化速度、但当我使用 IQMath 库时、运行代码的持续时间会变差。 我使用库时可能有误、但看不到如何使用。 下面的代码是我编写的代码、用于尝试了解 IQMath 库、并查看定点是否比以前更快。  

/*此代码段位于浮点中*/

float float_point_array [300];

浮点数1 = 0.089;

浮点数2 = 5.68;

int i;

对于(I = 0;I < 300;+I)

float_point_array[i]= num1 * num2;

/*此代码段位于定点*/    

_iq17 fixed_point_array[300];

_iq17 x =_IQ17 (0.089);

_iq17 y =_IQ17 (5.68);

_iq17 i;

对于(I = 0;I < 300;+I)

fixed_point_array[i]=_IQ17mpy (x、y);

非常感谢、  

Shiromini

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Shiromini、

    在 F28335等浮点机器上、您不太可能从 IQ 数学中获得更好的性能。 该器件具有针对浮点的硬件支持、因此周期计数将大致相同、并且结果(数字在该范围内)在浮点中更准确。

    您为两个环路测量的周期计数是多少?

    此致、

    Richard