Engee documentation

Bit to Integer Converter

Maps a vector of bits to the corresponding vector of integers.

blockType: BitToIntegerConverter

Path in the library:

/Basic/Logic and Bit Operations/Bit to Integer Converter

Description

Block Bit to Integer Converter maps groups of bits in the input vector to integers in the output vector.

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

  • For unsigned integers, the block matches each group of an integer bit in the range . As a result, the length of the output vector in times less than the length of the input vector.

  • For signed integers, the block matches each group of an integer bit in the range .

Ports

Input

# IN_1 — Input signal
bit scalar | A vector is a column of bits

Details

The input signal, in the form of a scalar or a column vector of bits with a length multiple of the value specified in the parameter Number of bits per integer (M). The input data must be bits with values 0 or 1.

Data types

Int8, Int16, Int32, UInt8, UInt16, UInt32, Float32, Float64, Bool

Complex numbers support

Yes

Output

# OUT_1 — Output signal
an integer | A vector is a column of integers

Details

The output signal returned as an integer or a column vector of integers. Parameter After bit packing, treat resulting integer values as determines whether the output integers are interpreted as unsigned or signed.

  • When the input bits are treated as unsigned, each integer in the output is in the range .

  • When the input bits are treated as signed, each integer in the output is in the range .

Data types

Int8, Int16, Int32, UInt8, UInt16, UInt32, Float32, Float64

Complex numbers support

Yes

Parameters

Main

# Number of bits per integer (M) — number of bits per integer (M)
Int64 integer

Details

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

Default value

3

Program usage name

nBits

Tunable

No

Evaluatable

Yes

# Input bit order — the order of the bits in the input
MSB first | LSB first

Details

Determine if the first bit of the input signal is the highest bit (MSB first) or the low - order bit (LSB first).

Values

MSB first | LSB first

Default value

MSB first

Program usage name

bitOrder

Tunable

No

Evaluatable

No

# After bit packing, treat resulting integer values as — treat output values as signed or unsigned numbers
Unsigned | Signed

Details

Specify whether the output values should be treated as signed numbers (Signed) or unsigned (Unsigned).

Values

Unsigned | Signed

Default value

Unsigned

Program usage name

signedOutputValues

Tunable

No

Evaluatable

No

# Output data type — type of unsigned output data
Same as input | Float64 | Float32 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32

Details

If the output integers are unsigned, then you can choose one of the following output data type options:

  • Same as input

  • Float64

  • Float32

  • Int8

  • UInt8

  • Int16

  • UInt16

  • Int32

  • UInt32

Dependencies

To use this parameter, set for the parameter After bit packing, treat resulting integer values as meaning Unsigned.

Values

Same as input | Float64 | Float32 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32

Default value

UInt32

Program usage name

outDtype

Tunable

No

Evaluatable

No

# Output data type — the type of signed output data
Float64 | Float32 | Int8 | Int16 | Int32

Details

If the output is signed integers, then you can choose one of the following output data type options:

  • Float64

  • Float32

  • Int8

  • Int16

  • Int8

Dependencies

To use this parameter, set for the parameter After bit packing, treat resulting integer values as meaning Signed.

Values

Float64 | Float32 | Int8 | Int16 | Int32

Default value

Int32

Program usage name

outDtypeSigned

Tunable

No

Evaluatable

No

Additional options

C code generation: Yes