retagged by
1,201 views
2 votes
2 votes

Common Data For Questions 1 and Question 2 

Direct Mapping cache given below 

17-tag | 10-block | 5-word , 2 to 1 MUX / OR  has latency of 0.6ns ,k-bit comparator has katency of k/10 ns

Question 1 

If a two- way set associative cache is constructed from the given directmapped cache then the ratio of hitlatency of directmapped cache to 2-way set associative cache would be ___________

Question 2 
Number of MUX/OR  and Compators Needed in Direct Mapped Cache (#MUX/OR , Comparator) are 

  1.  (1,17)
  2. (17,1)
  3. (1024,1)
  4. None
retagged by

2 Answers

3 votes
3 votes

Solution to 1st part :

Given ,

No of bits for tag  =  17

No of bits for block = 10

No of bits for offset = 5

So this is for direct mapped..We know 

In direct mapped we do not need multiplexer as no of ways in each set = 1 

So only hit only will be due to tag comparator only..

Given latency due to k - bit comparator = k / 10  =  17 / 10  = 1.7 ns

Now for set associative ,

No of sets = No of lines (blocks) / Associativity

                = 1024 / 2 

                = 512

Hence set bits = log2 512   =  9 

As block size remains the same in either case , so the one bit which has been decreased due to formation of sets becomes part of tag field..

So no of tag bits now = 17 + 1  = 18

So latency due to comparator  =  1.8 ns

  Latency due to mux   =  0.6 ns

So total latency of given 2 way set assocative cache  =  2.4 ns

So ratio of hit latency of direct to set assocative cache  =  1.7 / 2.4  

                                                                                  =  0.708 correct to 3 decimal places

0 votes
0 votes
no. of mux is 17

size of mux is 10(10X1) which is not possible it will be 16X1

but 2X1 MUX is used so no. of mux17X15

and no of comparater is always 1 in direct mapping

Related questions

3 votes
3 votes
1 answer
1
PEKKA asked Jan 2, 2017
534 views
f(n) = $\Theta (n^{2})$ g(n) = $\Omega (n)$ h(n)=O(log n) then [ f(n) . g(n) ] + [h(n) . f(n) ] is $\Omega (n)$$\Theta (n^{2})$O(log n)None
0 votes
0 votes
2 answers
2
PEKKA asked Dec 6, 2016
433 views
Complexity of the following snippet is for (i=1;i<n;++i) for(j=1;j<=n;j=j+i) c=c+1;
1 votes
1 votes
1 answer
3
PEKKA asked Dec 6, 2016
393 views
Complexity of the below code snippet is ..for (i=1;i<=n;++i) { j=2; while(j<=n) { j=j*j; c=c+1; } }$O(nlog n)$$O(n^{2})$$O(nloglog n)$$O(n)$