Fixed-point Math help

Fixed point assembly vs floating point C code is what I am comparing. I suppose your own floating point routine can beat the 100:1 quite easily, but I need IEEE compliance (so simulations I run on a PC are identical to the results when run in the embedded processor). Blackfins are nice, I moved up to the SHARC recently, a pleasure to code in assembly.

Reply to
bungalow_steve
Loading thread data ...

If that is your problem, why do you use IEEE floats on the PC simulations ?

Using C++ it would be quite easy to overload the ?,-, *, / etc. operators using your own floating point routines using your own floating point format.

Paul

Reply to
Paul Keinanen

Because I'm not the only one running or controlling the PC simulation. Frequently a customer will come to me asking to implement a industrial controller whose control logic has been tweaked for the last ten years on a simulation done on PC using IEEE floats, they also give me a set of test vectors generated from the simulation that I must use to verify the operation of the controller. I have two options, take their existing code and cross compile it to the target processor which supports IEEE or cross compile it to a target processor that doesn't and hope for the best. Is a risk reduction decision.

Reply to
bungalow_steve

Un bel giorno bungalow_steve digitò:

It wasn't by mistake if I wrote "32-bit fixed point" and "generic operations" and "C code". It's unfair to compare 16-bit fixed point with float (float gives you much more resolution), and it's unfair to make comparisons just by using sum operations.

I've just made a bechmark with a 2810 (100 MHz clock, code executed in RAM):

long a; float f=150.3; long l=150300L;

for( a=0; a

Reply to
dalai lamah

For those of you wondering how the C28x (F2812) from TI handle floating point so efficiently you can view a .ppt training on th topic for free here

formatting link

There are benchmarks and application examples

Here is the free IQMath Library Itsel

formatting link

Chris Clearma

Texas Instrument C2000 Digital Signal Controller

Reply to
ChrisClearman

formatting link

IQMath is not floating point, its a set of fixed point routines that handle some of the alignment issues that are present when using raw fixed point math. You still have some dirty work like picking an appropriate global "IQ" as a function of your signal dynamic range or use as specific IQ for each operation. Most of the discussion here was comparing ANSI C float vs fixed point.

Reply to
joep

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.