Digital Circuits and Memory
How gates are combined into circuits that decide, count and remember.
The question
A calculator remembers the first number while you type the second. How can a circuit remember anything?
What you’ll discover: the difference between circuits that only decide and circuits that remember, and the basic building blocks of digital memory.
In simple terms
BeginnerDeciding versus remembering
Some digital circuits only decide: their output depends only on their inputs right now. The beeping-car example from Lesson 20 is one. These are called combinational circuits.
Others remember: their output depends on what happened before, too. Press a button once and a light stays on; press again and it goes off. The circuit has to remember whether it’s on or off. These are called sequential circuits, and they’re the basis of computer memory.
How a circuit remembers
The trick is feedback: feeding a gate’s output back into its own inputs. Two NOR gates (or two NAND gates) wired so each one’s output feeds the other’s input make a latch: a circuit that holds a 1 or a 0 until it’s told to change. A latch stores one bit.
The fastest memory inside a processor uses latch-like cells like this. A computer’s main memory (DRAM) stores each bit as a tiny charge on a capacitor (Lesson 8) that must be topped up thousands of times a second. Either way, there are billions of cells, organized so each can be found by its address.
Go deeper
IntermediateFlip-flops and counters
A flip-flop is a latch that only changes at the tick of a clock signal, a steady on-off pulse. Clocks keep all the parts of a digital system in step. Your computer’s processor speed in gigahertz is its clock rate: billions of ticks per second.
Chain flip-flops together and you get a counter, which counts clock pulses in binary. Counters are how digital clocks, timers and a weather station’s rain gauge, which counts one pulse each time its little bucket tips, keep track of events.
AdvancedState machines
Combine memory with decision logic and you get a state machine: a circuit (or program) that moves between defined states according to its inputs. A traffic light is a classic example: green, then yellow, then red, then green, with timing deciding when to move on. You’ll build one with a microcontroller in the Traffic Light Controller.
Mechanical buttons bounce (Lesson 11), so a counter can register several presses for one push. Digital designs fix this with debounce circuits or software delays.
Quick check
What is the difference between a combinational and a sequential circuit?
A combinational circuit’s output depends only on its current inputs; a sequential circuit also remembers what happened before.
What makes a latch able to remember?
Feedback: its outputs are fed back into its own inputs.
What does a clock signal do in a digital system?
It provides steady pulses that keep the parts working in step.
Words to know
- Combinational circuit
- A circuit whose output depends only on its present inputs.
- Sequential circuit
- A circuit with memory, whose output also depends on past inputs.
- Latch
- A simple circuit that stores one bit.
- Clock
- A steady on-off signal that keeps digital circuits in step.
Electronics School is part of the Discovery Zone. Every activity here runs on small batteries or a USB cable: never wall outlets. The one plug-in tool is the optional soldering iron, set up by an adult.