Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer this question for all a,b,c and d and please put each letter besid

ID: 3888345 • Letter: P

Question

Please answer this question for all a,b,c and d and please put each letter beside each answer

Please answer this question for all a,b,c and d and please put each letter beside each answer

Consider a two way set associative cache with 8k memory for soring 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.

Explanation / Answer

a

Each line is if 4bytes

So total no of line = 213/4 = 211 Line

Since it is two way so one set has 2 line

So no of set = 211/2 = 210

B

Offset bit since 4 bit can be addressed by 2 bit

So offset is 2

Each line contain 4 byte so set contain 2*4=8 byte

Since 2way

So there are 8/8 = 1KB

So set field contain 10 bit since 210 = 1KB

So tag = 18 - 10-2 =6 bit

C

For storage capacity = 216bit

For valid 2 bit for each set so total 2 *no of set

=211 bit

For tag each tag has 6 bit

Two tag so 12 bit so

For 210 set

3*212 bit

So total is sum of all bit