8-bit Serial-In Parallel-Out Shift Register

Easy · Sequential Logic

Design an 8-bit serial-in, parallel-out (SIPO) shift register with a shift enable. Serial data arrives MSB first: after eight enabled shifts, the first bit received is in q[7] and the last bit received is in q[0].

Ports

PortDirWidthMeaning
clkinput1Clock. All state changes happen on the rising edge.
rstinput1Synchronous, active-high reset (takes effect only at a rising edge of clk).
eninput1Shift enable.
dininput1Serial data input.
qoutput8Register contents (registered output).

Behavior

At every rising edge of clk, in priority order:

  1. If rst = 1: q becomes 8'h00.
  2. Else if en = 1: every bit moves one position toward the MSB and din enters at the

LSB: q[7:1] <= q[6:0], q[0] <= din. The old q[7] is discarded.

  1. Else (en = 0): q keeps its value; din is ignored.

q changes only on rising edges (no combinational path from din or en to q).

Example

Receiving the byte 8'hB4 = 1011_0100, MSB first, starting from reset:

edgerstendinq after the edge
01xx0000_0000
10110000_0001
20100000_0010
30010000_0010 (hold: en = 0)
40110000_0101
50110000_1011
60100001_0110
70110010_1101
80100101_1010
90101011_0100 = 8'hB4

Sign up free to solve 8-bit Serial-In Parallel-Out Shift Register in your browser.

More Sequential Logic problems