CONVERT - Data Type Conversion (original) (raw)

Scilab 5.3.3

Please note that the recommended version of Scilab is 2026.0.1. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Xcos > palettes > Integer palette > CONVERT

Block Screenshot

Contents

Description

This block converts an input signal of real double or integer data type to an integer or real double data type. This block is particularly useful to connect a block which accepts or produces only integer data type with another block which produces or accepts only double data type.

It can be also use to get the least significant half of the input by a downgrade conversion like int16 to int8. For this use case and if you do not want a type conversion, you can also use the EXTRACTBITS block with the Bits to extract parameter set toLower half.

For an upgrade conversion of a signed integer to another signed integer, the sign bit is propagated.

When the output is an integer and when overflow occurs the block gives three different forms of results :

  1. A normal non saturated result. By example, if type is int8 and the result is 128, the block output value will be -128.
  2. A saturated result. For the previous example the block output value will be 127
  3. An error message warning the user about the overflow.

The user can select one of these three forms by setting theDo on Overflow field to 0,1 or 2.

Data types

The block supports the following types :

Dialog box

Default properties

Computational function

Authors

Fady NASSIF - INRIA