Main Content

Gain parameters inherit a built-in integer type that is lossless

Description

The data type of the gain parameter is a built-in integer when the following conditions are met.

  • The input type is a built-in integer.

  • The Parameter data type is set to Inherit:Inherit via internal rule.

  • The value of the gain parameter can be represented without losing any precision by a built-in integer.

  • The Parameter minimum and Parameter maximum values in the Parameter Attributes tab of the Gain block parameters can be represented without losing any precision by a built-in integer.

Settings

Default: Off

On

For Gain blocks with the Parameter data type set to Inherit:Inherit via internal rule, the parameter data type compiles to a built-in integer type whenever possible.

Off

For Gain blocks with the Parameter data type set to Inherit:Inherit via internal rule, the parameter data type is the type which maximizes precision.

Tips

  • This optimization affects both simulation and code generation.

  • This optimization affects only Gain blocks in the model.

  • For more efficient code, specify the Parameter minimum and Parameter maximum values in the Parameter Attributes tab of the Gain block parameters.

Dependencies

  • In cases where the data type of the gain parameter compiles to a fixed-point data type (non-zero scaling), the software checks out a Fixed-Point Designer™ license.

Command-Line Information

Parameter: GainParamInheritBuiltInType
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn (when target hardware supports efficient multiplication)
Off (otherwise)
Safety precautionNo recommendation