Presentation - 16 Computer Memory
Presentation - 16 Computer Memory
Science
Computer memory
teachcomputerscience.co
m
2
Lesson Objectives
teachcomputerscience.co
m
1.
Content
teachcomputerscience.co
m
4
Memory
▪ Memory is the space where data and programs are stored.
Data in memory is accessed through instructions from the
CPU.
▪ Memory in a computer system is classified into primary
and secondary memory.
teachcomputerscience.co
m
5
Types of memory
Primary memory Secondary memory
Primary memory is a type of memory Secondary memory refers to the
that is accessed directly by the CPU. external storage devices such as hard
For example: RAM, ROM and cache. drives, CD, flash drives, etc.
teachcomputerscience.co
m
6
Primary memory
▪ The various primary memories available in a CPU are listed below
in order of its closeness to CPU:
i. Registers
ii. Cache
iii. RAM
iv. Virtual Memory
▪ But, the closer the memory type, the more expensive it is.
▪ The closer the memory type, the faster the access is
teachcomputerscience.co
m
7
Primary memory
Cache
RAM
Slowest, largest and
Virtual Memory (in Hard disk)
least expensive memory
teachcomputerscience.co
m
8
Latency
▪ Latency is the time taken by components to respond to a
request.
▪ To avoid short delays between the CPU’s request for data and
finding the data in the memory, some instructions and data
are copied to the cache.
teachcomputerscience.co
m
9
Random access memory
(RAM)
▪ RAM is a temporary memory which stores data, files and parts of
the operating system that is currently in use.
▪ When a program is loaded from the hard drive, all its contents
such as its instructions and data are loaded to the RAM and the
CPU accesses this information. It is also called the main memory.
▪ Used by the operating system, applications and any data that are
currently used.
▪ The access time for a CPU to access any data from the RAM is less
when compared to accessing data from a hard drive.
▪ The larger the size of RAM, the faster the computer operates.
teachcomputerscience.co
m
10
teachcomputerscience.co
m
11
teachcomputerscience.co
m
12
Types of RAM
Dynamic RAM (DRAM) Static RAM (SRAM)
DRAM consists of transistors that act SRAM uses ‘flip flops’ which hold each
as switches and capacitors that hold bit of memory.
binary data. SRAM need not be refreshed
DRAM has to be constantly refreshed constantly. SRAM is faster than DRAM.
(every 15 microseconds) to maintain SRAM is used in cache memory.
the charge in the capacitor.
SRAM is more complex to build than
DRAM is used for main RAM memory. DRAM and is therefore more
expensive.
Due to the complex design and more
transistors and additional wiring
required in SRAM, it offers smaller
capacity compared to DRAM. teachcomputerscience.co
m
Read only memory 13
(ROM)
▪ Read Only Memory (ROM) is a permanent memory that is used
to store the instructions that are executed once the computer is
switched ON. This set of instructions is called a boot process.
▪ This is responsible for initialising the hardware and operating
system soon after the power is switched ON.
▪ The contents of ROM are not erased even when the power is
switched off.
▪ The contents of ROM can only be read and cannot be changed.
▪ ROM is made by interconnecting several transistors. Is an
example for non-volatile memory.
teachcomputerscience.co
m
14
Types of ROM
PROM (programmable EPROM (erasable EEPROM (electrically
read-only memory) programmable read- erasable
PROM is manufactured as only memory) programmable read-
blank ROM. The contents of EPROM only memory)
teachcomputerscience.co
m
15
Flash memory
▪ Flash memory is a type of ROM. It is programmed by applying a
slightly large electric current that forces an electron through a
barrier.
Electrons
trapped in Electrons
this layer forced
through
Charge barrier
applied
teachcomputerscience.co
m
16
Flash memory
▪ Once the electrons cross this
barrier, it gets stored in a layer.
▪ The electrons can then be
detected without affecting its
position.
▪ As a flash of current is used to
store data, it is called as flash
memory.
▪ Flash memory is also rewritable. teachcomputerscience.co
m
17
Virtual memory
▪ When a computer has too many processes running at
the same time and the capacity of RAM is not enough, a
section of hard drive is allocated for storing temporary
data. This section of hard disk is called a virtual memory.
teachcomputerscience.co
m
18
Virtual memory
▪ A part of the storage drive is available as RAM temporarily. This
management of memory is performed by the operating system.
▪ A part of RAM that is currently not is use is transferred to the
hard disk and a part of the hard disk that is currently required
by RAM is transferred to RAM.
▪ This process of transferring data between RAM and hard disk is
slow and may affect the performance of computer.
teachcomputerscience.co
m
19
Paging
▪ Swapping (or paging) is the process by which the OS moves data
between RAM and virtual memory.
Hard disk
Virtual
RAM
memory
Paging /
Swapping
teachcomputerscience.co
m
20
Paging
▪ Data that is not immediately needed is removed from RAM and
copied to the virtual memory.
▪ When data is required, it is copied again to RAM.
▪ By using this method, a computer handles requests even when it
does not have enough RAM.
teachcomputerscience.co
m
Let’s review some 21
concepts
teachcomputerscience.co
m
23
Activity-1
Duration: 10 minutes
Is? Stores?
RAM
ROM
teachcomputerscience.co
m
24
Activity-1
Duration: 10 minutes
teachcomputerscience.co
m
3.
End of topic questions
teachcomputerscience.co
m
26