Questions All Solved Correct 2025-
2026 Update.
what is a cache - Answer a hardware device that holds copies of data that are a subset of a
larger collection of data
provides faster access to data
cache hit and cache miss - Answer cache hit --> you retureve the datum from the cache
cache miss ---> if the datum is not in this cache, it retrieves the requested datum along with the
rest of the data surrounding it
what is a block - Answer The bunch of data that the cache fetches together
blocks have a uniform size determined by the cache
eviction policy - Answer When the cache responds to a cache miss by retrieving the new block
containing the requested datum, where does it store the new block?
•If the cache has empty space, it stores the block there.
•If the cache is full, however, it must replace an existing block with the new one.
•It must choose a "victim" block to replace—or "evict."
Internal Structure of a cache
what are the three components of a row in a set - Answer The cache has a number of sets -->
S (2^s for some integer s)
, Each line has a valid bit which indicates whether the data is valid
Each line has some number t of tag bits, which are used to find the right cache line within the
set for a requested datum.
when is the valid bit set to 0 or 1 - Answer when the block is evicted to make more room, the
valid bit is set to 0
when the data is retrieved it is set to 1
Capacity of the cache - Answer C = S × L × B
Sets * Lines * Blocks
How to index into a cache - Answer First figure out how many bits you need to represent the
set index and block index. Ex. 256 sets = 8 bits --> BE CAREFUL this is one less than 256 binary
becasue you count 0
then do this --> number of bits for set + number of bits for block = X
grab the rightmost X bits
grab the leftmost S bits and find the number --> this is the ROW number, BE CAREFUL the rows
start with 0
grab the rest of the bits as B and find the number --> this is the COLUMN number, BE CAREFUL
the columns start with 0
based on the systems word size or w-bit system, start with that row, column and grab more to
the right if needed
ex. 16 bit system and the row/column you got with the address has 8 bits in it, grab the next
block to the right also