Academy
English한국어

18 / 24 · Concept

Read a serial input over time

Organize a stream of one-bit inputs into a timeline.

Learning goals

  • Organize serial input values by edge
  • Distinguish the newest input from the stored vector

Data arriving one bit at a time

din is one bit, so 1011 does not arrive in one instant. Supply 1, 0, 1, 1 for four successive rising edges. q stores the three most recently sampled bits together.

Assume the input is stable before each edge and reset is inactive. Changing din between edges does not update storage until the next rising edge.

SampledinOld qNext q
11000001
20001010
31010101
41101011

Why the input string is not the final register

After the fourth sample, q=011 represents the latest three inputs, 0, 1, 1, from older to newer. The first 1 has shifted out. This is not a memory of the complete input history.

The first din=0 in the supplied input file occurs during reset. Number the four data samples 1, 0, 1, 1 separately from that reset cycle to align the table with the waveform.

Try it yourself

After reset, what does q become after three consecutive input bits of 1?

Read the explanation

001 → 011 → 111. Each new 1 enters q[0], while older bits move toward higher indices.

Your choice applies to this browser. Change it any time using the footer.