01How Computers Work

Part 04 of 12

Logic gates and decisions

Turn Boolean rules into circuits that can genuinely select and calculate.

Six connected lessonsA diagram per chapterStart from first principles

The story before the details

A logic gate does not add values merely because its inputs look like binary digits. It implements a Boolean relationship. AND asks whether both input conditions are true. OR asks whether at least one is true. XOR detects difference. Those simple functions are enough to express much richer rules when composed.

A truth table is a complete behavioral specification for a simple gate. You list every possible input and show the desired output. It does not reveal how many transistors are used or how fast signals propagate, but it tells you precisely what must happen. Once the table is fixed, a designer can construct the function from gates.

Multiplexers turn conditional selection into physical wiring behavior. Decoders turn binary codes into one-of-many selection signals. The significance is enormous: addition circuits cannot build a useful programmable machine unless the machine can also decide which input, register, memory slot, or operation to use.

One-bit addition, diagram of connected labeled components
One-bit addition. Follow the arrows to identify where information travels and what each block contributes.

What you will discover

These six lessons are arranged so each one answers a question created by the previous one. Do not rush to the last lesson. If a concept feels opaque, use the checkpoint before continuing.

  1. 04.01Truth tables↗Can a complete behavior fit in four rows?
  2. 04.02AND and OR↗When must conditions agree?
  3. 04.03NOT, NAND, NOR↗Why is inversion so powerful?
  4. 04.04XOR and equality↗Which gate detects differences?
  5. 04.05Multiplexers and selectors↗How does a computer choose one value?
  6. 04.06Decoders and enable lines↗How can two address bits pick one of four places?
Keep this in mind

Turn Boolean rules into circuits that can genuinely select and calculate. You should be able to explain each concept using only an input, a rule, an output, and any state that must be retained.