187k views
4 votes
Assume the system with 256B memory and 64B cache and the block size of 16 bytes. I.e., there are 4 blocks in the cache. (a) For direct-mapped cache, 8-bit memory addresss is decomposed of ___-bit tag, ___-bit index, and ___-bit block offset. (b) For fully associative cache, 8-bit memory addresss is decomposed of ___-bit tag, ___-bit index, and ___-bit block offset. (c) For 2-way set associative cache, 8-bit memory addresss is decomposed of ___-bit tag, ___-bit index, and ___-bit block offset. Assume the system as question 1. Assume cache is initially empty, i.e., all 4 cache blocks are invalid. Consider the memory reference sequence: D6, 58, D8, 9A, DE, 5C.(a) Indicate if it is a hit or misss for each memory reference if it is direct-mapped cache. What is the miss ratio

User Orejano
by
5.7k points

1 Answer

3 votes

Answer:

Check the explanation

Step-by-step explanation:

1.

System = 256Byte = 8 bit

Cache = 64B , block size = 16 byte.

A) Direct Mapped Cache:

Block offset = log (Block size) = log 16 = 4bit

Total # of block inside cache = 4.

Therefore index offset = log 4 = 2bit.

Remaining is tag bits.

Therefore tag bits = 8-(4+2) = 8-6 = 2 bits

Tag Index offset Block offset

(2 bits) (2 bits) (4 bits)

Fully associative cache :

In fully associative cache, any of main memory block can be placed anywhere in cache. Therefore index offset =0 bits.

Therefore tag bits = 8-block offset bit= 8-4 =4bits

Tag Block offset

(4 bits) (4 bits)

User Andrew Stewart
by
4.7k points