|
This webpage will present a high level desciption of the function of the memory and the CPU
I will explain their functions using the "mechanical computer" analogy (and I hope this analogy will make thing easier to understand)
I will discuss the memory first because this component is simpler...
|
The memory is also called: RAM = Random Access Memory
We will discuss the interactions between the CPU and the memory next.
The CPU can obtain (= read) the next computer instruction from the memory:
After the CPU obtain the instruction, the CPU will execute the instruction (discussed later !)
Analogy illustrated using the "mechanical" computer:
The CPU (= mechanical calculator) reads the next line of holes (= instruction) from the punch card (= memory) (and perform the encoded instruction)
Important fact: the computer will also move to a new instruction
Analogy: the punch card will also advance so the CPU will execute the next instruction when it's finish with the current instruction !!!
The CPU can also obtain (= read) data (= variables) from the memory:
The data is used as an operand for the current instruction that is executed by the CPU
Analogy illustrated using the "mechanical" computer:
The CPU (= mechanical calculator) reads a line of holes (= data) from the punch card (= memory) and use it as a number !!!
The CPU can store (= write) result (= data value) of computations back to the memory:
When the CPU performs a computation, the result of the completed computation may need to be stored back in memory for safe-keeping (longer term storage)
Analogy illustrated using the "mechanical" computer:
A row of holes of the punch card is filled back ("repaired") and new holes are made in the repaired row !!