Main Content

Intermediate Range Results

This example shows how to interpret the Intermediate Maximum and Intermediate Minimum results in the Result Details tab.

Open Model

Open the ex_intermediateRange model.

open_system("ex_intermediateRange.slx")

Update the diagram (Ctrl+D). Notice the design range information for each of the input ports.

To display design ranges in your model, in the Debug tab, select Information Overlays > Signal Data Ranges.

Collect Ranges in the Fixed-Point Tool

  1. Open the Fixed-Point Tool. From the Simulink® Apps tab, select Fixed-Point Tool.

  2. In the Fixed-Point Tool, under New workflow, select Iterative Fixed-Point Conversion.

  3. In the Fixed-Point Tool, under System Under Design (SUD), select ex_intermediateRange as the system you want to convert.

  4. Under Range Collection Mode, select Derived ranges.

  5. Click the Collect Ranges button.

    The Fixed-Point Tool displays the derived minimum and maximum values for each object in the ex_intermediateRange model.

Propose Data Types

  1. In the Convert section of the toolstrip, open the Settings menu.

    In the Default word length field, enter 32

  2. Click the Propose Data Types button .

    The tool displays the proposed data types appear in the spreadsheet.

Inspect Result Details

  1. Look at the proposed data type of the Product block. The Fixed-Point Tool proposed a data type with 32-bit word length and 12-bit fraction length. The derived maximum value of the Product block is 1, but the maximum representable value for the proposed data type is approximately 1,048,575.

    To learn more about the data type proposal, select the product block in the spreadsheet. The Result Details pane populates with information about the result.

  2. In the Result Details pane, in the Ranges used for proposal table, notice the row labeled Intermediate. After the first two inputs to the Product block are multiplied, the block has a maximum value of 1000000 before being multiplied by the next two inputs for a final maximum value of 1. The data type proposal for the Product block in this model is based on the intermediate minimum and maximum values. It is not based on the derived minimum and maximum values to prevent overflows at the intermediate stages of the block.

Related Topics