FixPt Gateway Out
Convert a Fixed-Point Blockset data type to a Simulink data type.
Description
The FixPt Gateway Out block is a masked S-function that converts any data type supported by the Fixed-Point Blockset to a Simulink data type.Â
The Treat output as parameter list controls how the output is treated. The possible values are Real World Value and Stored Integer. In terms of the general encoding scheme described in Scaling, Real World Value treats the output as V = SQ + B where S is the slope and B is the bias. Stored Integer treats the output as a stored integer, Q. Outputting numbers as Stored Integer may be useful in these circumstances:
If you are generating code for a fixed-point processor, the resulting code only uses integers and does not use floating-point operations.
If you want to partition your model based on hardware characteristics. For example, part of your model may involve simulating hardware that produces integers as output.
If the fixed-point signal is a true integer such as sint(8) or uint(16), then Real World Value and Stored Integer produce identical output values.
For more information about this parameter list, refer to the FixPt Gateway In block description.
The Output data type parameter list specifies the Simulink data type to use for the output. All built-in data types are supported as well as the boolean data type. auto indicates the Fixed-Point Blockset data type is converted to whatever data type Simulink back propagates.
Remarks
MATLAB's built-in integer data types are limited to 32 bits. If you want to output fixed-point numbers that range between 33 and 53 bits without loss of precision or range, you should use the FixPt Gateway Out block to store the value inside a double.
If you want to output fixed-point numbers with more than 53 bits without loss of precision or range, then you must break the number into pieces using the FixPt Gain block, and then output the pieces using the FixPt Gateway Out block.
For example, suppose the original signal is an unsigned 128-bit value with default scaling. You can break this signal into four pieces using four parallel FixPt Gain blocks configured with the gain and output settings shown below.
Piece | Gain | Output Data Type |
1 | 2^0 | uint(32)Â - Least significant 32 bits |
2 | 2^-32 | uint(32) |
3 | 2^-64 | uint(32) |
4 | 2^-96 | uint(32)Â - Most significant 32 bits |
For each FixPt Gain block, you must also configure the Round toward parameter to Floor, and the Saturate to max or min when overflows occur check box must be unchecked.
Parameters and Dialog Box
Treat output as - Treat the output as a real-world value or as an integer.
Output data type - Any built-in data type supported by Simulink.
Characteristics
Input Ports | Any data type supported by the blockset |
Output Port | Any built-in Simulink data type |
Direct Feedthrough | Yes |
Sample Time | Inherited |
Scalar Expansion | N/A |
States | 0 |
Vectorized | Yes |
Â