The Gateway to Computer Science Excellence
+3 votes
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?

Answer 256 512
in CO and Architecture by
edited by | 359 views

1 Answer

+5 votes
Best answer
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)
by
selected by
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

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,375 questions
60,580 answers
201,987 comments
95,396 users