3.1.4 · D1Boolean Algebra & Logic Gates

Foundations — Boolean variables and operations (AND, OR, NOT)

1,745 words8 min readBack to topic

This page is a toolbox check. The parent note throws around , , , , , , , — and quietly assumes you already picture each one. Here we build them from nothing, in an order where each rests on the one before it.


1. The two values: and

The picture: imagine a single light switch on a wall. It is either down/off or up/on. There is no "half pressed". We name those two positions with digits:

Figure — Boolean variables and operations (AND, OR, NOT)

Why the topic needs this. A real wire holds a voltage (call it "on", ) or holds none (call it "off", ). Physics gives us exactly two clean states, so we invent a maths that also only has two states. If we ever produce a third value like , we have left the world of wires — that is the deep reason behind the "" rule you will meet later.


2. A variable: the letter

The picture: a labelled cup. The cup is called . Right now it might contain a ; a moment later a . The cup (the name) stays; the contents (the value) can switch.

Why we need letters at all. We want to state a rule once and have it work for every possible input. Writing "" says the flip rule for both possible contents of the cup in a single line, instead of writing two separate sentences. The letter is a placeholder that stands for "whatever is in the box".


3. The overbar — the NOT symbol

The picture: a see-saw. Push one end down (), the other end goes up (). They are always in opposite states — never both up, never both down.

Figure — Boolean variables and operations (AND, OR, NOT)

Why a bar and not a minus sign. A minus would suggest subtraction (a number operation). The bar is deliberately different because NOT is a state operation — it works on off/on, not on quantities. (It just so happens that gives the right numbers, but the meaning is "flip", not "subtract".)

Notice: NOT touches one box only. It is the odd operation out — the other two need at least two boxes.


4. The dot — the AND symbol

The picture: two switches wired in a line (in series), like a fence gate that needs two bolts undone. Current only reaches the bulb if switch and switch are both closed. One open switch anywhere breaks the whole chain.

Figure — Boolean variables and operations (AND, OR, NOT)

Why it looks like multiply. On the values , ordinary multiplication accidentally already is AND: but and . Any single in the product forces the answer to — exactly the "one failure ruins it" behaviour of AND. So reusing the multiply dot is a helpful memory hook, not a coincidence to worry about.


5. The plus — the OR symbol

The picture: two switches wired side by side (in parallel), like two separate doors into the same room. If either door is open, you can get in. Current reaches the bulb if switch or switch (or both) is closed.

Figure — Boolean variables and operations (AND, OR, NOT)

Why the plus is dangerous. Ordinary addition gives — and is not in , so it would break rule 1! Boolean OR saturates: once you reach you stay at . So here. The symbol is borrowed, but the arithmetic is bent to keep us inside our two-value world. That is why the parent note also writes it as .


6. and — the safe descriptions

The picture: stand and next to each other like two towers; picks the shorter, the taller.

Why they matter here. On :

  • The smaller of two values is only when both are → that is AND. So .
  • The larger is whenever any is → that is OR. So .

These give a description that can never leave (picking one of the two inputs cannot invent a new value), which is why they are the "honest" definitions.


7. Counting rows:

The picture: a branching tree. The first switch splits reality into 2 branches (off/on). The second switch splits each of those into 2 again → leaves. Each new switch doubles the branches.

Why we need it. A truth table must list every possible input. With boxes that is rows — box → rows, boxes → rows, boxes → rows. Miss a row and you have not fully described the operation. See Truth Tables for the full machinery.


8. Precedence — who goes first

The picture: the same "×-before-+" rule from school, one shelf higher for NOT. Think of three layers: bars resolve on the top shelf, dots on the middle, pluses on the bottom.

Why it must be fixed. would be ambiguous otherwise. The rule forces it to mean — NOT bites its own variable first, then AND, then OR gathers the leftovers. When unsure, brackets override everything, exactly like in normal maths.


Prerequisite map

Two states off or on

The set 0 and 1

Variable A a named box

Overbar NOT flip

Dot AND all on

Plus OR any on

min and max safe rules

2 to the n row count

Precedence order

Boolean operations AND OR NOT

Everything above flows into the parent: the topic itself. The physical origin of the two states is Binary Number System; the circuit shapes for these symbols live in Logic Gates.


Equipment checklist

What does the set contain, and nothing else?
Exactly two values, and — no other number is allowed.
What is a Boolean variable, in the "box" picture?
A named box (like ) that can hold only or .
What does the overbar instruct you to do?
Flip the value — give the opposite (, ).
The dot is read how, and outputs when?
"A AND B"; output only when both are (like series switches).
The plus is read how, and why isn't it ordinary addition?
"A OR B"; it saturates so , keeping the result inside .
Which is AND — or — and why?
: the smaller value is only when both inputs are .
How many rows does a truth table with inputs have?
rows, because each new input doubles the combinations.
What is the precedence order of NOT, AND, OR?
NOT first, then AND, then OR (brackets override).
Why does a wire justify a two-value maths?
A wire carries voltage or none — two clean physical states, so we model just two values.