Skip to content

Electronics

Combinational vs sequential logic

A combinational circuit's output depends only on its inputs right now: change the inputs back and the output goes back too. A sequential circuit's output also depends on what happened before, because it stores some of its past in memory. Gates alone are combinational; add feedback, and usually a clock, and the circuit becomes sequential.

Combinational: a doorbell

A doorbell rings only while you press it. Every logic gate behaves the same way, and so does anything built from gates without loops: adders, decoders, multiplexers, comparators. For each set of inputs there's exactly one output, so a truth table describes the whole circuit.

Sequential: a light switch

A light switch stays where you leave it. To make gates do that, feed an output back into an input. Two NOR gates, each driving the other, form an SR latch:

SRQ
101 (set)
010 (reset)
00holds its last value
11avoid

The third row is the memory. With S and R both 0, the same inputs can give Q = 1 or Q = 0, depending on which one was pressed last. No truth table of inputs alone can describe that, which is exactly what makes it sequential.

Live experiment

Two gates that remember

Two NOR gates, each output feeding the other's input. Flip SET and let go: Pip, the Q output, stays lit. Flip RESET and let go: he stays dark. Then try both at once, and let go of both together.

Try it yourself: free lesson

“Latches and flip-flops” is lesson 5 of 6 in Logic Grid, Electronics World 7. Free with an account. Lessons unlock in order, so you’ll do the 46 before it first.

The latch holds itself: a NOR with any 1 in gives 0, so once Q is 1 it holds the other gate's output at 0, which keeps Q at 1. That's positive feedback, the same snap that gives a Schmitt trigger its two thresholds.

Adding a clock

A latch reacts the moment its inputs change, which gets messy in a big circuit. A D flip-flop stores one bit only on cue: at each rising edge of a clock, Q copies D, and in between it holds. Several flip-flops on one clock make a register, which holds a whole number and updates all its bits at once.

Most real designs are both

A processor is registers with combinational logic between them. On each clock edge the registers capture the logic's answers; between edges the gates work out the next ones from those stored values. The clock can tick only as fast as the slowest path of gates can settle.

Free lesson

Now build it yourself

Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.

Try it yourself: free lesson

“Latches and flip-flops” is lesson 5 of 6 in Logic Grid, Electronics World 7. Free with an account. Lessons unlock in order, so you’ll do the 46 before it first.

Or start from the very first lesson, no account needed

Practice questions

Three quick questions from the lessons. Pick an answer to check it.

  1. Question 1 of 3A D flip-flop copies D to Q…
    Show the answer

    Answer: at the rising clock edge. Only at the instant the clock goes from 0 to 1. Between edges, Q holds whatever it last copied.

    • Why not “while the clock is high”? Following D while the clock is high is what a D latch does. A flip-flop copies only at the instant the clock rises.
    • Why not “whenever D changes”? Copying D whenever it changes is what a plain wire does. A flip-flop ignores D between clock edges.
  2. Question 2 of 3In the D latch with ENABLE at 0…
    Show the answer

    Answer: Both ANDs give 0, nothing pushes, Q holds. SET = D AND ENABLE and RESET = NOT D AND ENABLE are both 0 when ENABLE is. The latch is left alone.

    • Why not “Q follows D”? Q follows D only while ENABLE is 1. At 0, the ANDs block D, so nothing reaches the latch.
    • Why not “Q is X”? Q is unknown only before the latch has ever been set or reset. Once it holds a value, ENABLE at 0 keeps it.
    • Why not “Q resets”? Resetting needs a 1 on RESET, but with ENABLE at 0 both ANDs output 0, so neither SET nor RESET is pushed.
  3. Question 3 of 3In a Schmitt trigger, positive feedback gives two thresholds. In a latch it gives…
    Show the answer

    Answer: memory. Positive feedback pushes a circuit into one of two stable states and holds it there. In a Schmitt trigger that's the snap between thresholds. In a latch it's memory.

    • Why not “filtering”? Filtering needs parts that respond to frequency, like capacitors. Positive feedback in a latch locks a state in place instead.
    • Why not “amplification”? An amplifier uses negative feedback to hold a steady gain. Positive feedback instead pushes a circuit into one of two states and keeps it there.
Keep practising: free lesson

“Latches and flip-flops” is lesson 5 of 6 in Logic Grid, Electronics World 7. Free with an account. Lessons unlock in order, so you’ll do the 46 before it first.

Questions people ask

What is the main difference between combinational and sequential circuits?

A combinational circuit's output depends only on its inputs right now. A sequential circuit's output also depends on what happened before, because it stores state in latches or flip-flops.

Is an adder combinational or sequential?

Combinational. A ripple-carry adder's outputs depend only on the two numbers going in. Put a register after it and feed the total back, and the whole thing becomes sequential: an accumulator that remembers a running total.

Why do sequential circuits need a clock?

A clock makes every flip-flop update at the same instant, at its rising edge. Between edges, the combinational logic has time to settle, so no flip-flop ever copies a half-finished answer.

Every topic