This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Float Typecast

Typecast a floating-point type to an unsigned integer or vice versa

  • Library:
  • HDL Coder / HDL Floating Point Operations / Float Typecast

Description

The block casts the underlying bits of the input to the corresponding fixed-point or floating point representation. The input and output of the block contain the same number of bits. This figure shows how the block mask, behavior, and output data type changes dynamically depending on the input data type that you specify.

Ports

Input

expand all

Port to provide input to the block.

Data Types: single | double | uint32 | fixed point

Output

expand all

Port to obtain calculated output from the block.

Data Types: single | double | uint32 | fixed point

Block Characteristics

Data Types

double | single | base integer | fixed point | bus

Sample Time

Inherit

Direct Feedthrough

Yes

Multidimensional Signals

Scalar

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
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

See Also

Functions

Introduced in R2017b