ch01 2-Memory Hierarchy
ch01 2-Memory Hierarchy
1
A computer has to store data and instructions. It uses
uses various types of memory to do this.
Speed of access
Registers fastest
Cache memory
Main memory
secondary storage
slowest
2
Registers
• The processor uses registers
• small internal memory very fast access
• used to temporarily store some information.
• The number of registers depends on the processor type.
• Example of registers:
• …… 3
• MAR: holds the address of memory where
CPU wants to read or write data. When
CPU wants to store some data in the
memory or reads the data from the
memory, it places the address of the
required memory location in the MAR.
4
• MBR: holds the contents of data or instruction read
from, or written in memory. The contents of instruction
placed in this register are transferred to the Instruction
Register, while the contents of data are transferred to
the accumulator or I/O register.
• In other words you can say that this register is used to
store data/instruction coming from the memory or going
to the memory.
5
I/O Address Register (I/O AR):
used to specify the address of a particular I/O device.
I/O Buffer Register:
used for exchanging data between the I/O module and the
processor.
7
Accumulator Register:
1. located inside the ALU,
2. used during arithmetic & logical operations of ALU. The control unit
stores data values fetched from main memory in the accumulator for
arithmetic or logical operation.
3. holds the initial data to be operated upon, the intermediate results, and
the final result of operation.
4. The final result is transferred to main memory through MBR.
8
Cache memory
9
Central memory/ main
memory
• The main storage of information used by the CPU.
• access time is much greater than to registers and
cache memory.
• Any program to run must be loaded in main memory.
• The CPU looks for instructions one after the other
to run sequentially.
• The capacity and speed of the main memory are key
elements in the power of a computer.
10
RAM (Random Access Memory)
11
RAM (Random Access Memory)
12
ROM (Read Only Memory)
13
ROM (Read Only Memory)
• PROM - (programmable read-only memory) is a memory chip on
which data can be written only once. Once a program has been
written onto a PROM, it remains there forever.
• To write data onto a PROM chip, you need a special device called
a PROM programmer or burner.
14
EPROM, EEPROM
• EPROM - (Erasable Programmable ROM) is a
special type of PROM that can be erased by
exposing it to ultraviolet light. Once it is
erased, it can be re-programmed.
• An EEPROM(Electrically Erasable
Programmable ROM ) is similar to a PROM, but
requires only Electricity to be Erased.
15
Secondary / mass memory
• high capacity and relatively low cost.
• They serve as permanent storage elements and
use it to magnetic media (disks) and optical
media (CD-ROM, CD-RW, DVD-ROM ...)
16