Bit Shift
R2026bLogical or arithmetic shift of input signal
Libraries:
HDL Coder /
Logic and Bit Operations
Description
The Bit Shift block performs a logical or arithmetic shift on the input signal.
This block is different from the Shift Arithmetic block in terms of
simulation and HDL code generation behavior. The Bit Shift block can
perform logical shifting of a signed number without having to perform a reinterpretcast operation. This
block uses a MATLAB Function block based implementation and might be
slower in operation.
The Shift Arithmetic block shifts the bits or binary point of the input
number. This block has additional block options for HDL code generation in comparison to
the Bit Shift block. When you want to perform a variable shift operation,
use the Shift Arithmetic block instead of the Bit Shift
block. If you have a signed number as input, the block performs a sign extension of the
number. The Shift Arithmetic block requires using additional Data Type Conversion blocks that have the Stored Integer
(SI) option selected.
Ports
Input
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"hdlsllib/Logic and Bit Operations/Bit Shift"
Example: add_block("hdlsllib/Logic and Bit Operations/Bit Shift","myModel/myBlock",MakeNameUnique="on")
