Engee documentation

Bits to Word

Converts a bit vector to an integer.

blockType: Bits to Word

Path in the library:

/Basic/Logic and Bit Operations/Bits to Word

Description

Block Bits to Word converts an input bit vector of length in -a bit integer. The output of the block is an unsigned integer with the length of the word. .

If for the parameter Input bit order the value is set LSB first, then the block considers the first element of the input vector as the least significant bit (LSB) of the output and considers subsequent bits as the next significant bits in ascending order.

For example, if at the entrance to the block Bits to Word falling bit vector [1 0 1 1 0], then the output will be an integer value 13.

Ports

Input

# IN_1 — input signal
binary scalar | binary vector

Details

Input signal as a binary scalar or vector. You can specify a vector containing up to 128 elements.

For example: [0 1 1 0 0 1 1 1].

Data types

fixdt(0,1,0).

Complex numbers support

No

Output

# OUT_1 — output signal
scalar

Details

-bit integer, where is the dimension of the input vector, returned as a non-negative scalar. For example, if you set the input signal with dimension 1 to 8, the output signal type will be an unsigned integer with data type ufix8.

Data types

Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Fixed.

Complex numbers support

No

Parameters

Parameters

# Input bit order — input bit order
LSB first | MSB first

Details

Input bit order:

  • MSB first - The first bit of the input signal is the senior significant bit (MSB).

  • LSB first - The first bit of the input signal is the least significant bit (LSB).

Values

LSB first | MSB first

Default value

LSB first

Program usage name

bitOrder

Tunable

No

Evaluatable

No

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

Details

Specify whether the resulting integer values after bit packing are treated as signed or unsigned.

Values

Unsigned | Signed

Default value

Unsigned

Program usage name

signedOutputValues

Tunable

No

Evaluatable

No