Skip to content

Shift Right

Bitwise right shift on an integer signal: out = in >> shift. Logical mode fills with zeros; arithmetic mode preserves the sign bit (divide-by-2^shift for signed integers).

Category: Digital Logic / Bits

Keywords: shr, >>, shift, right shift, right-shift, bit, bitwise, arithmetic shift, logical shift, divide

Ports

NameDirectionValue typeNotes
ininputint
outoutputint

Parameters

NameLabelTypeDefaultUnitsDescription
shiftShiftint1Number of bit positions to shift right.
arithmeticModeenum (logical (zero-fill) / arithmetic (sign-extend))00 = logical right shift (zero-fill from the left). 1 = arithmetic right shift (sign-bit replicated, preserves sign of negative numbers).

Implemented in C++ class SimCompCtlShr (components/control/CSim_comp_ctl_shr/sim_comp_ctl_shr.h).

Released under the MIT License.