医生umentation

Data Type Conversion Inherited

Convert from one data type to another using inherited data type and scaling

Library

Signal Attributes

Description

The Data Type Conversion Inherited block forces dissimilar data types to be the same. The first input is used as the reference signal and the second input is converted to the reference type by inheriting the data type and scaling information. (SeePort Location After Rotating or Flippingfor a description of the port order for various block orientations.) Either input undergoes scalar expansion such that the output has the same width as the widest input.

Inheriting the data type and scaling provides these advantages:

  • It makes reusing existing models easier.

  • It allows you to create new fixed-point models with less effort since you can avoid the detail of specifying the associated parameters.

Data Type Support

The Data Type Conversion Inherited block accepts signals of the following data types:

  • Floating point

  • Built-in integer

  • Fixed point

  • Boolean

  • Enumerated

For more information, seeData Types Supported by Simulink.

Parameters

Input and Output to have equal

Specify whether theReal World Value (RWV)or theStored Integer (SI)of the input and output should be the same. Refer toDescriptionin the Data Type Conversion block reference page for more information about these choices.

Integer rounding mode

Specify the rounding mode for fixed-point operations.For more information, seeRounding(Fixed-Point Designer).

Saturate to max or min when overflows occur

Select to have overflows saturate to the maximum or minimum value that the data type can represent. Otherwise, overflows wrap.

When you select this check box, saturation applies to every internal operation on the block, not just the output or result. In general, the code generation process can detect when overflow is not possible. In this case, the code generator does not produce saturation code.

Characteristics

Data Types

Double | Single | Boolean | Base Integer | Fixed-Point | Enumerated

Direct Feedthrough

Yes

Multidimensional Signals

Yes

Variable-Size Signals

Yes

Code Generation

Yes

Introduced before R2006a

Was this topic helpful?