Computer Memory
Computer Memory
………………………….………………………………..
LEC. 4 Computer Science Fundamentals/ First Class / First Semester
COMPUTER MEMORY
I. INTRODUCTION
The computer’s memory stores data, instructions required during the processing of
data, and output results. Storage may be required for a limited period of time,
instantly, or, for an extended period of time. Different types of memories, each having
its own unique features, are available for use in a computer. The cache memory,
registers, and RAM are fast memories and store the data and instructions temporarily
during the processing of data and instructions. The secondary memory like magnetic
disks and optical disks has large storage capacities and store the data and instructions
permanently, but are slow memory devices.
The memories are organized in the computer in a manner to achieve high levels of
performance at the minimum cost. In this lecture, we discuss different types of
memories, their characteristics and their use in the computer.
III.CHARACTERISTICS OF MEMORIES
Volatility
o Volatile {RAM}
o Non-volatile {ROM, Flash memory}
Mutability
o Read/Write {RAM, HDD, SSD, RAM, Cache, Registers…}
o Read Only {Optical ROM (CD/DVD…), Semiconductor ROM}
Accessibility
o Random Access {RAM, Cache}
o Direct Access {HDD, Optical Disks}
o Sequential Access {Magnetic Tapes}
In general, referring to the computer memory usually means the internal memory.
Internal Memory
The key features of internal memory are:
1. Limited storage capacity.
2. Temporary storage.
3. Fast access.
4. High cost.
Registers, cache memory, and primary memory constitute the internal memory. The
primary memory is further of two kinds: RAM and ROM. Registers are the fastest and
the most expensive among all the memory types. The registers are located inside the
CPU, and are directly accessible by the CPU. The speed of registers is between 1-2 ns
(nanosecond). The sum of the size of registers is about 200B. Cache memory is next in
the hierarchy and is placed between the CPU and the main memory. The speed of cache
is between 2-10 ns. The cache size varies between 32 KB to 4MB. Any program or data
that has to be executed must be brought into RAM from the secondary memory.
Primary memory is relatively slower than the cache memory. The speed of RAM is
around 60ns. The RAM size varies from 512KB to 64GB.
Secondary Memory
The key features of secondary memory storage devices are:
1. Very high storage capacity.
2. Permanent storage (non-volatile), unless erased by user.
3. Relatively slower access.
4. Stores data and instructions that are not currently being used by CPU but may be
required later for processing.
5. Cheapest among all memory.
To get the fastest speed of memory with largest capacity and least cost, the fast memory
is located close to the processor. The secondary memory, which is not as fast, is used to
store information permanently, and is placed farthest from the processor.
With respect to CPU, the memory is organized as follows:
Registers are placed inside the CPU (small capacity, high cost, very high speed)
Cache memory is placed next in the hierarchy (inside and outside the CPU)
Primary memory is placed next in the hierarchy
Secondary memory is the farthest from CPU (large capacity, low cost, low speed)
The speed of memories is dependent on the kind of technology used for the memory.
The registers, cache memory and primary memory are semiconductor memories. They
do not have any moving parts and are fast memories. The secondary memory is
magnetic or optical memory has moving parts and has slow speed.
3
Lecturer: Ali Kadhim AL-Bermani
LEC. 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Computer Science Fundamentals
V. CPU REGISTERS
Registers are very high-speed storage areas located inside the CPU. After CPU gets the
data and instructions from the cache or RAM, the data and instructions are moved to the
registers for processing. Registers are manipulated directly by the control unit of CPU
during instruction execution. That is why registers are often referred to as the CPU’s
working memory. Since CPU uses registers for the processing of data, the number of
registers in a CPU and the size of each register affect the power and speed of a CPU.
The more the number of registers (ten to hundreds) and bigger the size of each register
(8 bits to 64 bits), the better it is.
4
Lecturer: Ali Kadhim AL-Bermani
LEC. 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Computer Science Fundamentals
5
Lecturer: Ali Kadhim AL-Bermani
LEC. 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Computer Science Fundamentals
6
Lecturer: Ali Kadhim AL-Bermani