Parts of the CPU
Registers are tiny, very fast storage locations built into the CPU. They are not locations in RAM: they sit inside the processor itself, holding the particular instruction or data value that the CPU is handling at that instant.
A register holds just one item at a time: it may be an instruction, a data value or an address in memory. Because a register is built into the CPU and holds a single item, registers are the fastest storage in a computer. There are only a few of them, though, so the total amount they can store is tiny, smaller than the cache.
| Register | What it stores |
|---|---|
| Program Counter (PC) | The address of the next instruction |
| Memory Address Register (MAR) | The address in memory that the CPU will access next for a read or a write operation |
| Memory Data Register (MDR) | Data or an instruction that has just been read, or data waiting to be written |
| Accumulator | Data, including results from calculations |
An address tells the CPU where something is; data is the value itself. For example, if the next instruction is at address 5120, the Program Counter holds 5120. Once that instruction is fetched, the instruction itself is held in the Memory Data Register.
Describe a register by what it stores rather than by an action it performs: the Program Counter stores the address of the next instruction, so it does not fetch the instruction, and it does not count how many programs have run.
OCR GCSE Computer Science · Parts of the CPU