3.2.3 Translating Between Logic Representations
A single Boolean function can be described as a problem statement, a logic expression, a gate circuit, or a truth table. These forms look different, but they should produce the same output for every input combination.
This section develops systematic methods for moving between the representations. The emphasis is on preserving the logic exactly rather than guessing from the final output.
By the end of this section, you should be able to:
- Determine the number and order of rows required in a truth table.
- Construct a truth table from a logic expression.
- Read a logic expression from a gate circuit.
- Construct a truth table from a circuit using intermediate workspace columns.
- Construct a truth table from a problem statement.
- Create a logic expression from the output-1 rows of a truth table.
- Build a two-input-gate circuit from a truth table-derived expression.
- Check whether two representations describe the same Boolean function.
One logic function, four representations
| Starting point | Destination | Reliable method |
|---|---|---|
| Logic expression | Truth table | Create one workspace column for each operation and evaluate every row. |
| Logic circuit | Logic expression | Label each gate output and combine the labels from left to right. |
| Logic circuit | Truth table | Use a workspace column after each gate, then calculate the final output. |
| Problem statement | Truth table | Define the inputs, list every case, and apply the rule to each row. |
| Truth table | Logic expression | Create one AND term for each row where X = 1, then join the terms with OR. |
| Truth table | Logic circuit | Construct the expression first, then convert its operations into gates. |
Truth-table rows and workspace columns
With n independent Boolean inputs, a complete truth table requires 2n rows.
| Number of inputs | Required rows | Input combinations |
|---|---|---|
| 1 | 2 | 0, 1 |
| 2 | 4 | 00, 01, 10, 11 |
| 3 | 8 | 000 through 111 in binary order |
| 4 | 16 | 0000 through 1111 in binary order |
A workspace column records the result of one intermediate operation. Complex tables become much easier when every NOT, AND, OR, NAND, NOR, or XOR stage has its own column.
Exam tip
Complete the input columns before calculating any output. For three inputs, check that there are exactly eight distinct rows.
Logic expression β truth table
X = (A OR NOT B) AND C
Break the expression into smaller operations:
- M = NOT B
- N = A OR M
- X = N AND C
| A | B | C | M = NOT B | N = A OR M | X = N AND C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 1 | 1 |
Exam tip
Evaluate bracketed and NOT operations first. The final output column should be calculated only after all of its input columns are complete.
Common mistake
Do not treat NOT B as if it changes A or C. The NOT operation affects only the signal immediately following it.
Logic circuit β logic expression
Read a circuit from its inputs towards the final output. Place a label immediately after each gate and write the expression that produces that label.
| Signal | How it is produced |
|---|---|
| M | M = NOT A |
| N | N = B XOR C |
| X | X = M OR N |
Substitute the definitions of M and N into the final line:
X = (NOT A) OR (B XOR C)
Common mistake
Do not name only the final gate. The output is not simply βORβ; it is the OR of two earlier results, and those results must also appear in the expression.
Logic circuit β truth table
Use the same intermediate labels as workspace columns. Evaluate the gates in signal-flow order.
| A | B | C | M = NOT A | N = B XOR C | X = M OR N |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 |
The structure gives a useful check: whenever A = 0, M = 1, so the final OR output must also be 1. The first four output values should therefore all be 1.
Exam tip
Look for structural checks. A fixed input or an early NOT gate may force part of the output column to a predictable value.
Problem statement β truth table
Define the inputs and output:
- A = 1 when the cabinet is unlocked.
- B = 1 when the laboratory is occupied.
- X = 1 when the warning activates.
X = A AND NOT B
| A | B | NOT B | X = A AND NOT B | Interpretation |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | The cabinet is locked. |
| 0 | 1 | 0 | 0 | The cabinet is locked. |
| 1 | 0 | 1 | 1 | Unlocked and nobody is present. |
| 1 | 1 | 0 | 0 | An occupied laboratory does not trigger this warning. |
The expression is a useful intermediate step, but the table must still include every possible combinationβeven combinations that seem unlikely in normal operation.
Truth table β logic expression
Use only the rows where the output is 1. Each selected row becomes an AND term.
| A | B | X | AND term for this row |
|---|---|---|---|
| 0 | 0 | 1 | NOT A AND NOT B |
| 0 | 1 | 0 | Not used |
| 1 | 0 | 0 | Not used |
| 1 | 1 | 1 | A AND B |
How one row becomes a term
- An input value of 1 uses the variable itself.
- An input value of 0 uses the inverted variable.
- The inputs within one row are joined using AND.
- Different output-1 rows are joined using OR.
X = (NOT A AND NOT B) OR (A AND B)
This expression produces 1 when the two inputs match. It has been constructed directly from the table; no simplification is required.
Common mistake
For an output-1 row, an input value of 0 must appear as a NOT term. Omitting the inversion would describe a different row.
Truth table β logic circuit
After producing the expression, convert each operation into gates:
- Create NOT A and NOT B.
- Use one AND branch for NOT A AND NOT B.
- Use a second AND branch for A AND B.
- Combine the two branch outputs with OR.
- Label the final output X.
Exam tip
Keep the output-1 rows visible while drawing. Each row should correspond to one AND route, and the routes should be combined by OR gates.
Interactive prerequisite: Truth Table Lab
The existing widget has been retained for practising gate-level row evaluation. Use it to confirm the behaviour of one operator before applying that operator inside a larger workspace table.
Checking whether representations are equivalent
Two expressions or circuits are functionally equivalent when they produce the same output for every possible input combination.
| Check | What to compare |
|---|---|
| Expression against circuit | Confirm that every operator appears as the correct gate and in the correct grouping. |
| Circuit against truth table | Evaluate all intermediate gate outputs and compare the final X column. |
| Two expressions | Construct both output columns using the same ordered input rows. |
| Problem statement against table | Interpret every output-1 row in words and check that it satisfies the rule. |
Matching only one or two test cases is not proof of equivalence. A complete truth table provides a systematic comparison.
Exam support
Use workspace rather than mental shortcuts
Add a column after each gate or sub-expression. Complete the columns from left to right until the final output can be calculated.
Truth table to expression
Use only rows where X = 1. Within each row, 1 means the normal variable and 0 means its NOT form. AND the row conditions, then OR the rows.
Preserve the given function
Do not simplify or alter an expression unless the question asks you to. The aim is to translate the representation accurately.
Common mistakes and misconceptions
- Using the wrong number of rows for the number of inputs.
- Calculating a later workspace column before its inputs are ready.
- Reading a circuit from right to left and losing the grouping.
- Using output-0 rows instead of output-1 rows when constructing an expression.
- Forgetting to invert variables whose row value is 0.
- Joining conditions from one row with OR instead of AND.
- Joining separate output-1 rows with AND instead of OR.
- Assuming that a few matching test cases prove complete equivalence.
Practice
Expression β truth table
Construct a complete truth table, including workspace columns, for:
X = (A NAND B) OR C
Problem statement β truth table
A warning is produced when a laboratory window is open and the security system is armed.
- Define A, B, and X.
- Write the logic expression.
- Construct the complete truth table.
Truth table β expression and circuit
| A | B | X |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
- Create one AND term for each output-1 row.
- Combine the terms into a complete expression.
- Draw a circuit using AND, OR, and NOT gates.
- Identify a single standard gate with the same output pattern.
Circuit-reading challenge
A circuit first calculates M = A NOR B. It then calculates X = M XOR C.
- Write X as one expression without M.
- Construct the eight-row truth table using M as workspace.
Self-check: reveal the standard gate in the third task
The output pattern 0, 1, 1, 0 is XOR. The unsimplified expression is (NOT A AND B) OR (A AND NOT B).
Review
| Translation | Core method |
|---|---|
| Expression β truth table | Create workspace columns for the operations and evaluate every input row. |
| Circuit β expression | Label gate outputs and substitute them into the final expression. |
| Circuit β truth table | Use one workspace column after each gate. |
| Problem statement β truth table | Define the propositions, write the rule, and evaluate every case. |
| Truth table β expression | AND the conditions within each output-1 row; OR the rows together. |
| Truth table β circuit | Create the expression first, then draw a gate for each operation. |
| Equivalence check | Compare complete output columns for the same ordered input combinations. |