Simulink Fixed Point 6.2
Fixed-point Optimization and Refinement Using Fixed-Point Tool
Learn how to convert a floating-point model into a
fixed-point model and obtain an intial scaling for the fixed-point data
types.

Contents
Demo Overview
The video shows how to apply float- to fixed-point conversions on models created using:- Simulink®
- Stateflow®
- Embedded MATLAB™ functionality
- On-target rapid-prototyping
- Embedded systems
- Mass production
- C
- C++
- Microcontrollers
- Digital signal processors
Exploring the Model
In a previous recording, we took a fault-tolerant fuel
control system model and introduced an initial scaling for it using the
Fixed-Point Advisor. We will use the resulting model and further refine
and optimize the fixed-point scaling. Note that the Fixed-Point Tool
can be applied for any fixed-point model, not just those converted
using the Fixed-Point Advisor.
Logging Original Data
We run the simulation once and log the minimums,
maximums, and overflows of the model using the initial fixed-point
scaling obtained using the Fixed Point Advisor.

See how we log the minimum, maximum, and overflows.
Data Type Override
We can use the data type override feature to convert all
signals into floating point and store them as our golden reference
results. This will be used to compare with results obtained with our
new fixed-point scaling later on.

See
how we convert all signals to floating-point and log the golden
reference results.
Automatic Scaling
Using the floating-point results, the Fixed Point Tool
proposes fixed-point scaling for signals of interest. We can add in
safety margins and choose to accept or ignore the proposed scaling.

See how we use automatic scaling to obtain more optimized fixed-point
scaling.
Compare New Results
We can plot the comparison between the new fixed-point
scaling and the golden reference floating point results. We can adjust
the safety margin and play with individual scaling as we go through
several more iterations to obtain the desired performance.

See
how we plot the new fixed-point results with the original
floating-point golden reference results.
Additional Resources
Advanced Fixed Point Tips Document and Models
Technical Evaluation Kit
Related Video Demos
Related Demos
Products Used in this Demo
- MATLAB®
- Simulink
- Stateflow®
- Simulink Fixed Point
- Real-Time Workshop
- Real-Time Workshop Embedded Coder
- Stateflow Coder™
Store
