Appearance
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
| Name | Direction | Value type | Notes |
|---|---|---|---|
in | input | int | |
out | output | int |
Parameters
| Name | Label | Type | Default | Units | Description |
|---|---|---|---|---|---|
shift | Shift | int | 1 | — | Number of bit positions to shift right. |
arithmetic | Mode | enum (logical (zero-fill) / arithmetic (sign-extend)) | 0 | — | 0 = 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).