Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Chapter 4: Cache Memory

[4-Exercises-04_Group05Students]
Review Questions
No Full-name ID card Tel. Notes
1 Trương Việt Hoàng QE180166 0356645624
2 Võ Xuân Ý QE180059 0968009253
3 Nguyễn Văn Thương QE180086 0379560889
4 Lê Quang Minh Đà QE180042 0354091247
5 Phan Thị Minh Phương QE180193 0772703607

4.1 What are the differences among sequential access, direct access, and rando
access?
 Sequential access is a method of accessing data in order from start to
finish.
 Direct access is a method of accessing data by using a unique address to
access any location in memory.
 Random access is a method of accessing data by using a unique address to
access any location in memory and the access time does not depend on
the order of accesses. previously accessed and is a constant.

4.2 What is the general relationship among access time, memory cost, and
capacity?
 Faster access times generally come at a
higher cost.
 Memory cost tends to increase with higher
capacity.
 Higher capacity often leads to slower access
times and/or higher costs.
Chapter 4: Cache Memory
[4-Exercises-04_Group05Students]

4.3 How does the principle of locality relate to the use of multiple memory
levels?
The principle of locality helps optimize
performance in memory hierarchies by storing
frequently accessed data in faster, smaller
memory levels and less frequently accessed data
in larger, slower levels. It takes advantage of the
tendency of programs to access data in a localized
manner, reducing average access time and
balancing speed, capacity, and cost.
4.4 What are the differences among direct mapping, associative mapping, and
set associative mapping?
 Direct mapping: Each memory block is mapped to a specific cache line.
 Associative mapping: Any memory block can be stored in any cache location.
 Set associative mapping: Cache is divided into sets, with each set containing
multiple cache lines for mapping memory blocks.

4.5 For a direct-mapped cache, a main memory address is viewed as consisting


of three fields. List and define the three fields.
 Tag: Uniquely identifies a
cache line.
 Index: Selects the cache
line within the cache.
Chapter 4: Cache Memory
[4-Exercises-04_Group05Students]
 Offset: Specifies the position of the data within the cache line.

4.6 For an associative cache, a main memory address is viewed as consisting of


two fields. List and define the two
fields.
 Tag: Tag field uniquely identifies a
block of main memory.
 Word: Number of addressable
units = 2s+w words or bytes and
Block size = line size 2w words or
bytes

4.7 For a set-associative cache, a main memory address is viewed as consisting


of three fields. List and define the three fields.
 Tag field: Specifies a
specific cache block or
cache row in the cache
set.
 Index field: defines a
specific subset or group
of cache lines in the
cache.
 Offset field: Specifies the
position of a data element in a cache line.

4.8 What is the distinction between spatial locality and temporal locality?
 Spatial locality: focuses on the
tendency to access nearby memory
locations.
 Temporal locality: focuses on the
tendency to repeatedly access the
same memory
>>> locations. Both spatial and
temporal locality are important
Chapter 4: Cache Memory
[4-Exercises-04_Group05Students]
principles that caching systems leverage to improve memory access
performance and efficiency.

4.9 In general, what are the strategies for exploiting spatial locality and
temporal locality?
Larger cache blocks and prefetching mechanisms are used to exploit
spatial locality. Temporal locality is exploted by keeping recently
used instructions and data values in cache memory, and by exploiting
a cache hierarchy.
e
Chapter 4: Cache Memory
[4-Exercises-04_Group05Students]

You might also like