LogicGates.org Open the simulatorSimulator

Combinational vs sequential logic

One kind of circuit answers a question about right now. The other remembers what happened. The difference is a single wire looping backwards, and almost everything else follows from it.

The short answer

Combinational Sequential
Output depends on the inputs right now the inputs and the current state
Has feedback no yes, that is what makes it sequential
Described by a truth table, or a boolean expression a state diagram, or a characteristic table
Needs a clock no usually, to make state changes happen at known instants
Same inputs twice always the same output can give different outputs
Examples adders, multiplexers, decoders, comparators latches and flip-flops, registers, counters, state machines

Seen side by side

The clearest way to feel the difference is to look at two small circuits with the same two inputs.

An AND gate, combinational

a b out
0 0 0
0 1 0
1 0 0
1 1 1

Four rows and the circuit is fully described. Nothing about the past can change any of them.

An SR latch, sequential

S R Q what happened
0 0 0 idle, and it stays low
1 0 1 set: the output goes high
0 0 1 same inputs as row one, different output
0 1 0 reset: back to low
0 0 0 and it holds again

Read in order, not as a truth table. The two highlighted rows have identical inputs and different outputs, which no truth table can express.

How to tell them apart

There is one test, and it is visual: follow the wires and look for a loop.

  1. Trace from each output backwards. If any path leads back to an input of a gate you have already passed through, the circuit has feedback and is sequential.
  2. No loop means combinational. Depth does not matter: a four bit ripple carry adder is a couple of dozen gates, around nine deep along its longest path, and still has no memory at all.
  3. Try the same inputs twice. Set the inputs, note the output, change them, set them back. A combinational circuit returns to the same output every time; a sequential one may not.

The truth table generator refuses circuits with a loop for this reason: there is no single output to tabulate.

Why the clock arrives

Feedback brings a problem with it. A latch settles into its new state whenever its gates happen to catch up, so two latches fed from the same signal may change at slightly different moments. In a circuit of any size those small differences become races, where the result depends on which path happened to be faster.

A clock removes the question. Every flip-flop samples its input on the same edge, so every state change happens at one instant and each signal has a full clock period to settle before anything reads it. That is what makes a design analysable: you only have to check that the combinational logic between two flip-flops settles within one period, rather than reasoning about every possible ordering.

The usual shape is therefore both kinds together: blocks of combinational logic between registers of flip-flops, all sharing one clock. A processor is that pattern repeated.

Build one in the simulator

Try it directly: two NOR gates cross-coupled make an SR latch you can set and reset, and it is the smallest circuit with a memory. The learning path builds it step by step.

The two sequential circuits worth knowing next are both just flip-flops in a row: counters, where each stage toggles when the ones below it are high, and shift registers, where every stage passes its value along on each edge.

Questions

What is the difference between combinational and sequential logic?

Combinational logic depends only on the inputs right now, so the same inputs always give the same output and the circuit can be described completely by a truth table. Sequential logic feeds some of its outputs back into its inputs, so it has state: the output depends on the history of what happened, not only on the present.

How can I tell which one a circuit is?

Look for a loop. If you can trace a path from an output back round to an input, the circuit is almost certainly sequential; with no feedback anywhere it is combinational, no matter how many gates deep it goes. Treat it as a quick test rather than a definition: a schematic drawn with flip-flop symbols hides its loops inside them, and a rare feedback loop exists only to suppress a hazard and stores nothing.

Is a multiplexer combinational or sequential?

Combinational. It has a select input that changes which data line is passed through, but nothing is remembered: change the select and the output follows immediately. The same is true of adders, decoders, encoders and comparators.

Why does sequential logic need a clock?

It does not strictly have to have one, and a plain latch does not. But without a clock the feedback settles whenever it happens to, so timing depends on gate delays and races are easy to create. A clock makes every state change happen at one known instant, which is what makes a large design analysable.

Can a truth table describe a sequential circuit?

Not on its own. You need a characteristic table or a state diagram, which lists the next state for each combination of inputs and present state. The flip-flop pages show exactly that: the same inputs appear twice with different results, once for each present state.