| Communications Blockset™ | ![]() |
Map vector of bits to corresponding vector of integers
Utility Blocks
The Bit to Integer Converter block maps groups of bits in the input vector to integers in the output vector.
For unsigned integers, if M is the Number of bits per integer , then the block maps each group of M bits to an integer between 0 and 2M-1. As a result, the output vector length is 1/M times the input vector length. For signed integers, if M is the Number of bits per integer , then the block maps each group of M bits to an integer between –2M-1 and 2M-1-1.
If the input signal is a sample-based input, then it must be a vector whose length equals the value for the Number of bits per integer parameter. If the input is frame-based, then it must be a column vector whose length is an integer multiple of Number of bits per integer.
The block can accept input data types double, single, boolean, int8, uint8, int16, uint16, int32, uint32 and ufix1.

The number of input bits that the block maps to each integer of the output. This parameter must be an integer between 1 and 32.
Defines whether the first bit of the input signal is the most significant bit (MSB) or the least significant bit (LSB). The default selection is MSB.
Indicates if the integer value input ranges should be treated as signed or unsigned. The default setting is Unsigned.
Note This parameter setting determines which Output data type selections are available. |
If the input values are unsigned integers, you can choose from the following Output data type options:
Inherit via internal rule
Smallest integer
Same as input
double
single
int8
uint8
int16
uint16
int32
uint32
boolean
If the input values are signed integers, you can choose from the following Output data type options:
Inherit via internal rule
Smallest integer
double
single
int8
int16
int32
The default selection for this parameter is Inherit via internal rule.
When the parameter is set to Inherit via internal rule, the block determines the output data type based on the input data type.
If the input signal is floating-point (either double or single), the output data type is the same as the input data type.
If the input data type is not floating-point, the output data type is determined as if the parameter is set to Smallest integer .
When the parameter is set to Smallest integer, the software selects the output data type based on the settings used in the Hardware Implementation pane of the Configuration Parameters dialog box.
If ASIC/FPGA is selected, the output data type is the smallest ideal integer or fixed-point data type, based on the setting for the Number of bits per integer parameter.
For all other selections, the output data type is the smallest available (signed or unsigned) integer word length that is large enough to fit the ideal minimum bit size.
If the input is [0; 1; 1; 1; 1; 1; 0; 1] when the value entered for the Number of bits per integer parameter is 4, the Input bit order is MSB, and After bit packing, treat resulting integer value as is Unsigned, then the output is [7; 13]. The block maps the first group of four bits (0, 1, 1, 1) to 7 and the second group of four bits (1, 1, 0, 1) to 13. Notice that the output length is one-fourth of the input length.
![]() | Bipolar to Unipolar Converter | BPSK Demodulator Baseband | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |