Convert vector of integers to vector of bits
The IntegerToBit object maps each integer (or fixed-point value) in the input vector to a group of bits in the output vector.
To map integers to bits:
H = comm.IntegerToBit creates an integer-to-bit converter System object™, H. This object maps a vector of integer-valued or fixed-point inputs to a vector of bits.
H = comm.IntegerToBit(Name,Value) creates an integer-to-bit converter object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).
H = comm.IntegerToBit(NUMBITS,Name,Value) creates an integer-to-bit converter object, H. This object has the BitsPerInteger property set to NUMBITS and the other specified properties set to the specified values.
Number of bits per integer
Specify the number of bits the System object uses to represent each input integer. You must set this property to a scalar integer between 1 and 32. The default is 3.
Output bit words with first bit as most significant bit
Set this property to true to indicate that the first bit of the output bit words is the most significant bit (MSB). The default is true. Set this property to false to indicate that the first bit of the output bit words is the least significant bit (LSB).
Assume inputs are signed integers
Set this property to true if the integer inputs are signed. The default is false. Set this property to false if the integer inputs are unsigned. If the SignedIntegerInput property is false, the input values must be between 0 and (2^N)–1. In this case, N is the value you specified in the BitsPerInteger property. When you set this property to true, the input values must be between –(2(N–1)) and (2(N–1))–1.
Data type of output
Specify output data type as one of Full precision | Smallest unsigned integer | Same as input | double | single | int8 | uint8 | int16 | uint16 | int32 | uint32 | logical. The default is Full precision.
When the input signal is an integer data type, you must have a Fixed-Point Designer™ user license to use this property in Smallest unsigned integer or Full precision mode.
When you set this property to Full precision, the object determines the output data type based on the input data type. If the input data type is double- or single-precision, the output data has the same data type as the input data. Otherwise, the output data type is determined in the same way as when you set this property to Smallest unsigned integer.
When you set this property to Same as input, and the input data type is numeric or fixed-point integer (fi object), the output data has the same data type as the input data.
|clone||Create an integer-to-bit converter object with same property values|
|getNumInputs||Number of expected inputs to step method|
|getNumOutputs||Number of outputs from step method|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|step||Convert vector of integers to vector of bits|
This object implements the algorithm, inputs, and outputs described on the Integer to Bit Converter block reference page. The object properties correspond to the block parameters.