1.4.3 - Boolean problems, gates and truth tables

1.4.3 - Boolean problems, gates and truth tables

Boolean logic turns a precise two-state decision into an expression, a circuit and a table of every possible outcome. You will learn to move between these representations while checking that they describe the same rule.

Defining a Boolean problem

A Boolean variable represents one of two logical states, true or false; in circuit tables we normally write these as 1 and 0.

Start by defining what each variable means. For a workshop ventilation system, let H=1H=1 mean the room is too hot, F=1F=1 mean fumes are detected and M=1M=1 mean maintenance mode is selected. These are complete propositions. A temperature such as 27 degrees is a measurement; the proposition “temperature exceeds the threshold” is a Boolean condition derived from it.

Suppose the fan should run when the room is too hot or fumes are detected, but only when maintenance mode is off. The requirement becomes

R=(H∨F)∧¬M.R=(H\lor F)\land\neg M.

The brackets make the intended grouping explicit. “But only when maintenance mode is off” applies to the entire demand H∨FH\lor F, rather than just to fumes. Thus H=1,F=0,M=1H=1,F=0,M=1 gives R=0R=0: maintenance prevents operation even though the room is hot.

The wording and variable definitions matter as much as the symbols. If MM instead meant “maintenance is complete”, the negation would no longer express the same policy. Likewise, a condition that the fan must never run while the cover is open needs an explicit variable and restriction; a truth table cannot infer an unstated safety requirement.

AND, OR, NOT and XOR

Each logic operator gives a definite output for its input states, so its name alone is insufficient without its truth condition.

OperatorOutput is 1 when…OCR printed notationRecognised alternative notation
ANDBoth inputs are 1A∧BA\land BA⋅BA\cdot B, A AND B
ORAt least one input is 1A∨BA\lor BA+BA+B, A OR B
NOTIts single input is 0¬A\neg AA‾\overline{A}, NOT A, ~A
XORExactly one of two inputs is 1A∨‾BA\underline{\lor}BA⊕BA\oplus B, A XOR B

Exclusive OR (XOR)

Exclusive OR gives 1 when exactly one of its two inputs is 1. The underlined vee distinguishes OCR's printed XOR from ordinary OR. This lesson uses the recognised alternative ⊕\oplus for XOR so that the difference remains clear.

Boolean plus and dot mean OR and AND here; they are not ordinary numerical addition and multiplication. In particular, 1∨1=11\lor1=1, while 1⊕1=01\oplus1=0.

Ordinary OR is inclusive: both conditions may be true. A warning light activated by either of two faults should usually stay on when both occur, so OR is appropriate. A selector that is valid only when exactly one of two switches is selected needs XOR. Negation applies to whatever it encloses: ¬(A∨B)\neg(A\lor B) reverses the combined OR result, whereas (¬A)∨B(\neg A)\lor B reverses only AA.

Gate symbols represent these same operations as components. Wires carry logical states from inputs on the left to the output on the right. A NOT gate has a small output bubble for inversion; the extra curved line on the input side distinguishes XOR from OR.

[DIAGRAM: Conventional symbols and output conditions for AND, OR, NOT and XOR; asset_slug: gate-symbols; caption: Four mandatory gates with their distinct output conditions.]
Four mandatory gates with their distinct output conditions.

Building a complete truth table

A truth table lists every possible input combination and the corresponding output, rather than a selection of convenient examples.

With nn independent Boolean inputs there are 2n2^n combinations. Two inputs require four rows; three require eight. List them in binary counting order to avoid omissions. Either 0/1 or false/true is usable if the convention is explicit and consistent.

AABBA∧BA\land BA∨BA\lor BA⊕BA\oplus B
00000
01011
10011
11110

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account