SECTION 01 / 6

Describing a Circuit — Functional Specification and Truth Tables

3 min read
On this page 6 headings

Start here You’re playing tic-tac-toe. Can we build a small electronic box that looks at the board and lights a red LED if X has won? Before building anything, we must say exactly what the box should do. That exact description is the first step of every circuit design.

Step 1: turn the problem into 0s and 1s

Each square becomes one bit: 1 if it has an X, 0 if not.
Each square becomes one bit: 1 if it has an X, 0 if not.
Open image ↗
Tic-tac-toe as bits
  • The board has 9 squares. Name them A11,A12,…A33A_{11} , A_{12} , \ldots A_{33} (row, column).
  • For each square: Aij=1A_{ij} = 1 if it holds an X, 0 otherwise.
  • Rule: X wins if all three squares in any row, column or diagonal are 1.
  • Output W=1W = 1 means “X has won” (red LED on).

Plain English (“X wins if they get three in a row”) can be unclear. Writing it in 0s and 1s makes it exact.

Two things to specify

Specification Question it answers Example
Functional specification What output for each input? W=1W = 1 when X has three in a line
Timing specification How fast does the output change after an input changes? The LED lights within a few nanoseconds

What makes something a “function”?

Property Meaning
Unique Each input combination gives one output value
Unambiguous The same input always gives the same output
No memory The output depends only on the inputs right now, not on what happened before
Press B, get biscuits, every time. The machine doesn’t remember who pressed before.
Press B, get biscuits, every time. The machine doesn’t remember who pressed before.
Open image ↗
A function has no memory

Combinational vs sequential logic

Combinational: output depends only on the inputs right now. Sequential: it also remembers the past.
Combinational: output depends only on the inputs right now. Sequential: it also remembers the past.
Open image ↗
Combinational vs sequential
Combinational logic Sequential logic (later weeks)
Memory? No Yes, it stores data
Output depends on Current inputs only Current inputs and past history
Example Calculator’s adder A counter, your phone’s memory

Weeks 2–5 are about combinational logic. Sequential logic comes from Week 7.

The truth table

A truth table lists every input combination and the output for each one.

A B Output
0 0 …
0 1 …
1 0 …
1 1 …

How many rows? With n inputs there are 2ⁿ rows (you learned this in Week 1).

The catch: tic-tac-toe has 9 inputs, so 2⁹ = 512 rows. Truth tables grow very fast as inputs increase:

Inputs Rows
2 4
3 8
4 16
9 512
20 over 1 million

That’s why we need a shorter way to describe circuits: Boolean algebra (next pages).

In one line: First describe the circuit exactly (functional and timing specification). A truth table lists all 2ⁿ input rows, but it grows too big too fast, so we also use Boolean algebra. Exam words: functional specification, timing specification, function (unique, unambiguous, no memory), combinational logic, sequential logic, truth table, 2ⁿ rows.


Quick check

How many rows does a truth table with 5 inputs have? 2⁵ = 32.
Does a combinational circuit have memory? No. Its output depends only on the current inputs.
True or false: “Sequential circuits do not use feedback loops, while combinational circuits do.” (a past-paper question) False. It’s the other way round: sequential circuits use feedback to remember; combinational circuits have no feedback.
What does the timing specification tell you? How quickly the output responds after the inputs change.
YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑