← ProblemsCircuits / Sequential Logic / Shift Registers
Left/right rotator
15%shift-registersvectorsBuild a 100-bit left/right rotator with parallel load. Unlike a shifter, a rotator wraps the bit shifted off one end back into the other end — no bits are lost or created.
load— loaddata[99:0]into the register (priority over rotation)ena[1:0]selects the operation:2'b01— rotate right by one (q[0]wraps around toq[99])2'b10— rotate left by one (q[99]wraps around toq[0])2'b00and2'b11— hold
There is no reset.