Step 7 of 9
Registers and memory
Somewhere to put things
Everything you have built so far forgets instantly. Signals go in, results come out, and nothing is held. A processor needs somewhere to keep a value while it works on the next thing.
Registers are the handful of slots inside the CPU itself — this one has four, R0 to R3. They are tiny and immediate.
Memory is bigger, slower and outside. This machine has sixteen cells. Nothing can be computed on directly in memory: it has to be loaded into a register first, worked on, and stored back. That single fact is the reason LOAD and STORE exist as their own instructions.
One more piece: the program counter holds the number of the instruction being run. It normally counts up by one. Jumping is nothing more than writing a different number into it.
Sign in to save your progress.