L6
L6
2
Concept of Memory
3
Von Neumann Memory
4
Memory Categorization
5
The Memory Hierarchy
6
The Memory Hierarchy
7
Register
8
Cache Memory
• Cache memory is a storage device placed in between CPU and main memory.
• These are semiconductor memories.
• These are basically fast memory device, faster than main memory.
• We can not have a big volume of cache memory due to its higher cost and
some constraints of the CPU.
• Due to higher cost we can not replace the whole main memory by faster
memory.
• Generally, the most recently used information is kept in the cache memory.
• It is brought from the main memory and placed in the cache memory.
• Nowadays, we get CPUs with internal cache.
9
Main Memory
10
Magnetic Disk
12
The Memory Hierarchy: Performance
Comparison
13
Internal Memory and External Memory
• Register, cache
memory and main
memory are
internal memory.
• Magnetic Disk,
removable media
are external
memory.
14
Volatile vs Non-Volatile Memory
• Generally,
memory/storage is
classified into 2
categories
• Volatile Memory: This
loses its data, when
power is switched off.
• Non-Volatile Memory:
This is a permanent
storage and does not
lose any data when
power is switched off.
15
Memory Access Methods
• Each memory type, is a collection of numerous memory
locations.
• To access data from any memory, first it must be located
and then the data is read from the memory location.
• Following are the methods to access information from
memory locations:
• Random Access:
– Main memories are random access memories, in which each
memory location has a unique address.
– Using this unique address any memory location can be reached
in the same amount of time in any order.
• Sequential Access:
– This methods allows memory access in a sequence or in order.
• Direct Access:
– In this mode, information is stored in tracks, with each track
having a separate read/write head.
16
Cache memory
17
Cache Memory
• Cache memory is a storage device
placed in between CPU and main
memory.
• The present CPU chips contain a few
caches, with L1 being the quickest.
• Each consequent cache is
increasingly slow than L1, and
directions and data are arranged
from main memory to L3 to L2 to L1
to the processor.
• On multicore chips, the L3 cache is
commonly shared among all the
preparing centres.
18
Cache in CPU
19
How the cache actually functions?
21
How the cache actually functions?
22
Locality
23
Hit Ratio
• Calculate AMAT:
– 1GHz processor
– time for a hit = (cache access time) 1 clock cycle
– miss penalty = 20 clock cycles
– miss rate = 5% (0.05)
25
Main Memory
Main Memory
26
Main Memory
27
Memory Organization
29
RAM: Random Access Memory
30
Virtual memory
34
Word-addressable vs Byte-addressable
36
Byte Addressing; Example
37
Word Addressing
38
Trade-offs of Minimum Addressable Unit (MAU)
• The size of the minimum addressable unit of memory can
have complex trade-offs.
• Using a larger MAU allows the same amount of memory to
be covered with a smaller address, which can substantially
decrease the memory requirements of a program.
• However, using a smaller MAU makes it easier to work
efficiently with small items of data.
• Suppose a program wishes to store one of the 12 traditional
signs of Western astrology.
• A single sign can be stored in 4 bits.
• Consider a 32-bit computer, each memory word contains 4
bytes.
• If a sign is stored in its own MAU, then 4 bits will be wasted
with byte addressing (50% efficiency), while 28 bits will be
wasted with 32-bit word addressing (12.5% efficiency)
39
Secondary Storage
40
Secondary Storage
41
Floppy Disks
43
Note: NAND a type of non-volatile storage technology that does not require power to retain data.
Hard Disk Drive (HDD)
• A non-volatile
computer storage
device containing
magnetic disks or
platters rotating at
high speeds.
• A secondary storage
device used to store
data permanently.
44
HDD Performance
• Time to access data
– Seek time
• how long it takes the head assembly to travel to
the track of the disk that contains data
– Rotational latency
• desired disk sector may not be directly under
the head when data transfer is requested
– RPM – Revolutions Per inute
• eg 7200 rpm disk, Seek time & Rotational
latency ~ 4ms
– Bit rate – data transfer rate
• ~1Gbit/s
• Fragile
– Head crash
45
SSD - Solid State Drive
• Secondary Storage
– Replacement for HDD?
– HDD form factors (3.5” & 2.5”)
• No moving parts – more durable,
shock resistant
• ~100 times faster than HDD
• Same as in USB flash drives and
memory cards
• NAND flash memory
• Consumes less power, cooler,
quieter
• But of course – more expensive
• 1TB HDD €50 for an HDD, SSD is
Was €250, Now €150 46
RAID (Redundant Array of Independent Disks)
47
Summary
48
Thank You
49