Forum Discussion
Altera_Forum
Honored Contributor
16 years agoC2H fixed point mpy
I had an array of fixed point numbers, log values actually. 10 bit integer 22 bit fraction. Needed the sum of squares to calculate standard deviation. In regular C this works okay ...
lo...
Altera_Forum
Honored Contributor
16 years agoTry this:
Square = (long long)val * (long long)val; SumSquare += Square >> 22; By the looks of it the CPLI of your loop is 1 before and after this change so your performance shouldn't differ. Can you open a mysupport service request and attach your design so that this can be tracked and resolved. The result of your multiplication should have been a long long and the upper bits shifted down like you intended.