CS354 Q4 - Terms So Far

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/52

flashcard set

Earn XP

Description and Tags

Obsidian Q4 notes through Lesson 4: bytes, locality, cache variables and designs, and address splitting with division and remainder.

53 Terms

1
New cards

How many bits does one hexadecimal digit represent?

4 bits.

2
New cards

Increasing latency, what are the fastest places for memory retrieval?

Registers → L1/L2/L3 cache → RAM → SSD → hard disk. Fastest to slowest, or increasing latency.

Real Legends Rarely Skip Dessert

3
New cards

What is bandwidth?

The amount of data transferred per unit of time, such as bytes/second or GB/s.

4
New cards

What is the usual storage size/speed/cost tradeoff?

Small storage near the CPU is generally faster and more expensive per byte; larger storage is generally slower and cheaper per byte.

5
New cards

What is temporal locality?

Reusing the SAME memory location soon. Example: access A, B, A, A. It describes an access pattern.

6
New cards

What is spatial locality?

Accessing NEARBY memory locations within a short time. They need not be adjacent, and each location may be used only once.

7
New cards

How does fetching a whole cache block take advantage of spatial locality?

Fetching one byte also brings nearby bytes into the cache, so later nearby accesses may already be cached.

8
New cards

What is a machine word?

A natural processor data unit; often 8 bytes on a 64-bit machine. The size depends on the architecture.

9
New cards

What is a common cache-block size?

64 bytes is common, but use the block size specified by the problem.

10
New cards

What is a virtual-memory page, and what size is common?

An operating-system memory-mapping unit; commonly 4096 bytes, though sizes vary.

11
New cards

What is a memory block?

An aligned B-byte region of consecutive memory. With B=4, blocks cover addresses 0–3, 4–7, 8–11, and so on.

12
New cards

What is a cache line?

One cache slot that can hold a copy of ONE memory block plus bookkeeping, such as a valid bit and stored tag.

13
New cards

What is a cache set?

A group of E cache lines. A block maps to a particular set and can occupy an eligible line within that set.

14
New cards

How are a cache, its sets, and its lines organized?

A cache contains sets; each set contains cache lines; each line holds one block plus bookkeeping.

15
New cards

What does uppercase S represent?

S = number of sets in the cache.

16
New cards

What does lowercase s represent?

s = log₂(S) = number of set-index bits needed to identify a set. It is not the selected set number.

17
New cards

What does E represent?

E = number of cache lines PER set (associativity).

18
New cards

What does uppercase B represent?

B = number of bytes PER block, not the number of blocks.

19
New cards

What does lowercase b represent?

b = log₂(B) = number of offset bits needed to identify a byte within a block. It is not the offset value.

20
New cards

What does C represent, and how is it calculated?

C = S × E × B = cache DATA capacity in bytes

21
New cards

How many total cache lines are there?

S × E. Each line can hold one block.

22
New cards

What is a direct-mapped cache?

One line per set: E=1. Each block has exactly one possible line; different blocks can compete for that same line.

23
New cards

What is a set-associative cache?

multiple lines per set. A block's address determines its set, but the block can occupy any of the E lines within that set.

24
New cards

What is a fully associative cache?

All cache lines belong to ONE set: S=1. Any block can occupy any line; s=log₂(1)=0 set-index bits.


Set 0: [line] [line] [line] [line]

25
New cards

What are the address fields from most significant to least significant?

Tag | set index | block offset.

26
New cards

What does the set index identify?

Which set in the cache to check. Lowercase s counts the bits used for this field.

27
New cards

What does the tag identify?

Which memory block is wanted among the blocks assigned to the selected set. Compare it with the tags stored in that set's valid lines.

28
New cards

What does the block offset identify?

Which byte within the block is wanted, counting from 0. Lowercase b counts the bits used for this field.

29
New cards

What does lowercase t represent?

t = number of tag bits; t = m − s − b.

30
New cards

How do you calculate the number of tag bits?

t = m − s - b

m = how many bits are in the address

s = # of bits in S

b = # of bits in B

31
New cards

What information does a cache line contain in the hardware model?

A valid bit, a stored tag, and the block's data bytes; additional bookkeeping may also exist.

32
New cards

What does a cache line's valid bit mean?

1 =usable block; 0 = contents are not valid.

33
New cards

How is a requested address different from a cache line?

address: tag, set index, and offset (to locate a byte).

cache line: validity bit, a tag, and the copied block data.

34
New cards

How do you calculate the block offset?

offset = address % B.

35
New cards

How do you calculate the memory block number?

block_number = address // B

36
New cards

How do you calculate the set index?

set = block_number % S.

37
New cards

How do you calculate the tag?

tag = block_number // S

38
New cards
What is a compulsory (cold) miss?
A miss on the first reference to a memory block.
39
New cards
What is a conflict miss?
A miss because blocks compete for the same set, even though the cache has enough total capacity.
40
New cards
What is a capacity miss?
A miss because the cache is too small to retain the needed working set.
41
New cards
What is prefetching?
Fetching data early because we predict the program will need it soon.
42
New cards
In P4, what if we need to install a block and multiple lines in its set are empty?
Use the lowest-numbered empty line.
43
New cards
In P4, what if we need to install a new block and its set is full?
Evict the least-used block (LFU: smallest access count).
44
New cards
In P4, do we count accesses to blocks or individual bytes?
Count accesses to blocks, not individual bytes.
45
New cards
In P4, how do we break a tie between lines with the smallest access count?
Choose the lowest-indexed line among the tied lines.
46
New cards

What is write-through?

[Writing to cached block] Update the cached data and immediately forward the write to the next level. (“I’ll write.. but you’re going right through me”)

47
New cards

What is write-back?

[Writing to cached block] Update cached data; send the changes to the next level later, such as when the block is evicted. (“I’ll write back to you”)

48
New cards
What is write-allocate?
[Writing to uncached block] Bring the block into our cache level, then change it. With write-back, mark it dirty.
49
New cards

What is no-write-allocate?

[Writing to uncached block] Forward the write to the next level without loading the block into this cache; the next level follows its own policy. (“No, I will not write, you do it!”)

50
New cards
What does dirty mean?
Modified but not yet saved to the next level.
51
New cards
What is AMAT, and what is its equation?
Average Memory Access Time = hit time + (miss rate × additional miss penalty).
52
New cards
What is a memory mountain?
A graph showing how fast a computer reads memory under different access patterns; its height is throughput (bytes read per second).
53
New cards
What is working-set size?
How much data the program repeatedly uses; for example, a 4 KB array versus a 40 MB array.