0% found this document useful (0 votes)
0 views

2.5 Cache

The document discusses memory hierarchy, including cache, main memory, and hard disk access times, providing calculations for average memory access times based on hit ratios. It includes exercises on determining hit ratios and average access times for different memory configurations. Additionally, it covers definitions and concepts related to memory systems and cache memory.

Uploaded by

oroza0511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

2.5 Cache

The document discusses memory hierarchy, including cache, main memory, and hard disk access times, providing calculations for average memory access times based on hit ratios. It includes exercises on determining hit ratios and average access times for different memory configurations. Additionally, it covers definitions and concepts related to memory systems and cache memory.

Uploaded by

oroza0511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

2.

CACHE
Giảng viên: Phan Thị Thanh Ngọc
Khoa: Điện tử Viễn thông
Trường: Đại học Điện lực
Hệ thống phân cấp bộ nhớ
Phân cấp bộ nhớ
Question 1: A computer has a cache, main memory, and a hard
disk drive. If a referenced word is in the cache, 10 ns are
required to access it. If it is in main memory but not in the
cache, 80 ns are needed to load it into the cache, and then
the reference is started again. If the word is not in main
memory, 10 ms are required to fetch the word from disk,
followed by 80 ns to copy it to the cache, and then the
reference is started again. The cache hit ratio is 0.9 and the
main-memory hit ratio is 0.7. What is the average time in ns
required to access a referenced word on this system?
H2 = 0.7
H1 = 0.9
Hard
10 ns 80 ns Main 10 ms Disk
CPU Cache Memory Drive
Memory
Your answer :

• There are three cases to consider:


• So the average access time would be:
• Average memory access time (AMAT)
= 0.9 x 10 + 0.07 x 90 + 0.03 x 10000090
= 300.018 (ns)
// Average memory access time (AMAT)
= 0.9 x 10 + (1-0.9)(07 x (10+80) + 0.3 x (10 000 000 + 80 + 10)
= 300.018 (ns)
• Question 2: Consider a memory system with
the following parameters:
Tm = 80 ns (time to access a byte in the
main memory)
Tc = 5 ns (time to access a byte in the
cache)
If the average access time is 20% greater
than the cache access time, what is the hit
ratio H?
Question 2: Consider a memory system with the
following parameters:
Tm = 80 ns (time to access a byte in the main
memory)
Tc = 5 ns (time to access a byte in the cache)
If the average access time is 20% greater than the
cache access time, what is the hit ratio H?
Answer:
• From Equation caculate AMAT:
• AMAT = Tc + 20%Tc (1)
• AMAT = Tc + (1 - H) x Tm (2)

• < - - > Tc + 20%Tc = Tc + (1 - H) x Tm
• (1 - H) x Tm = 0.2Tc
• H = 1 - 0.2 Tc/Tm = 1 - 0.2 x 5 / 80 =
0,9875 = 98,8%
PART 3: EXERCISES
1.
• A particular cache design responds in 5 cycle on a
cache hit, but takes an additional 50 clock cycles
if there’s a cache miss. If we want an average
memory access time of 10 cycles or better, what is
the minimal acceptable cache hit ratio?
 0.8
 0.9
 0.95
 0.98
2.
• A system memory has a cache and main memory. If
a referenced word is in the cache, 10 ns are
required to access it. If it is in main memory but
not in the cache, 80 ns are needed to load it into
the cache, and then the reference is started again.
The cache hit ratio is 0.9. What is the average time
in ns required to access a referenced word on this
system?
 10
 18
 30
 45
 90
3.
• A hierarchical memory system consists of a two-level
SRAM cache and a large DRAM main memory. The
system first checks the L1 cache. If the access to L1 is
a cache miss, the system then checks the L2 cache. If
the access to L2 is a cache miss, an access is made to
main memory.
• For L1: the cache hit time is 2 ns, the hit ratio is 90%
• For L2: the cache hit time is 5 ns, the hit ratio is 95%
• For main memory: the access time is 80ns
• What is the average memory access time in ns?
2
3
5
 2.9
 3.5
4

• The number failed attempts to access memory,


stated in the form of fraction is called as _________
 Hit rate
 Miss rate
 Failure rate
 Delay rate
5.
• What does SRAM stand for?
 Static Random Access Memory
 Scientific Random Access Memory
 Static Replacement Access Memory
 Static Random Attack Memory
6.
• This memory stores the data of the operating
system and programs that are currently running,
for access by the CPU.
 ROM
 Cache memory
 Flash memory
 Hard disk
7.
• What is a memory cache?
 The amount of memory your computer has on hand for any
particular task
 An outdated memory storage device
 A temporary memory storage device that keeps certain
data available for quick reference
 None of the other choices is correct

You might also like