| Communications Blockset™ | ![]() |
Utility Blocks
The Integer to Bit Converter block maps each integer or fixed-point value in the input vector to a group of bits in the output vector.
The block maps each integer value (or stored integer when a fixed point input is used) to a group of M bits, using the selection for the Output bit order to determine the most significant bit. The resulting output vector length is M times the input vector length.
For integer-valued inputs, if M is the Number of bits per integer and Treat input values as is set to Unsigned, then the input values must be between 0 and 2M-1. If M is the Number of bits per integer and Treat input values as is set to Signed, then the block maps each group of M bits to an integer between –2M-1 and 2M-1-1.
This block is single-rate and single-channel. The input can be either a scalar or a frame-based column vector. The output is always a column vector with a length equal to Number of bit per integer times larger than the input signal length.
A simulation-only runtime input value check is performed. If any input value is outside of the Number of bit per integer value range, the block will issue an error.
The block can accept the data types int8, uint8, int16, uint16, int32, uint32, single, double, and fixed point.

The number of bits the block uses to represent each integer of the input. This parameter must be an integer between 1 and 32.
Indicate if the integer value input ranges should be treated as signed or unsigned. The default setting is Unsigned.
Define whether the first bit of the output signal is the most significant bit (MSB) or the least significant bit (LSB). The default selection is MSB first.
You can choose the following Output data type options:
Inherit via internal rule
Smallest integer
Same as input
double
single
uint8
uint16
uint32
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 single or double), 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 block selects the output data type based on settings used in the Hardware Implementation pane of the Configuration Parameters dialog box.
If ASIC/FPRA is selected, the output data type is the ideal one-bit size; ufix1.
For all other selections, the output data type is an unsigned integer with the smallest available word length, as defined in the Hardware Implementation settings (e.g. uint8)
If the input is [7; 13], the value for the Number of bits per integer parameter is 4, and the Output bit order is MSB first, then the output is [0; 1; 1; 1; 1; 1; 0; 1]. The first group of four bits (0, 1, 1, 1) represents 7 and the second group of four bits (1, 1, 0, 1) represents 13. Notice that the output length is four times the input length.
de2bi and dec2bin
![]() | Integer-Output RS Decoder | Integrate and Dump | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |