359 views
Consider a n-way cache with 'x blocks of 64 words each. The main memory of the system is having 8 million words. Size of the tag field is 16 bits and additional memory required for tags is 1024 bytes. What will be the values of n and x respectively?

edited | 359 views

Memory required for tags = no. of blocks * tag size

1024B = x * 16-bit

x = 512

Main memory size : 2^23 words can be represented in 23 bits

Tag + Set + Word = 23 bit

16 + Set + 6 = 23-bit

Set = 1bit

No. of sets = 2

n = No.of blocks / No. of sets = 512 / 2 = 256

(x,n) = (512,256)

selected
0
I think there is a correction required

Tag + Set + Word = 23 bit

16 + P-Way + 6 = 23-bit
P-way bit = 1bit

so it is a 2-way set associative cache

So answere must be :- (x,n) = (512, 2)
0

Main memory size : 2^23 words can be represented in 23 bits

Tag + Set + Word = 23 bit

why did you consider 23 bits as cache address length?

main memory and cache memory length can not be same always...... i think more feasible is to take

Tag + Set index = main memory tag and main memory tag represents main memory blocks..

pls clear