Home › Practice › RTL Design › 4-bit universal shift register
4-bit universal shift register
EasyRTLsequential
Build a 4-bit universal shift register controlled by a 2-bit mode.
rstis synchronous, active-high: whenrst=1on a risingclkedge,qbecomes4'b0000.- Otherwise, on each rising
clkedge:mode=2'b00: holdqunchanged.mode=2'b01: shift right, shiftingsinintoq[3]({sin, q[3:1]}).mode=2'b10: shift left, shiftingsinintoq[0]({q[2:0], sin}).mode=2'b11: parallel loaddintoq.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.