01How Computers Work (online)

Part 06 of 12

Memory of a single bit

Cross the gap between circuits that react now and circuits that remember later.

Six connected lessonsA diagram per chapterStart from first principles

The story before the details

Up to this point, most circuits change their outputs when their inputs change. That is useful for calculating a function, but it does not store anything. A program is a sequence of steps, and sequences require memory of earlier steps. Feedback is the key conceptual change: an output can influence future behavior through a loop.

Latches show that simple logic can hold one bit. Flip-flops make it easier to coordinate many pieces of state around clock transitions. A register combines multiple one-bit storage elements into one named multi-bit value. Nothing is “memorized” in the human sense; stable electrical configurations and clocked transitions preserve the pattern.

The clock is a synchronization mechanism rather than an instruction interpreter. It offers common moments for state transfer, but the hardware still needs correct timing, appropriate enable signals and paths that settle soon enough. Once a register output feeds an incrementer and returns to its own input, we have a counter and an important piece of a CPU.

Clocked storage, diagram of connected labeled components
Clocked storage. 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. 06.01Combinational vs sequential↗What changes when a circuit remembers?
  2. 06.02Feedback creates a latch↗Can logic gates sustain a state?
  3. 06.03The gated D latch↗How do we avoid ambiguous set/reset controls?
  4. 06.04Edge-triggered flip-flops↗How does a clock create orderly updates?
  5. 06.05Registers from flip-flops↗How can a circuit remember a whole number?
  6. 06.06Counters and the clock↗How does hardware keep track of a step number?
Keep this in mind

Cross the gap between circuits that react now and circuits that remember later. You should be able to explain each concept using only an input, a rule, an output, and any state that must be retained.