Engee documentation

Bits to Word

Converting a bit vector to an integer.

blockType: Bits to Word

Path in the library:

/Basic/Logic and Bit Operations/Bits to Word

Description

The block Bits to Word converts an input bit vector of length into -bit integer. The block outputs an unsigned integer with word length .

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

For example, if a bit vector [1 0 1 1 1 0] is input to the block Bits to Word, the output will be the 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