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 lib

Part Number: TMS320F28335


Hi, 

I am trying to go from floating point maths to fixed point maths to optimize the speed but when I use the IQMath library the duration to run the code gets worse. I may be using the library wrong but can't see how. The code below is what I wrote to try and understand IQMath library and to see if fixed point is faster as it should be but wasn't. 

/* This code section is in floating point */

float floating_point_array [300];

float num1 = 0.089;

float num2 = 5.68;

int i;

for (i = 0; i < 300; ++i)

{

floating_point_array[i] = num1 * num2;

}

/* This code section is in fixed point */    

_iq17 fixed_point_array[300];

_iq17 x = _IQ17 (0.089);

_iq17 y = _IQ17(5.68);

_iq17 i;

for (i = 0; i < 300; ++i)

{

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

}

Many thanks, 

Shiromini

  • Shiromini,

    On a floating point machine such as F28335 you will are unlikely to get better performance from IQ math. The device has hardware support for float, so the cycle count will be about the same and the result (with numbers in this range) more accurate in float.

    What cycle counts are you measuring for the two loops?

    Regards,

    Richard