Fixed-Point Designer enables you to specify all the fixed-point properties of your MATLAB® code, Simulink® models, and Stateflow® charts. It provides full control of signedness, word length, and scaling. It supports application-specific word lengths from 1 bit to 128 bits or more. Binary-point scaling and arbitrary slope and bias scaling needed by sensors and actuators are also supported. You can control the details of the mathematical operations, such as how to deal with rounding and overflow.
Fixed-Point Designer provides a large number of functions, such as math and bitwise operations, array and matrix operations, CORDIC implementations, and trigonometric functions, to support fixed-point computation.
With Fixed-Point Designer, you can control the fixed-point arithmetic. In MATLAB, fixed-point variables can either share a single set of arithmetic attributes or have their own specified arithmetic attributes.
Using Fixed-Point Designer with MATLAB Coder™ or Embedded Coder®, you can generate pure integer C code from your fixed-point MATLAB code. Using Fixed-Point Designer with HDL Coder™, you can generate bit-true, synthesizable Verilog® and VHDL® code from your fixed-point MATLAB code, Simulink models, and Stateflow charts.
Explore gallery (2 images)
Fixed-Point Designer provides bit-true agreement across a workflow that uses Model-Based Design. The response of a fixed-point algorithm is bit-true for all forms of simulation and code generation, including acceleration and software-in-the-loop. Analysis and verification of a fixed-point algorithm are based on bit-true representations. Bit-true agreement maximizes many benefits of Model-Based Design, such as the ability to discover issues early in the workflow, when they are easier and less costly to fix.
Once your design has been configured with fixed-point data types, you can simulate its performance to explore implementation tradeoffs between limited range and precision for fixed-point embedded systems.
Using the tools in Fixed-Point Designer, you can access these values and change the data types of signals, optimizing precision while ensuring that their range is covered. You can specify data type ranges using design minimums and maximums, simulation results, or derived minimum and maximum results. For Simulink models, you can lock output data types to prevent them from being changed.
Explore gallery (2 images)
Fixed-Point Designer provides tools for system-wide visualization of the simulation ranges and explores how the various signals fit a certain data type choice. Fixed-Point Designer makes it easy to do a back-to-back comparison of your ideal floating-point design and your embedded efficient implementation using optimal data types.
Using data type override, your embedded fixed-point or single-precision design can be instantly switched to double precision to analyze the impact of quantization. It is easy to perform back-to-back simulations of idealized behavior and embedded behavior. Integration of the workflow with Simulation Data Inspector makes it easy to determine whether the embedded responses, such as the quantization noise, are within desired tolerances of the doubles responses.
It is easy to iteratively adjust data types, collect the new embedded responses, and then determine whether the new design meets tolerances relative to the doubles design. This simple iteration loop makes it easy to explore and optimize data types, rounding modes, and saturation settings.
Fixed-Point Designer provides analysis tools for efficiently converting a design from double precision to single precision or fixed point. The Fixed-Point Tool provides a guided workflow to iteratively explore the different data type choices in meeting the numerical accuracy requirements and make optimal use of your embedded hardware. The analysis framework allows you to observe the dynamic range of variables involved in your design and ensure that the algorithm behaves consistently in floating-point and fixed-point representations.
In MATLAB or Simulink, you can use Fixed-Point Designer to collect minimum and maximum values through simulation or range analysis and get proposed data types. A histogram is generated for each signal and variable in your design, and you can use this histogram to optimize the word and fraction lengths. You can replace any unsupported MATLAB functions in your design with a lookup table approximation function.
Fixed-Point Designer enables you to collect simulation range data through model-wide instrumentation without the explicit need to log all the signal data in your model. This range data is the basis for proposing data types and collecting statistics, such as the histogram data, that aid in the analysis of your design.
Fixed-Point Designer also provides you with derived ranges based on mathematical analysis of your designs. This enables you to determine the worst-case ranges of your design without having to create fully exhaustive simulation test benches. Using derived ranges, you can make sure your design prevents or handles all possible overflows.
Fixed-Point Designer provides tools that make it easy to quickly identify the sources of overflow, precision loss, and wasted range or precision. Using scaled doubles override, it is possible to visualize the ideal floating-point behavior of a model and analyze that behavior against the specified embedded fixed data types.
A visual display using histograms that overlay the idealized range and the embedded fixed data type representable range makes it easy to spot sources of overflows, underflows, wasted range bits, and wasted precision bits. This makes it easy to identify locations where data type improvements are warranted.
You can trace an overflow/underflow to the specific design element, like the particular block, Stateflow chart element, or section of MATLAB code. Fixed-Point Designer integration with Simulink diagnostics allows design errors like run-time overflows to be detected and isolated. The ability to suppress diagnostics for individual model elements, such as a correctly overflowing timer, lets you spend time only on real issues.