1. Consider a two way set associative cache with 8K memory for storing data. Eac
ID: 3888050 • Letter: 1
Question
1. Consider a two way set associative cache with 8K memory for storing data. Each line in the cache stores 4 bytes of data. a. How many lines and how many sets does the cache have? b. The cache is used with a computer having a 18 bit address bus. Illustrate how the CPU address is divided into the TAG, SET, and OFFSET fields. Also indicate the number of bits in each field. c. Calculate the total number of memory bits used in the cache, including all the lines, the tags, and valid bit for each line.
2. Consider a two way set associative cache with 1024 lines and 8 bytes per line a. How many sets does the cache have? b. The cache is used with a computer having a 16 bit address bus. Illustrate how the CPU address is divided into the TAG, SET, and OFFSET fields. Indicate the number of bits in each field. c. Calculate the cache data size, in bytes d. Calculate the total number of memory bits used in the cache, including all the lines, the tags, and valid bit for each line.
Explanation / Answer
Given Cache memory = 8kB= 213 bytes
Each line stores--> 4 bytes= 22
Therefore blockoff = 2 bits.
Given that the cache is used with a computer having a 18 bit address bus.
Hence pysical address that we need to consider = 18 bits.
Number of lines = cache size/block size
= 213/22
= 211
No. of lines = 11
In two way set assossiative, index = no.of lines/2
= 211/2
= 210
Therefore index = 10.
Then,Tag = physical address - index - blockoff
= 18 -10 - 2
= 6
2. Give,number of lines= 1024
In two way set assossiative there should 1024/2 sets required = 512
Physical address =16 bit address.
Block size= 8 bytes= 23
Then offset = 3 bits.
no.of lines =1024
In two way set assissiative, index = no.of lines/2
= 512
= 29
Then,Tag= physical addess- index - offset
= 16-9-3
= 4.
4
Tag Index offset 6 10 2Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.