Chapter 5 - COMPSCI 2GA3

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/109

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

110 Terms

1
New cards
What is the principle of locality in memory access?
Programs access a small portion of their address space frequently, enabling effective caching.
2
New cards
What is temporal locality?
Recently accessed data is likely to be accessed again soon.
3
New cards
What is spatial locality?
Data near recently accessed addresses is likely to be accessed soon.
4
New cards
What is the purpose of a memory hierarchy?
To improve performance by storing frequently accessed data in smaller, faster memory levels.
5
New cards
What is a cache hit?
When data is found in the current memory level (cache), avoiding access to slower memory.
6
New cards
What is a cache miss?
When data is not in the cache and must be fetched from a lower, slower level of memory.
7
New cards
How is miss penalty defined?
The time required to fetch a block from a lower level in the memory hierarchy.
8
New cards
What does hit ratio represent?
The percentage of memory accesses that result in a cache hit.
9
New cards
What is the function of SRAM in the memory hierarchy?
Used for caches due to its speed but is more expensive and less dense than DRAM.
10
New cards
What is the function of DRAM in memory hierarchy?
Used for main memory due to its higher density and lower cost.
11
New cards
What is burst mode in DRAM?
It allows consecutive words from a row to be accessed quickly after the initial access.
12
New cards
What is DDR DRAM?
Double Data Rate DRAM transfers data on both rising and falling clock edges for higher bandwidth.
13
New cards
Why is DRAM refreshed periodically?
It stores data as charge in capacitors which leak over time.
14
New cards
What is NAND flash used for?
High-density storage like USB drives and SSDs, with block-based access.
15
New cards
What is NOR flash used for?
Fast random access memory in embedded systems, such as firmware storage.
16
New cards
Why is flash memory not suitable for RAM replacement?
It wears out after many write cycles and has slower write performance.
17
New cards
What is the main performance metric for hard drives?
Access latency, which includes seek time and rotational delay.
18
New cards
What is seek time in a hard disk?
The time to move the disk arm to the desired track.
19
New cards
What is rotational latency?
The time waiting for the desired sector to rotate under the read/write head.
20
New cards
What is average I/O time in disk performance?
Sum of access latency, transfer time, and controller overhead.
21
New cards
What is the average latency formula for a 7200 RPM disk?
Average latency = 60 / (2 × RPM) = 4.17ms.
22
New cards
Why do modern disk controllers include caches?
To prefetch and buffer data, reducing perceived latency for the CPU.
23
New cards
What is the role of prefetching in disk caching?
To load likely-needed sectors in advance to reduce future access times.
24
New cards
What is the difference between capacity and speed in memory hierarchy?
Lower levels (like disks) have high capacity but lower speed
25
New cards
Why are multiple levels of cache used?
To balance access speed and size, reducing overall memory access time.
26
New cards
What is a cache in memory systems?
A small, fast storage that holds frequently accessed data from slower memory levels.
27
New cards
Why does caching work effectively in programs?
Because of temporal and spatial locality in data access patterns.
28
New cards
What is a direct-mapped cache?
A cache where each memory block maps to exactly one location.
29
New cards
What is a fully associative cache?
A cache where a memory block can be placed in any cache line.
30
New cards
What is a set-associative cache?
A cache where each block maps to a set and can go in any line within that set.
31
New cards
How is a block located in a direct-mapped cache?
By using the block address modulo the number of blocks in the cache.
32
New cards
What is a tag in cache memory?
A portion of the address stored with data to identify which memory block is cached.
33
New cards
What does the valid bit in a cache line indicate?
Whether the cache line contains valid (usable) data or not.
34
New cards
Why do caches use block sizes larger than one word?
To take advantage of spatial locality and reduce miss rates.
35
New cards
What is a cache miss?
An event where requested data is not found in the current cache level.
36
New cards
What happens on a cache hit?
The CPU proceeds with the data already available in cache without delay.
37
New cards
What are the three types of cache misses?
Compulsory, capacity, and conflict misses.
38
New cards
What is a compulsory miss?
A miss that occurs the first time a block is accessed.
39
New cards
What is a capacity miss?
A miss that happens because the cache cannot contain all needed blocks.
40
New cards
What is a conflict miss?
A miss caused by multiple blocks mapping to the same cache location in direct-mapped or set-associative caches.
41
New cards
What is write-through in cache management?
A policy where data is written to both the cache and main memory on a write.
42
New cards
What is the downside of write-through policy?
It increases memory traffic and write latency.
43
New cards
What is write-back cache?
A policy where data is written to cache only and to memory later when the block is replaced.
44
New cards
What does the dirty bit in a write-back cache indicate?
Whether the cached block has been modified and needs to be written back to memory.
45
New cards
What is write allocation?
A policy where on a write miss, the block is loaded into cache before writing.
46
New cards
What is write-around?
A policy where the block is not loaded into cache on a write miss.
47
New cards
Why are write buffers used in caches?
To hold data waiting to be written to memory, allowing the CPU to continue execution.
48
New cards
What is early restart in memory access?
A strategy where the CPU resumes as soon as the required word is returned, not the entire block.
49
New cards
What is critical-word-first strategy?
It fetches the needed word first in a cache miss before loading the rest of the block.
50
New cards
Why are larger cache blocks not always better?
They can increase miss penalty and cause cache pollution despite better spatial locality.
51
New cards
What is cache pollution?
When unnecessary or rarely used data fills up the cache, evicting useful blocks.
52
New cards
What is the average memory access time (AMAT) formula?
AMAT = Hit time + (Miss rate × Miss penalty).
53
New cards
What does CPI stand for in CPU performance?
Cycles Per Instruction.
54
New cards
How do cache misses affect CPI?
They increase memory stall cycles, raising the effective CPI.
55
New cards
What is the effect of increasing clock rate on cache misses?
It increases the relative cost of a miss due to a higher miss penalty.
56
New cards
What is a typical hit time for L1 cache?
Around 1 CPU cycle.
57
New cards
What is a multilevel cache?
A hierarchy of caches (L1, L2, sometimes L3) to balance speed and capacity.
58
New cards
Why is L1 cache small and fast?
To minimize hit time and keep the CPU running efficiently.
59
New cards
What is the role of L2 cache?
It reduces the miss rate from L1 cache by storing more data, though with higher latency.
60
New cards
What is the trade-off in multilevel cache design?
Larger caches reduce miss rate but have higher hit time.
61
New cards
How do you calculate overall CPI with cache misses?
CPI = Base CPI + Miss penalty × Miss rate × Memory access per instruction.
62
New cards
What is the benefit of set-associative caches over direct-mapped?
They reduce conflict misses by allowing more placement options per block.
63
New cards
What is Least Recently Used (LRU) policy?
A replacement strategy that evicts the block that hasn't been used for the longest time.
64
New cards
Why is LRU not practical for high associativity caches?
It becomes too complex and expensive to implement beyond 4-way associativity.
65
New cards
What is a random replacement policy in caching?
A strategy where a block is randomly selected for replacement on a cache miss.
66
New cards
Why does increasing associativity yield diminishing returns?
Because each increase adds cost and complexity while only slightly reducing miss rate.
67
New cards
What is a replacement policy?
A rule for deciding which block to evict from cache on a miss.
68
New cards
How does a 2-way set-associative cache work?
Each block maps to one set and can be stored in either of two slots within that set.
69
New cards
What is the main advantage of associative caches?
Flexibility in placing data reduces conflict misses.
70
New cards
What is the cost of increased associativity?
More comparators and complexity in cache lookup logic.
71
New cards
Why do CPU designers favor smaller L1 block sizes?
To reduce cache pollution and lower hit latency.
72
New cards
What is the impact of data cache miss on loads?
It stalls the pipeline until the requested data is fetched from lower memory.
73
New cards
How does a CPU handle instruction cache misses?
It restarts instruction fetch once the block is loaded into cache.
74
New cards
How can compiler optimizations help cache performance?
By reordering code and data access patterns to improve locality.
75
New cards
What is cache blocking (tiling)?
A technique to divide data into chunks that fit in cache, improving reuse and locality.
76
New cards
What is DGEMM in computing?
Double-precision General Matrix Multiply, a benchmark for floating-point performance.
77
New cards
How does cache blocking help DGEMM performance?
It increases data reuse in cache by operating on sub-blocks that fit in cache.
78
New cards
What is the BLOCKSIZE in a blocked DGEMM implementation?
It defines the size of submatrices to be multiplied, optimized to fit in cache.
79
New cards
What arrays are commonly accessed in DGEMM?
A, B, and C matrices used in matrix multiplication.
80
New cards
Why is loop order important in matrix multiplication?
Different loop orders affect memory access patterns and cache efficiency.
81
New cards
What is dependability in computing systems?
The ability of a system to perform correctly and handle faults effectively.
82
New cards
What is MTTF?
Mean Time To Failure — the average time a system operates before failing.
83
New cards
What is MTTR?
Mean Time To Repair — the average time to restore a failed system to operation.
84
New cards
How is Availability calculated?
Availability = MTTF / (MTTF + MTTR)
85
New cards
What does the Hamming distance measure?
The number of differing bits between two binary strings.
86
New cards
What is the minimum Hamming distance for SEC?
3 — allows single error correction and double error detection.
87
New cards
What does SEC/DED stand for?
Single Error Correction / Double Error Detection — a common ECC technique.
88
New cards
What is a parity bit?
A bit added to data to make the number of 1’s either even or odd, used for error detection.
89
New cards
What happens if SEC parity bits are 0000?
No error is detected in the data.
90
New cards
What does a 2-bit error do in SEC/DED?
It is detected but not correctable.
91
New cards
Why is ECC important in memory systems?
To detect and correct errors, ensuring data integrity.
92
New cards
What is virtual memory?
A technique that allows programs to use more memory than physically available by paging to disk.
93
New cards
What is a virtual machine (VM)?
A software-emulated system that runs guest OSes on a host machine.
94
New cards
What are advantages of virtual machines?
Isolation, resource sharing, security, and legacy software support.
95
New cards
What is an example of an early virtual machine?
IBM VM/370 from the 1970s.
96
New cards
What is modern virtualization software?
Tools like VMWare or Microsoft Virtual PC that emulate entire systems.
97
New cards
Does virtualization affect performance?
Yes, but modern CPUs have support to minimize the overhead.
98
New cards
What is the role of the host OS in virtualization?
It manages resources and provides an environment for guest systems.
99
New cards
Why is virtualization important in cloud computing?
It enables efficient use of hardware by running multiple virtual systems on a single machine.
100
New cards
What is wear leveling in flash memory?
A technique to evenly distribute write/erase cycles to prevent premature failure of cells.