Float Typecast - Typecast a floating-point type to an unsigned integer or vice versa - Simulink (original) (raw)
Main Content
Typecast a floating-point type to an unsigned integer or vice versa
Libraries:
HDL Coder / HDL Floating Point Operations
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.
Input Data Type | Output Data Type |
---|---|
half | uint16 |
single | uint32 |
double | uint64 |
uint32 | single |
uint64 | double |
uint16 | half |
This figure shows how the block mask, behavior, and output data type changes dynamically depending on the input data type that you specify.
Examples
Ports
Input
Port to provide input to the block.
Data Types: singledouble
| uint32
| fixed point
Output
Port to obtain calculated output from the block.
Data Types: single
| double
| uint32
| fixed point
Extended Capabilities
The block supports HDL code generation in the Native Floating Point
mode. To use this mode, specify single
oruint32
data types as input to the block. With the HDL Code Advisor, you can replace Data Type Conversion blocks that use theStored Integer (SI)
mode and convert between floating-point and fixed-point data types.
The block supports code generation for complex signals.
Version History
Introduced in R2017b