Barrel Shifter
Easy · Combinational · SystemVerilog
Design a module that can perform right shifts by variable amounts.
The barrel shifter takes an input word {in} and a control signal {ctrl} that specifies how many positions the input should be shifted to the right. The shifting is logical, meaning zeros are shifted in from the left as bits move to the right. This type of module is commonly used in processors, multipliers, and data manipulation units, because it allows shifting by an arbitrary amount in a single clock cycle.