An essential step in embedded software development, floating- to fixed-point conversion can be tedious, labor-intensive, and error-prone. System engineers frequently design algorithms in floating-point math, usually double-precision. This format represents the ideal algorithm behavior but takes little account of the algorithm’s final realization in production software and hardware. Software engineers and suppliers in mass production environments often need to convert these algorithms to fixed-point math for their integer-only hardware. As a result, multiple iterations between system and software engineers are often required.
Using a fault-tolerant fuel system model as an example, this article describes tools and a workflow for converting models from floating point to fixed point for production code generation. The approach described here uses two tools in Simulink Fixed Point™: Fixed-Point Advisor and Fixed-Point Tool.
By Bill Chou and Tom Erkkinen, The MathWorks
This article was published in MATLAB Digest, November 2008