Skip to content

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.

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

Dialog Box Parameters

  • Treat output as - Treat the output as a real-world value or an integer. The possible values are:
    • 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. This may be useful if you are generating code for a fixed-point processor, or 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.
  • Output data type - Any built-in data type supported by Simulink.

Characteristics

Characteristic Description
Input Port 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