Design a 4-bit SIPO register that shifts a serial input stream MSB-first. On each rising edge of CLK, the new bit is inserted into Q[3] and the existing bits shift right.
sipo4CLKRSTserial_inQ[3:0]RST=1 → Q=4'b0000.posedge CLK with RST=0: Q <= {serial_in, Q[3:1]} (MSB-first).Starting from Q=0000, applying serial bits 1,0,1,1 on consecutive rising edges produces:
Q=1000Q=0100Q=1010Q=1101