3.1.6 · D1Boolean Algebra & Logic Gates

Foundations — XOR, NAND, NOR, XNOR gates

2,136 words10 min readBack to topic

Before you can read a single line about XOR or NAND, you need a small toolbox of symbols. This page hands you each tool, one at a time, and never uses a symbol before it is built. Read top to bottom.


0. The atom: a bit (the values and )

The picture: think of a single light switch. It is either up or down — never halfway. That is a bit. The whole of digital hardware is built from millions of these switches.

Why the topic needs it: every input and output in a logic gate is a bit. When the parent note writes a truth table full of s and s, each of those is one switch state. If "two values only" is not rock-solid, nothing else lands.


1. Inputs and outputs — the letters ,

The picture: a box with two wires coming in on the left (labelled and ) and one wire leaving on the right. The left wires carry the input bits; the right wire carries the answer.

Why the topic needs it: the formulas , , all describe what the box does to and . Without names for the inputs we could not write any rule down.


2. The three primitive rules: NOT, AND, OR

Everything else is built from these three. Learn them as actions on bits, not as spells.

2a. NOT — the flipper (the overbar )

0 1
1 0

The picture: press an inverter and the switch snaps to the opposite position.

Why the topic needs it: the "N" in NAND and NOR is this bar — NAND is "NOT of AND", written with a bar over the whole AND. XOR's formula is full of bars. If you cannot read as "the opposite of ", the parent note is unreadable.

2b. AND — the "both" rule (the dot )

0 0 0
0 1 0
1 0 0
1 1 1

The picture: two switches wired in series (one after the other) on the same line. Current reaches the bulb only if both switches are closed.

Why the topic needs it: NAND is literally . To understand NAND you must first know what gives on every row.

2c. OR — the "at least one" rule (the plus )

0 0 0
0 1 1
1 0 1
1 1 1

The picture: two switches wired in parallel (side by side, two paths to the bulb). Closing either path lights the bulb.

Why the topic needs it: NOR is , and both XOR and XNOR formulas OR their terms together. The sign appears everywhere in the parent note.


3. Reading a truth table

The picture: a grid. Walk down it row by row; each row is one "what if the switches were like this?" scenario, and the last column tells you the light's state.

Why the topic needs it: every gate in the parent note is defined by its truth table. To "know a gate" simply means "be able to fill in its output column".


4. The compound symbols the topic introduces

Now the toolbox from sections 2 and 3 lets us read the new symbols without fear.

Why order matters (the bar's reach): in the bar sits over both letters, so you compute first, then flip the single result. Compare , where each letter is flipped first, then ANDed. These are different circuits — that is the whole point of De Morgan's theorem the parent note relies on.


5. Two facts you will lean on constantly

Why the topic needs it: the trick "tie both NAND inputs together to make NOT" uses exactly this: . Without idempotence that first step is a mystery.

Why the topic needs it: this is exactly how the parent note derives . Deeper treatment lives in Sum of Products (SOP).


6. How these foundations feed the topic

Bit: only 0 or 1

Input names A and B

NOT: the overbar flips

AND: dot, both must be 1

OR: plus, at least one 1

Truth table: all input rows

Idempotence: A dot A = A

Sum of Products recipe

NAND and NOR: invert AND or OR

XOR and XNOR expressions

NOT from one NAND

Parent: XOR NAND NOR XNOR gates


Equipment checklist

Cover the right side and answer aloud — if any stalls, reread that section before the parent note.

What are the only two values a bit can take?
and — nothing else.
What does the overbar do to a bit?
Flips it: and .
When is (AND) equal to ?
Only when both and are .
When is (OR) equal to ?
When at least one of , is .
What is in Boolean OR?
— not . Output is a single bit.
How many rows does a 2-input truth table have, and why?
, because input combinations ( for inputs).
In , which do you compute first?
The inside, then flip the result.
Is the same as ?
No — De Morgan gives .
What does equal, and why does it matter?
(idempotence); it's why tying both NAND inputs together gives NOT.
What does the symbol mean in words?
XOR — output when the inputs differ.
What does the SOP recipe do?
Builds a formula by ORing one AND-term per row whose output is .

Connections