Engee documentation

Integer to Bit Converter

Maps a vector of integers to a vector of bits.

integer to bit converter

Description

The Integer to Bit Converter block maps each integer (or fixed point value) in the input vector to a group of bits in the output vector.

Ports

Input

In - input signal
integer | vector-column of integers

Input signal as an integer or vector-column of length N integers.

If M is specified by the parameter Number of bits per integer(M):

  • When the Number of bits per integer(M) parameter is set to Unsigned, the input values must be integers in the range [0, (2M- 1)].

  • When Number of bits per integer(M) is set to Signed, the input values must be integers in the range [(-2M-1 ), (2M-1 - 1)].

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Output

Out - input signal
bit scalar | bit vector-column

Output signal returned as a scalar or vector-column of bits of length M by N.

Data types: Float64.

Parameters

Number of bits per integer(M) - number of bits per integer (M)
3.0 (by default) | an integer in the range [1, 32]

The number of input bits mapped to each integer input as an integer in the value range [1, 32].

Usage in program code

Block parameter

nbits

Values

an integer in the range [1, 32]

By default

3.0

Treat input values as - treat input values as
Unsigned (by default) | Signed

Specify whether to treat input ranges of integer values as signed (Signed) or unsigned (Unsigned).

Usage in program code

Block parameter

SignedInputValues

Values

Unsigned | Signed

By default

Unsigned

Output bit order - output bit order
MSB first (by default) | LSB first

Determine whether the first bit of the output signal is the high bit (MSB) or the low bit (LSB).

Usage in program code

Block parameter

bitOrder

Values

MSB first | LSB first

By default

MSB first

Output data type - output data type
Int64 (by default) | Boolean

Set the data type of the output bits. You can select one of the following output data type options:

  • Int64.

  • Boolean

Additional options

C code generation: Yes