Question: I have no idea how to do this, if someone can explain it or just do the problem with their setups so I can understand
I have no idea how to do this, if someone can explain it or just do the problem with their setups so I can understand what I am supposed to be doing I would appreciate it.
Simulate a set of address-requests for various cache configurations.
For each configuration you are required to:
Draw the cache
Report the total number of hits/misses
For each cache line you must:
Show the intermediate addresses: which is a historical record of which address requests previously occupied the cache-line
Show the final tag
Show the final data values (for data: use the addresses of the bytes that reside in each entry)
Assume each cache is initially empty and that the replacement scheme is least recently used.
The cache configurations are:
A fully associative cache with sixteen 8-byte blocks.
A direct-mapped cache with four 16-byte blocks.
An 8-way set-associative cache with a total of sixteen 4-byte blocks (eight blocks per set).
The address requests to simulate for each configuration are (assume 8-bit addresses): 0, 4, 8, 18, 20, 64, 32, 0, 23, 96, 32, 36, 16, 24, 40, 68.
For example, assume a fully-associative cache with a 4-byte block size, and a request for the byte at address 33. The address 33 translates to 0x21, or 00100001. Since the block-size is 4-bytes, the bottom two-bits of the address correspond to the byte offset within the block (01), and the remaining bits comprise the tag(001000) The cache entry would be formatted as follows:
| Valid | Intermediate | Final Tag | Data (Byte Offsets below) | |||
| 00 | 01 | 10 | 11 | |||
| 1 | 4/8/33 | 001000 | 32 | 33 | 34 | 35 |
For the caching scenario above, note that Byte 33 is at byte offset 01 in the 4-byte cache block. A request for 33 implies that the other 3 bytes in 33s block are also in the cache, thus bytes 32(offset:00), 34(offset:10), and 35(offset:11) appear in the same entry as 33. In this case, data would be 32, 33, 34, 35.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
