Bit Shift
Performs a logical or arithmetic shift of the input signal.
blockType: Bit Shift
Path in the library:
|
Description
Block Bit Shift performs a logical or arithmetic shift of the input signal.
The behavior of this block in modeling and code generation differs from the block Shift Arithmetic.
Block Shift Arithmetic shifts the bits or the binary point of the input number. This block has additional options for code generation compared to the block Bit Shift. When it is necessary to perform a variable shift operation, use the block Shift Arithmetic instead of a block Bit Shift. If a signed number is entered, the block expands the signed digit.
Ports
Input
#
IN_1
—
Input signal
scalar | vector | the matrix
Details
An input signal for which a logical or arithmetic shift is performed.
-
Minimum bit width:
2. -
Maximum bit width:
128.
| Data types |
|
| Complex numbers support |
Yes |
Output
#
OUT_1
—
Output signal
scalar | vector | the matrix
Details
The output signal for which a logical or arithmetic shift is performed. The output signal has the same data type and size as the input signal.
-
Minimum bit width:
2. -
Maximum bit width:
128.
| Data types |
|
| Complex numbers support |
Yes |
Parameters
Main
#
Shift Mode —
type and direction of the shift
Shift Left Logical | Shift Right Logical | Shift Right Arithmetic
Details
Specify the type and direction of the shift.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Shift Length (must be greater than or equal to zero) —
number of bits to shift
Int64 integer
Details
Set the number of bits for the shift to be greater than or equal to zero.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |