Main Content

Data Type Conversion Inherited

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

  • Data Type Conversion Inherited block

Libraries:
Simulink / Signal Attributes

Description

The Data Type Conversion Inherited block converts one input to the data type and scaling of the other input. The first input is used as the reference signal. The second input, u, is converted to the reference type by inheriting the data type and scaling information. (For a description of the port order for various block orientations, see Identify Port Location on Rotated or Flipped Block.)

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.

Ports

Input

expand all

Reference signal, defining the data type used to convert input signal u.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated

Input signal to convert to the reference data type, specified as a scalar, vector, matrix, or N-D array.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated

Output

expand all

Output is the input signal u, converted to the reference data type.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated

Parameters

expand all

Specify which type of input and output must be equal, in the context of fixed-point data representation.

  • Real World Value (RWV) — Specifies the goal of making the Real World Value (RWV) of the input equal to the Real World Value (RWV) of the output.

  • Stored Integer (SI) — Specifies the goal of making the Stored Integer (SI) value of the input equal to the Stored Integer (SI) value of the output.

Programmatic Use

Block Parameter: ConvertRealWorld
Type: character vector
Values: 'Real World Value (RWV)' | 'Stored Integer (SI)'
Default: 'Real World Value (RWV)'

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

Programmatic Use

Block Parameter: RndMeth
Type: character vector
Values: 'Ceiling' | 'Convergent' | 'Floor' | 'Nearest' | 'Round' | 'Simplest' | 'Zero'
Default: 'Floor'

When you select this check box, 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.

Programmatic Use

Block Parameter: DoSatur
Type: character vector
Values: 'off' | 'on'
Default: 'off'

Block Characteristics

Data Types

Boolean | double | enumerated | fixed point | half | integer | single

Direct Feedthrough

yes

Multidimensional Signals

yes

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a