| Simulink® Fixed Point™ | ![]() |
| On this page… |
|---|
In general, you perform the following steps when using the Fixed-Point Tool to scale fixed-point data types in a model:
| Step | Description | See... |
|---|---|---|
| 1 | Collect range data, i.e., minimum and maximum values that model objects either specify explicitly or generate during simulation, and propose fixed-point scaling. | Proposing Scaling |
| 2 | Use the Autoscale Information dialog to review the scaling proposals. | Reviewing Scaling Proposals |
| 3 | Apply the scaling proposals selectively to model objects. | Applying Scaling |
The Fixed-Point Tool generates scaling proposals for model objects that specify fixed-point data types. However, you can control whether a model object is subject to proposals by locking its scaling. If an object's Lock output scaling against changes by the autoscaling tool parameter is selected, the tool refrains from proposing scaling for that object.
When generating scaling proposals, the tool collects the following types of range data for model objects:
Design minimum or maximum values — You specify a design range for model objects using parameters typically titled Output minimum and Output maximum. See Blocks That Allow Signal Range Specification for a list of blocks that permit you to specify these values.
Simulation minimum or maximum values — When simulating a system whose Logging mode parameter specifies Minimums, maximums and overflows, the Fixed-Point Tool logs the minimum and maximum values generated by model objects. For more information about the Logging mode parameter, see the documentation for the fxptdlg function.
The Fixed-Point Tool uses available range data to calculate scaling proposals according to the following rules:
Design minimum and maximum values take precedence over the simulation range.
The tool observes the simulation range only when the Use SimMin/Max if DesignMin/Max are not available option is selected. Otherwise, the tool ignores the simulation range.
Click the Propose Fraction Lengths button
to generate scaling proposals
for objects in your model. However, if you plan to scale fixed-point
data types using simulation minimum and maximum values, you must first
simulate the system to log its simulation range. See Tutorial: Feedback Controller for an example
that demonstrates how to scale fixed-point data types using only simulation
range data.
Note The Fixed-Point Tool does not alter your model when it proposes scaling. |
The Fixed-Point Tool lists its scaling proposals in the Contents pane under the ProposedDT column. The tool alerts you to potential scaling issues for each object in the list by displaying a green, yellow, or red icon, as shown here:
|
| The proposed scaling poses no issues for this object. |
|
| The proposed scaling poses potential issues for this object. |
|
| The proposed scaling will introduce data type errors if applied to this object. |
You can review each scaling proposal using the Autoscale Information dialog, which displays the rationale underlying the proposed scaling. Also, this dialog describes potential issues or errors, and it suggests methods for resolving them. To open the dialog:
In the Contents pane, select an object that has proposed scaling.
Click the Autoscale Information button
.
The dialog appears as shown here.

The sections that follow describe the information that the dialog displays.
This section describes a scaling proposal in terms of how it differs from the object's current data type. For cases when the Fixed-Point Tool does not propose scaling, this section provides an explanation.
This section lists potential issues and errors associated with scaling proposals. It displays the following icons to differentiate warnings from errors.
|
| Indicates a warning message. |
|
| Indicates an error message. |
Not only does this section describe such issues, but also it suggests methods for resolving them.
This section notifies you when data type requirements associated with other model objects impact the data type of the selected object. In this case, the dialog provides a hyperlink that you can click to highlight those items in the model. To eliminate such highlighting, from the model's View menu, select Remove Highlighting.
This section provides a table that lists a model object's attributes that influence its scaling proposal.
| Item | Description |
|---|---|
Currently Specified Data Type | Data type that an object currently specifies. |
Proposed Data Type | Data type that the Fixed-Point Tool proposes for this object. |
Proposed Representable Maximum | Maximum value that results from the proposed data type. |
Design Maximum | Design maximum value that an object specifies using, e.g., its Output maximum parameter. |
Simulation Maximum | Maximum value that occurs during simulation. |
Simulation Minimum | Minimum value that occurs during simulation. |
Design Minimum | Design minimum value that an object specifies using, e.g., its Output minimum parameter. |
Proposed Representable Minimum | Minimum value that results from the proposed data type. |
The table also includes a column titled Percent Proposed Representable. This column indicates the percentage of the proposed representable range that each value covers. Overflows occur when values lie outside this range.
Shared Values. When proposing scaling, the Fixed-Point Tool attempts to satisfy data type requirements that model objects impose on one another. For example, the Sum block provides an option that requires all of its inputs to have the same data type. Consequently, the table might also list attributes of other model objects that impact the scaling proposal for the selected object. In such cases, the table displays the following types of shared values:
Initial Values
Some model objects provide parameters that allow you to specify the initial values of their signals. For example, the Constant block includes a Constant value parameter that initializes the block output signal. The Fixed-Point Tool uses initial values to propose scaling for model objects whose design and simulation ranges are unavailable. When data type dependencies exist, the tool considers how initial values impact the scaling proposals for neighboring objects.
Associated Parameters
Some model objects require the specification of numeric parameters to compute the value of their outputs. For example, the Breakpoints and Table data parameters of a Lookup Table (n-D) block specify values that the block requires to perform its lookup operation and generate output. Typically, blocks convert the data types of such parameters to match that of their input or output signals. When proposing scaling, the Fixed-Point Tool considers how these "associated" parameter values impact the scaling proposals for neighboring objects.
The Fixed-Point Tool allows you to apply its scaling proposals selectively to objects in your model. Use the Accept check box in the Contents pane to specify the scaling proposals that you want to assign to model objects. The check box indicates the status of a proposal as follows:
|
| The Fixed-Point Tool will apply the proposed scaling to this object. By default, the tool selects the Accept check box when a scaling proposal differs from the object's current scaling. |
|
| The Fixed-Point Tool will ignore the proposed scaling and leave the current scaling intact for this object. |
|
| No scaling proposal exists for this object. This occurs, for example, when the object specifies a data type inheritance rule or has its scaling locked. |
Tip The Fixed-Point Tool enables you to customize its scaling proposals before applying them to your model. To do so, in the Contents pane, click a ProposedDT cell and edit the data type expression. See documentation for the fixdt function for information about specifying fixed-point data types. |
To apply scaling proposals to objects in your model:
In the Contents pane, select the Accept check box associated with scaling proposals that you want to apply to model objects.
Click the Apply Accepted Fraction Lengths button
.
The Fixed-Point Tool replaces the fixed-point scaling of model objects with scaling proposals whose Accept check box is selected.
![]() | Overview of the Fixed-Point Tool | Introduction to the Tutorial | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |