Documentation |
Package: comm
Convert vector of bits to vector of integers
The BitToInteger object maps groups of bits in the input vector to integers in the output vector.
To map bits to integers:
Define and set up your bit to integer object. See Construction.
Call step to map groups of bits in the input vector to integers in the output vector according to the properties of comm.BitToInteger. The behavior of step is specific to each object in the toolbox.
H = comm.BitToInteger creates a bit-to-integer converter System object™, H, that maps a vector of bits to a corresponding vector of integer values.
H = comm.BitToInteger(Name,Value) creates a bit-to-integer 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.BitToInteger(NUMBITS,Name,Value) creates a bit-to-integer converter System object, H This object has the BitsPerInteger property set to NUMBITS and the other specified properties set to the specified values.
BitsPerInteger |
Number of bits per integer Specify the number of input bits that the object maps to each output integer. You can set this property to a scalar integer between 1 and 32. The default is 3. |
MSBFirst |
Assume first bit of input bit words is most significant bit Set this property to true to indicate that the first bit of the input bit words is the most significant bit (MSB). The default is true. You can set this property to false to indicate that the first bit of the input bit words is the least significant bit (LSB). |
SignedIntegerOutput |
Output signed integers Set this property to true to generate signed integer outputs. The default is false. You can set this property to false to generate unsigned integer outputs. When you set this property to false, the output values are integers 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 output values are integers between -(2^{(N-1)}) and (2^{(N –1)}) –1. |
OutputDataType |
Data type of output Specify the output data type. The default is Full precision. When you set the SignedIntegerOutput property to false, set this property as one of Full precision | Smallest integer | Same as input | double | single | int8 | uint8 | int16 | uint16 | int32 | uint32. When you set this property to Same as input, and the input data type is numeric or fixed-point (fi object), the output data has the same type as the input data. 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 the SignedIntegerOutput property to true, specify the output data type as one of Full precision | Smallest integer | double | single | int8 | int16 | int32. 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 type as the input data. Otherwise, the property determines the output data type in the same way as when you set this property to Smallest unsigned integer. |
clone | Create bit to integer 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 bits to vector of integers |
This object implements the algorithm, inputs, and outputs described on the Bit To Integer Converter block reference page. The object properties correspond to the block parameters.