Why Circuits Need Memory
Combinational Logic: A Pure Function of Its Inputs
Half adders, multiplexers and majority voters all belong to the family of combinational logic. A combinational circuit computes output = f(inputs) with no dependence on time or previous inputs. Most of digital logic works this way, and circuits whose output depends on a sequence of inputs rather than a single snapshot are called sequential.
Of course, computers also need to remember information and that means we need logic gates that depend on previous inputs
The idea
This is done by wiring a gate's output back into one of its own inputs, either directly or through a neighboring gate that loops back. The output is no longer a function of the outside inputs, because previous outputs now affect the state of the gate.
Why This Doesn't Blow Up Into an Infinite Loop
A feedback loop in software that recomputes a value from itself is usually a bug. In a circuit it is not, and the reason is delay. Gates are not instant. Every gate takes a little time to pass a signal through, so a signal chasing itself around a loop does not recompute forever. It settles, because each pass around the loop changes the signal less than the last, until a pass finally changes nothing at all. After a handful of gate delays the loop reaches a value that agrees with itself, every gate's output matches what its inputs demand, and nothing moves after that. That settling is what makes the next three tutorials safe to build.
Where This Section Is Going
Three storage elements, built in order, each fixing a specific problem with the last.
| Gate | Description | Fact |
|---|---|---|
| SR latch | 2 inputs set Q to 1 or reset | smallest circuit that stores a bit |
| Gated D latch | data and enable as inputs | no illegal states unlike SR latch |
| D flip-flop | uses clock edges/pulses to change Q | what registers and counters use |
By the end you will know what a register is made of, gate by gate. You will also know why every design decision along the way was forced by a specific limit of the one before it.