ou can connect Simulink blocks directly to Fixed-Point Blockset blocks provided the signals use built-in Simulink data types. The built-in data types include uint8
, uint16
, uint32
, int8
, int16
, int32
, single
, double
, and boolean
. The Fixed-Point Blockset supports all built-in data types. However, a fixed-point signal consisting of 8-, 16-, or 32-bit integers is compatible with Simulink only when its scaling is given by a slope of 1
and a bias of 0
.
Some Simulink blocks impose restrictions on the data type of the signals they can handle. For example, some blocks accept only doubles. To incorporate these blocks into your fixed-point model, you must configure the driving block(s) to use doubles. Some Simulink blocks can accept signals of any data type. For these blocks, you can input any of the built-in data types or any of the blockset-specific data types. Examples of blockset-specific data types include 32-bit signed integers with a scaling of 2-8, and 18-bit unsigned integers with a scaling of 20.
If you want to connect Simulink blocks to fixed-point blocks that output blockset-specific data types, then you must use the fixed-point gateway or data type conversion blocks to convert to a built-in data type.
Most Simulink blocks that accept any Fixed-Point Blockset data type have these characteristics:
Their only function is to rearrange the signal (for example, the Selector or Mux blocks).
They do not perform calculations such as addition or relational operations.
They do not have initial conditions (for example, the Unit Delay block). However, in some cases the block may support any fixed-point data type if the initial condition is set to zero.
Some of the more useful Simulink blocks that can accept any Fixed-Point Blockset data type are listed below.
Block Name | Description |
Bus Selector | Select signals from an incoming bus. |
Demux | Separate a vector signal into output signals. |
Display | Show the value of the input. |
Enable | Add an enabling port to a subsystem. |
Merge | Combine input lines into a scalar output line. |
Mux | Combine several input signals into a single vector or composite output signal. |
Scope | Display signals generated during a simulation. |
Selector | Select input elements. |
To Workspace | Write data to the workspace. |
Trigger | Add a trigger port to a subsystem. |
In some cases, fixed-point signals that are not built-in data types are converted to a real-world value as it enters the block. For example, the To Workspace block will output a 32-bit signed integer with a scaling of 2-8 as a double.
Refer to the Using Simulink guide for detailed information about the data types handled by built-in blocks.