Main Content

Operator to represent Bitwise and Logical Operator blocks

Specify operator type in generated code

Since R2020a

Model Configuration Pane: Code Generation / Optimization

Description

The Operator to represent Bitwise and Logical Operator blocks optimizes the generated code with Logical or Bitwise operators or a combination of both. The supported data type is Boolean.

Settings

Same as modeled (default) | Logical Operator | Bitwise Operator
Same as modeled

Generate code with operators as modeled in Simulink. Generates code with a combination of Bitwise and Logical operators if the model contains both Logical and Bitwise blocks.

Logical Operator

Generate code with Logical operators. Converts Bitwise operator blocks in the model to Logical operators in the generated code.

Bitwise Operator

Generate code with Bitwise operators. Converts Logical operators blocks in the model to Bitwise operators in the generated code. Selecting this option may improve ROM efficiency when the code contains Bitwise operators.

Tips

If you set this parameter to Bitwise Operator, the code semantics is not identical to the modeled semantics. Operands that are short-circuited in a logical operation in the model are evaluated in the corresponding bitwise operation in the generated code. Account for this difference in semantics when verifying the generated code.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyBitwise operator (ROM efficiency)
Safety precautionNo impact

Programmatic Use

Parameter: BitwiseOrLogicalOp
Type: character vector
Value: 'Same as modeled' | 'Logical operator'| 'Bitwise operator'
Default: 'Same as modeled'

Version History

Introduced in R2020a