2.9k views
3 votes
Suppose we have an 8 block cache. Each block of the cache is one word wide. When a given program is executed, the processor reads data from the decimal addresses show below. 4, 7, 10, 11, 4, 8, 12, 7 Show the contents of the cache at the end of the above reading operations if the cache is 4-way set associative. Assume blocks will be filled starting at block position zero and the replacement policy is LRU. Use 4 or [ 4 ] to represent the contents of memory at address 4. If the block is empty, enter [ empty ]. Set # Block Position Contents of Data Cache 0 0 1 2 3 1 0 1 2 3

1 Answer

4 votes

The set for block position contents of data cache 0 0 1 2 3 1 0 1 2 3 is as follows:

Step-by-step explanation:

Total number of blocks = 8

The cache mapping used is 4 way set associative.

Number of sets = 8 by 4 = 2 that is set 0 and set 1.

The mapping in a set associative takes place as:

Location for a memory block in cache = Memory block mod number of sets in the cache.

The first address is 4.

Location of the block with address 4 = 4 mod 2 = Set 0.

User Bryan Dimas
by
5.0k points