Review: Computer System
 

  • The computer system consists of 2 components:

      1. The Central Processing Unit (CPU)
      2. The computer memory (or memory for short)        

 

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...

Function of the Computer Memory (a.k.a. RAM)
 

  • The memory is a huge storage component that stores:

      1. Instructions of computer programs

      2. Variables (= data) used in the computer programs


  • The CPU can perform these operations on the memory:

      1. retrieve (= read) the next instruction from the memory (and execute it)

      2. retrieve (= read) and store (write) data (= variables) from/to the computer memory

The memory is also called: RAM = Random Access Memory

We will discuss the interactions between the CPU and the memory next.

How the CPU use the memory ? (1) get instructions from memory
 

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 !)

How the CPU use the memory ? (1) get instructions from memory
 

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)

How the CPU use the memory ? (1) get instructions from memory
 

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 !!!

How the CPU use the memory ? (2) get data from memory
 

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

How the CPU use the memory ? (2) get data from memory
 

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 !!!

How the CPU use the memory ? (3) write (= store) data in memory
 

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)

How the CPU use the memory ? (3) write (= store) data in memory
 

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 !!