Select a course.
2.4 Boolean Logic
infoWhy this? Boolean logic explains how true-or-false conditions combine to determine outcomes in software and digital circuits. Moving between expressions, logic diagrams, and truth tables develops precise reasoning and allows us to check every possible input combination systematically.
scheduleWhy now? Earlier work on CPU architecture and binary representation now connects with the Boolean conditions used in recent programming and validation work. Returning to gates and truth tables consolidates the relationship between hardware logic and software decisions and strengthens our checking of combined conditions.
neurologyYou need to know
- Boolean logic represents two possible states: `1` means true and `0` means false.
- An AND gate, also called conjunction, outputs `1` only when all of its inputs are `1`.
- For an AND gate, the outputs for input pairs `00`, `01`, `10` and `11` are respectively `0`, `0`, `0` and `1`.
- An OR gate, also called disjunction, outputs `1` when at least one of its inputs is `1`.
- For an OR gate, the outputs for input pairs `00`, `01`, `10` and `11` are respectively `0`, `1`, `1` and `1`.
- A NOT gate, also called negation or an inverter, has one input and outputs the opposite Boolean value.
- For a NOT gate, an input of `0` produces `1`, while an input of `1` produces `0`.
- The standard AND gate symbol has a flat input side and a curved output side, while the standard OR gate symbol has a curved input side and a pointed output side.
- The standard NOT gate symbol is a triangle with a small inversion circle at its output.
- A truth table lists every possible combination of input values and the corresponding output value or values.
- A logic circuit with `n` independent Boolean inputs has `2^n` possible input combinations, so its truth table requires `2^n` rows.
- Boolean operators can be combined so that the output from one gate becomes the input to another gate.
- An inversion circle on a gate or connection indicates that the associated Boolean value is negated.
- In the expression `(A \mathbin{\mathrm{AND}} B) \mathbin{\mathrm{OR}} (\mathbin{\mathrm{NOT}} C)`, the intermediate results of `A \mathbin{\mathrm{AND}} B` and `\mathbin{\mathrm{NOT}} C` are inputs to the final OR operation.
- Alternative Boolean notation may use `T` and `F` instead of `1` and `0`, and symbols such as `\land`, `\lor` and `\lnot` for AND, OR and NOT respectively.
rocket_launchYou must be able to
- Recognise AND, OR and NOT gates from their standard logic-gate symbols.
- Complete the truth table for an AND, OR or NOT gate by applying the correct rule to every input combination.
- Construct a truth table containing all `2^n` input combinations for a circuit with `n` independent inputs.
- Trace a multi-gate logic diagram in sequence, recording each intermediate gate output before calculating the final output.
- Create a logic diagram from a Boolean expression or written scenario, connecting gates in the correct order.
- Derive a Boolean expression from a given logic diagram, using brackets to show how operators are combined.
- Edit a logic diagram or truth table so that it produces the outputs required by a stated scenario.
- Apply AND, OR and NOT operators to solve Boolean problems and justify each final output using intermediate values or a completed truth table.