You construct a truth table by listing every possible combination of input values, then tracing each combination through the logic gates in circuit order. Record intermediate results before calculating the final output.
Method
A truth table shows how a logic circuit's output depends on its binary inputs. Follow these steps:
- Identify the input variables and the final output.
- Calculate the number of rows using , where is the number of inputs.
- List all input combinations systematically.
- Label the output of each gate as an intermediate variable.
- Evaluate the gates from the inputs toward the final output, one row at a time.
For two inputs, use 00, 01, 10, 11. For three inputs, continue in binary order from 000 to 111. This ordering ensures the rightmost input changes every row, while each input to its left changes half as often.
For example, consider a circuit where:
Because there are two inputs, the table requires rows.
An AND gate outputs 1 only when both inputs are 1. An OR gate outputs 1 when at least one input is 1. Therefore, each intermediate column can be calculated independently before its value passes to the next gate.
The intermediate columns make the sequence of operations visible and reduce mistakes in circuits containing several gates. Evaluate NOT gates carefully because they reverse the input: becomes , and becomes .
A common misconception is that a circuit with inputs needs rows. It needs rows because each input has two possible states.
Exam Technique
In an IB Computer Science response, show every input combination and include intermediate gate outputs when working is required. Follow the circuit's connections rather than assuming standard mathematical precedence, and check that no input combination has been omitted or duplicated. If the command term is construct, the examiner expects the completed table, not merely a description of the process.