"101" sequence detector circuit: build and simulate it online

A Moore machine that raises Z after it has seen 1, 0, 1 on X (overlapping allowed).

Build the "101" sequence detector in the free online simulator — it checks your circuit automatically.

What you need

  • 2 logic switches labelled X, CLK
  • 1 probes labelled Z
  • 2 flip-flops
  • a few gates

Step by step

  1. Inputs and outputs. From the Logic section of the library, drop digital inputs (0/1 boxes) or logic switches for the inputs, and digital outputs or probes for the outputs; give each its label in the inspector (the checker finds them by label). Switches X, CLK; Probe Z
  2. Choose your states. Four states: S0 (nothing), S1 (seen 1), S2 (seen 10), S3 (seen 101, Z = 1). Two D flip-flops hold the state.
  3. Next-state and output logic. Work out D1, D0 from the state table (a K-map helps), and Z from the state. Any correct design passes. From S3, X = 0 goes to S2 (overlap)
  4. Prove it. The checker feeds 1 0 1 1 0 1 0 0 and reads Z after each clock.

Expected sequence

#inputsclockZ
1X=1↑0
2X=0↑0
3X=1↑1
4X=1↑0
5X=0↑0
6X=1↑1
7X=0↑0
8X=0↑0

Frequently asked questions

How do you build a "101" sequence detector?

A Moore machine that raises Z after it has seen 1, 0, 1 on X (overlapping allowed). In short: inputs and outputs, then choose your states, then next-state and output logic, then prove it.

How does a "101" sequence detector behave clock by clock?

It is checked over 8 steps: X = 1, X = 0, X = 1, X = 1, …. The table on this page shows the expected Z after each clock.

What parts do you need for a "101" sequence detector?

2 flip-flops; a few gates — plus logic switches for the inputs and probes for the outputs.

Can I simulate a "101" sequence detector online for free?

Yes. Open it in the BitForBytes Embedded Lab, a free browser-based circuit and logic simulator: drag in the gates, wire them, and press "Check my circuit" — every clock cycle is simulated and marked for you. No download or sign-up needed.

Part of DSD 39 · Sequence detectors in the free BitForBytes digital system design course.

More state machines builds