Memory and Cache Flashcards

1
Q

What is Fully Associative Cache?

A

Fully Associative Cache can map a memory address to any block in the cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Set Associative Cache?

A

Trade-off between direct mapped cache and the fully associative cache, divided into groups of blocks called sets, where each memory address is mapped to only one set (data can be placed anywhere within this set)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does a Set Associative Cache differ from both Direct Mapped and Fully Associative Caches?

A

Set associative divides cache into sets, each address maps to one set but can be placed in any block within that set, balancing flexibility and efficiency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the trade-offs of using a Fully Associative Cache compared to Direct Mapping?

A

Fully associative allows any data to be stored anywhere, increasing flexibility at the cost of complexity and higher hardware requirements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is temporal locality, and how does it influence what should be stored in the cache?

A

Temporal locality suggests that recently accessed data will likely be accessed again soon, such data should be kept in a cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is direct mapping in cache architecture?

A

A method where each memory location maps to exactly one location in the cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define the principle of locality in relation to cache performance

A

Locality refers to the tendency of a program to access a relatively small portion of its address space at any given time, typically temporal and spatial locality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference in access times and costs between Dynamic RAM (DRAM) and Flash superconductor memory?

A

DRAM access time: 50ns to 70ns; Cost: $10 to $20 per GB; Flash access time: 5,000ns to 50,000ns; Cost: $0.75 to $1 per GB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain how invalid blocks in a cache can be reused for new data

A

Invalid blocks can be filled with new data without affecting existing valid data, making efficient use of cache space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In what scenarios are larger block sizes beneficial for cache performance?

A

When accessing contiguous data items, larger blocks can exploit spatial locality, reducing the number of cache misses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What impact does miss penalty have on Average Memory Access Time (AMAT)?

A

Higher miss penalty increases AMAT, leading to slower overall performance as more time is spent fetching data from memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the components that make up Average Memory Access Time (AMAT)? (Formula)

A

AMAT = hit time + (miss rate × miss penalty)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you place a new value in a cache?

A

By using mapping techniques such as direct mapping, fully associative, or set associative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What factors can be used to evaluate the performance of cache?

A
  • Cache hit rate
  • Miss rate, hit time
  • Miss penalty
  • Average Memory Access Time (AMAT)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the access times and costs associated with Static RAM (SRAM)?

A

Access time: 0.5ns to 2.5ns; Cost: $500 to $1000 per GB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is spatial locality, and how does it affect cache design?

A

Spatial locality suggests that items near those accessed recently will likely be accessed soon; it influences the size of cache blocks

17
Q

How does hit time affect the overall performance of a caching system?

A

Lower hit time improves performance by decreasing the time taken to access data from the cache

18
Q

How do you calculate the hit rate in a caching system?

A

Hit rate = number of cache hits (h) / total data requests (n)

19
Q

How does the size of the cache affect hit and miss rates?

A

Larger caches typically reduce miss rates by providing more space for data, while smaller caches may lead to more frequent cache misses

20
Q

How does memory and cache impact processor performance?

A

They significantly reduce the time the CPU spends waiting for data, increasing throughput and speed

21
Q

Describe the structure of a cache’s data block

A

Each block includes valid bits, tags, and the actual data being cached

22
Q

What is an LRU (Least Recently Used) strategy and how is it implemented in caches?

A

LRU keeps track of the order of use of blocks and evicts the least recently used block when space is needed

23
Q

How can valid bits help indicate whether data in a cache block is valid?

A

A valid bit is set to 1 when data is loaded into a cache block, indicating that the data can be used

24
Q

What roles do the index and cache tag play in finding data in the cache?

A

The index identifies the cache block; the tag verifies that the data in that block corresponds to the requested address

25
Q

How does the memory address map to the cache index using direct mapping?

A

The memory address is mapped using modulo division by the size of the cache

26
Q

What are the two types of locality and why are they important for cache performance?

A

Temporal locality (recently accessed items) and spatial locality (nearby items); they help determine what data should be cached to increase hit rates

27
Q

What steps are involved in finding data in a cache?

A
  1. Index a block in the cache
  2. Check the valid bit
  3. Match the cache tag with the address tag
28
Q

What is the formula for miss rate and how is it derived?

A

Miss rate = 1 - hit rate = (n - h) / n

29
Q

How does the access time of magnetic disk compare to that of SRAM?

A

Magnetic disk access time is significantly slower, ranging from 5,000,000ns to 20,000,000ns

30
Q

What is the primary purpose of memory and cache in a computer system?

A

To store and quickly access data that the CPU needs, enhancing performance and efficiency

31
Q

Describe the block replacement strategies used in associative caches

A

Replacement strategies include Least Recently Used (LRU), random replacement, and first-in, first-out (FIFO)