Bits to Word
Converts a bit vector to an integer.
blockType: Bits to Word
Path in the library:
|
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 |
|
| 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 |
|
| 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 |
|
| Default value |
|
| Program usage name |
|
| 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 |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |