Memory Organisation and Cache Design Flashcards

1
Q

What are the components of a memory block in cache

A

Block Address (higher-order bits), Block Offset (lower-order bits), Index Field, Tag Field.

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

What does the index field do in a cache

A

Selects the set (or entry) in the cache. A cache with 2^n sets requires an n-bit index

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

What does the tag field do in a cache

A

It is compared for a cache hit. if the tag matches, the entry contains the correct data

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

What are the three types of cache mapping

A

Direct mapped, fully associative, set-associative

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

What is direct mapped cache

A

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
6
Q

What is fully Associative Cache

A

Each memory location can be placed anywhere in the cache.

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

What is set-associative cache

A

Each memory location is mapped to a specific set in the cache, then placed anywhere within that set.

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

How is a block placed in direct mapped cache

A

block address mod number of blocks in cache

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

How is a block placed in set-associative cache

A

block address mod number of sets in cache

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

What is the formula for cache organisation

A

m=s×n, where:

m = total blocks in cache
s = number of sets in cache
n = blocks per set

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

What are the conditions for fully associative and direct mapped caches

A

Fully associative: n = m, s = 1
Direct Mapped: n = 1, s = m

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

How is a block identified in cache

A

Using the Block Address, Block Offset, Index Field, and Tag Field

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

What happens if cache associativity increases while keeping total size the same?

A

Number of Blocks per Set: Increases.
Index Size: Decreases.
Tag Size: Increases.

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

What are the three block replacement strategies?

A

Random Replacement, Least Recently Used (LRU), First In, First Out (FIFO).

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

How does Random Replacement work?

A

A block is randomly selected for replacement.

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

How does Least Recently Used (LRU) work?

A

The block that hasn’t been used for the longest time is replaced.

17
Q

How does First In, First Out (FIFO) work?

A

The oldest block in the set is replaced.

18
Q

What are the two main cache write strategies?

A

Write-Through and Write-Back.

19
Q

What is Write-Through?

A

Data is written only to the cache and updated in lower memory only when replaced.

20
Q

What are the advantages of Write-Back?

A

Saves power, reduces memory usage, and is efficient for multiprocessors.