HDLbits
Browse Problems

Circuits/Sequential Logic

Left/Right Rotator

medium
shift-registerrotatorsequential

On reset, load d. Otherwise rotate the stored value one position per rising edge. rotate_right selects rotation direction; bits shifted out wrap around to the opposite end.