4.2 Memory, Fetch-Execute Cycle
Memory
Memory is basically places where the 1's and 0's of binary are stored. There
are many different kinds of memory inside a computer.
A Bus is basically the electronic channel through which the CPU gets the data
it needs from the rest of the computer.
Hard Drive (or Hard Disk or C:)
- is where programs and files are stored when the computer is turned off
- is not erased when the computer is turned off
- is very large and it is not on the motherboard. This makes it slow to read
things off it - relatively speaking compared to RAM
RAM (Random Access Memory)
- is the place that programs are loaded into when they are run.
- is large. Lots of information can be stored there.
- is erased when the computer is turned off
- is on the motherboard so it is closer to the CPU. It is faster to read programs
from here into the CPU as needed.
L2 cache
- is smaller than RAM (holds less information), but closer to the CPU (if
not on it).
- stores data that the CPU needs frequently so that the CPU doesn't need to
go all the way to RAM to get it.
L1 cache
- is on the CPU and it is smaller than the L2 cache. It holds less information.
- it stores data that the CPU needs really frequently.
Registers
- a special circuit on the CPU that can hold the result of a calculation
- it is a really, really small piece of "memory" and it is really,
really fast because it is closest to the CPU.
close to CPU
fast
small amount of storage
|
|
|
|
far from CPU
slow
large amount of storage
|
| Register |
L1 cache |
L2 cache |
RAM |
Hard Drive |
Other things on the diagram include:
- Program Counter stores the memory address of the line of the program the
computer is processing.
- Instruction Register stores the line of the program that the computer is
processing.
- MAR (Memory Address Register) which stores the memory address of the data
that is needed.
- MDR (Memory Data Register) which stores the data from the memory address.
- Address Bus is an electronic channel that takes the address from the MAR
to specify what piece of memory is needed. It's size, together with the MAR
determines how much memory the computer can have.
- Data Bus is an electronic channel that takes the data from the place required
and puts it in the MDR.
Fetch Execute Cycle