Intermediate Range Results

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

Open the model. At the MATLAB® command line, enter:

addpath(fullfile(docroot,'toolbox','fixpoint','examples'))
ex_intermediateRange

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

    Tip

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

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

  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.

  6. In the Convert Data Types section of the toolstrip, open the Settings menu.

    In the Default word length field, enter 32

  7. Click the Propose Data Types button .

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

  8. 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.

  9. 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