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.

floating point vs. fixed point

What is the recommended way from this community to port floating point implementation (e.g. ti6713) to fixed point implementation (e.g. 6416)?

  • Hi Cindy,

    What kind of porting are you looking for ?

    Could you please a elaborate a bit on your requirement.

  • To make a project that is already working in TI6713 (floating) to work in TI6416. Then I will need to handle two types of calcualtions: 1. floating point + floating point; 2. mixed floating point + fixed point. Right now, there are variables declared as both float and uint/int.

  • Cindy,

    If your project is written in C, then there is no issue with porting the code in terms of functionality. The performance will vary, but it depends on the specifics of the code as to which processor will be faster.

    If your project is written in assembly, then you will be porting from one instruction set architecture (ISA) to another, and that is always a difficult task.

    The C implementation uses a run-time support library that uses library function calls to do the floating point math operations on the C6416. Those are slower than the C6713 native execution, but the C6416 can run much faster in terms of clock cycle speed than the C6713, so it is possible that the C6416 will end up running as fast or faster than the C6713. It just depends on your exact code set.

    Start with building the C6416 project with the Debug Configuration and make sure it functions correctly as far as generating the correct output results when compared with the C6713. Then switch to the Release Configuration to measure the performance for comparison with the C6713.

    Regards,
    RandyP

  • While coding in TI6416, people usually use integer data types for fixed point calculation in C/C++. However, the above statement makes me think that I may be able to use floating data type as well to let that "run-time support library" to do the floating to integer conversion? Can the above statement hold in C++ programming as well?

  • Yes, C++ will also work this way.

    Please go to the TI Wiki Pages and search for "C6713 workshop" (no quotes) so you will find the archived C6x1x instruction material. As I recall, this workshop included numerical techniques for implementing fixed-point math so you can learn to use scaling to move from floating-point to fixed-point.

    Fixed-point math will be much more efficient on the C6416 than floating-point, but you can still do either one because of the run-time support library.

    Regards,
    RandyP