📘 CodingMarble Learn

Digital Electronics: Combinational and Sequential Circuits

Digital electronics uses only two voltage levels, called 0 and 1. A combinational circuit gives an output that depends only on the inputs right now. You design it in four steps: write the truth table, write an expression, simplify it (a Karnaugh map helps), and draw the gates. A sequential circuit also has memory, so its output depends on the inputs and on what happened before. A flip-flop is the basic memory cell: it copies its input D only when the clock pulses. Flip-flops joined together make counters and registers. A simulator lets you test every input before you build the real circuit.

🎬 Step-by-step story

  1. Digital means two levels only. A wire is 0 (off) or 1 (on). The lamp follows the switch.
  2. A combinational circuit joins gates. Its output F depends only on the inputs right now.
  3. A truth table lists every input row. Green rows are the rows where F is 1.
  4. A Karnaugh map puts the same table in a grid. Big groups of 1s give a short expression.
  5. A flip-flop is a memory. D can change, but Q only changes when the clock pulses.
  6. Your turn: a counter adds one on every clock. The F circuit reads the count.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why do computers use only 0 and 1?

Two levels are easy to tell apart, even with noise. The lamp has only two states, on or off.

Does a combinational circuit ever remember anything?

No. Change the inputs and F changes at once. Nothing is stored.

Why simplify a circuit at all?

Fewer gates mean lower cost, less power and less delay. The same F can need five terms or only two.

Why is the K-map column order 00, 01, 11, 10?

Neighbours must differ in exactly one input. Look at the cursor move one cell at a time.

Why does Q not change when D changes?

The flip-flop looks at D only at the clock pulse. Between pulses it holds its stored bit.

How is a counter made from flip-flops?

The flip-flops store the bits, and each clock pulse adds one. Watch the count go 000 to 111 and wrap round.

What digital electronics means

In a digital circuit every wire has only two levels. High voltage is 1. Low voltage is 0. Small noise does not matter, because 0.2 V and 0.1 V are both read as 0.

Two levels are easy to copy, store and send. That is why phones, computers and calculators are digital.

The building blocks are logic gates: NOT, AND, OR, NAND, NOR, XOR. Joined together they make circuits.

Combinational circuits: designing a logic circuit

In a combinational circuit the output depends only on the present inputs. It has no memory. Same inputs, same output, always.

Design in 4 steps:

  1. Write what the circuit must do as a truth table (2n rows for n inputs).
  2. For every row with output 1, write an AND term (a minterm). Use A for 1 and A′ for 0. Join the terms with OR. This is the sum of products.
  3. Simplify the expression so it needs fewer gates.
  4. Draw the gates and check every row.

Our example is F = A·B + C′. The circuit uses one AND gate, one NOT gate and one OR gate.

Truth table and sum of products

For F = A·B + C′ the rows with F = 1 are 000, 010, 100, 110 and 111. Writing a minterm for each one gives five terms: A′B′C′ + A′BC′ + AB′C′ + ABC′ + ABC. This is correct but long. Simplifying makes it short.

A B CF
0001
0010
0101
0110
1001
1010
1101
1111

Simplifying with Karnaugh maps

A Karnaugh map (K-map) is the truth table drawn as a grid. Neighbouring cells differ in only one input, so we can join them.

Rules:

In our map the four cells with C = 0 form one group: only C′ stays fixed, so the term is C′. The cells 110 and 111 form a group of 2: A and B stay fixed, so the term is A·B.

Result: F = C′ + A·B. Five minterms became two small terms.

Sequential circuits and flip-flops

A sequential circuit has memory. Its output depends on the present inputs and on its stored past. A clock, a steady train of pulses, tells it when to update.

The basic memory cell is the flip-flop. A D flip-flop has input D, a clock and output Q. When the clock pulses, Q copies D. Between pulses Q keeps its value, even if D changes. One flip-flop stores one bit.

TypeOutput depends onExample
Combinationalpresent inputs onlyadder, decoder, F circuit
Sequentialinputs and pastcounter, register, traffic light

Counters and registers

Several flip-flops in a row make a register, which stores a whole number. A counter is a register that adds 1 on every clock pulse. A 3-bit counter counts 000, 001, 010, ... 111 and then goes back to 000. It has 23 = 8 states.

Digital clocks, timers and traffic lights all use counters. In the 3D, the counter bits feed the F circuit, so you can watch F change as the count goes up.

Testing in a simulator

A simulator is free software where you drag gates and flip-flops, join them with wires and press play. It lets you test every row of the truth table before you buy parts.

Good testing habits:

Key formulas and definitions

Worked examples

1. How many rows does a truth table for 4 inputs have?

2⁴ = 16 rows.

2. Find F = A·B + C′ when A = 1, B = 0, C = 1.

A·B = 0 and C′ = 0, so F = 0 + 0 = 0.

3. A circuit gives F = 1 only for the inputs 011 and 111 (A B C). Write F and simplify.

F = A′BC + ABC. Both terms contain BC. Take BC out: F = BC(A′ + A) = BC·1 = BC. In a K-map, the two 1s are neighbours and form one group of 2 where B and C stay fixed.

4. A D flip-flop has Q = 0. D is set to 1, then D is set to 0, and then the clock pulses. What is Q?

Q only reads D at the clock pulse. At that moment D = 0, so Q stays 0. The short time when D was 1 did not matter.

5. How many clock pulses bring a 3-bit counter from 101 back to 101?

It has 8 states, so 8 pulses return it to the same state.

6. Simplify with a K-map the function with ones at 000, 001, 100 and 101.

The four cells are A′B′C′, A′B′C, AB′C′, AB′C. B is 0 in all four, while A and C take both values. They form one group of 4 and only B′ stays fixed. F = B′.

Common mistakes

Practice quiz

1. In a combinational circuit the output depends on:
2. Which group size is NOT allowed in a K-map?
3. A D flip-flop copies D to Q:
4. How many states does a 4-bit counter have?
5. Which circuit is sequential?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the difference between combinational and sequential circuits?

Combinational circuit output depends only on present inputs. Sequential circuit output also depends on past inputs, because it has memory (flip-flops).

What is a Karnaugh map used for?

It simplifies a Boolean expression by grouping neighbouring 1s, giving a circuit with fewer gates.

What does a D flip-flop do?

It stores one bit. At each clock pulse, its output Q copies the input D, and Q holds that value until the next pulse.

Where this is taught

Spain2º BachilleratoElectrical and electronic systems
Japan高校(専門学科)1〜3年Hardware Technology

Learn first

Learn next

Related lessons

All Computer Science lessons