Implement logic signals as Boolean data (vs. double)
Description
Controls the output data type of blocks that generate logic signals.
Category: Simulation Target
Settings
Default: On
On
Blocks that generate logic signals output a signal of
boolean
data type. This reduces the memory requirements of generated code.Off
Blocks that generate logic signals output a signal of
double
data type. This ensures compatibility with models created by earlier versions of Simulink® software.
Tips
Setting this option on reduces the memory requirements of generated code, because a Boolean signal typically requires one byte of storage compared to eight bytes for a
double
signal.Setting this option off allows the current version of Simulink software to run models that were created by earlier versions of Simulink software that supported only signals of type
double
.This optimization affects the following blocks:
Logical Operator block – This parameter affects only those Logical Operator blocks whose Output data type parameter specifies
Inherit: Logical (see Configuration Parameters: Optimization)
. If this parameter is selected, such blocks output a signal ofboolean
data type; otherwise, such blocks output a signal ofdouble
data type.Relational Operator block – This parameter affects only those Relational Operator blocks whose Output data type parameter specifies
Inherit: Logical (see Configuration Parameters: Optimization)
. If this parameter is selected, such blocks output a signal ofboolean
data type; otherwise, such blocks output a signal ofdouble
data type.Combinatorial Logic block – If this parameter is selected, Combinatorial Logic blocks output a signal of
boolean
data type; otherwise, they output a signal ofdouble
data type. See Combinatorial Logic in the Simulink Reference for an exception to this rule.Hit Crossing block – If this parameter is selected, Hit Crossing blocks output a signal of
boolean
data type; otherwise, they output a signal ofdouble
data type.
Dependencies
This parameter is disabled for models created with a version of Simulink software that supports only signals of type
double
.
Command-Line Information
Parameter:
BooleanDataType |
Value:
'on' | 'off' |
Default:
'on' |
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | On |
Safety precaution | On |