Are TI C2000's DMC and IQMATH library optimization modules faster than floating point operations?
5 views (last 30 days)
Show older comments
Hello, everyone.
I am now working on code generation of F28335 and F28377D.
The two chips above are floating point cores(C28x floating). So one question is whether the optimised libraries embedded coder support for TI c2000 processors are better than modeling with floating-point processing (single-type data).
There are some data type conversions that are inevitable when both are used in motor control, so what are the best recommendations?
0 Comments
Accepted Answer
Darshan Pandit
on 10 Jul 2019
Hi,
This is an ongoing debate between IC designers & embedded system programmers for various semiconductor manufacturers. TI is not an exception.
The thing is: Irrespective of data-types, the numbers are stored as binary digits on the target processors, and there are some binary optimizations which give advantage of faster computing for fixed point data-types. (e.g. multiplication or division by power of 2 is replaced by bit-shift operations), similar story for bitwise AND, OR, etc. However, user has to either limit the variable range or accuracy of computations to achieve this (but this is not always necessary).
On the other hand, floating point data-types provide wide range with precision, and not necessarily improved performance.
A comparison on the same processor for same algorithm with fixed point Vs floating point data-types by semiconductor manufacturer (e.g. TI) would provide more details on this area. However, in my experience, I've seen either equivalent or upto 30% faster performance for fixed point optimizations on TI's processors.
An example for motor control would be scaling of +-1 stator currents sensed via ADCs, where +1A corresponds to 4096 and -1A corresponds to 0. Ideally, user offsets the ADC output with 2048 counts (equivalent to 0A), which then needs to be divided by 2048 (& optionally inverted) to get the correct currents.
In the above example, floating point implemenation would be either a division of 2048 OR a multiplication by (1/2048) and for inverted op-amps an optional mulitplication by -1 is followed. For fixed-point, the same multiplication is replaced by a bit-shift operation and inversion is taken care by unary minus operator.
Here the catch is: While multiply operation might be equivalent for both floating point and fixed point data-types, there are cases where user can optimize the code by doing fixed-point "optimization tricks", which are not possible otherwise. These are implemented in the C28x Optimization libraries, and are likely to perform better for motor control applications for TI processors today.
More Answers (0)
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!