Problem

# Repeat Problem for the following sequence of read addresses: 0, 4, 12, 8, 14, 1C, 1A, 28,...

Repeat Problem for the following sequence of read addresses: 0, 4, 12, 8, 14, 1C, 1A, 28, 26, 2E, 36, 30, 3E 38, 46, 40, 4E, 48, 56, 50, 5E, 58.

Problem

A CPU produces the following sequence of read addresses in hexadecimal: 54, 58, 104, 5C, 108, 60, F0, 64, 54, 58, 10C, 5C, 110, 60, F0, 64

Supposing that the cache is empty to begin with, and assuming an LRU replacement, determine whether each address produces a hit or a miss for each of the following caches: (a) direct mapped in Figure 1, (b) fully associative in Figure 2, (c) two-way set associative in Figure 3.

Figure 1 Direct Mapped Cache

Figure 2 Fully Associative Cache

Figure 3 Two-Way Set-Associative Cache

#### Step-by-Step Solution

Solution 1

Looking at the sequence: 0, 4, 12, 8, 14, 1C, 1A, 28, 26, 2R, 36, 30, 3E, 38, 46, 30, 4E, 48, 56, 50, 5E, 58. Since no numbers are repeated at all, every single address is a miss.