Log In
1 vote

Question :

in CO and Architecture
edited by
I think some miss in question.

Without memory line size, how can we calculate it?
block sizes are same on MM and cache @srestha ?
0.1 ( read + write )

0.1(0.75*168*1 + 0.25*168*2 + 32*1) = 25 * 8 B

but if it is write through then why do we need dirty bits ?

is it right ? please let me know.
@gatesjt because question is made by ME

3 Answers

0 votes
21 for read as 32 for  53
0 votes

For read, memory references:   168 (0.9(0) + 0.1(1) )  = 16.8

For write, memory refernces :   32 (0.9(1) + 0.1(1) ) = 32

Total memory references, interms of bytes = (16.8 + 32)*128 = 6246.4 ~ 6246

As one line has 128 Bytes

Since write through is used , there is no need to consider dirty bits.

edited by
in case of miss ... missing mem block should be brought into cache first right ?
yes, that is why the 0.25 term is there

and it will also be included in write as you have to bring the block just written in memory to cache, because it is what cache is meant for, to contain recently accessed blocks.

If a word is missing in cache, then corresponding entire block 128B request is made to MainMem and brought into cache.I terms of time we add only Main Mem penalty for that transfer (Tm) .why ? because all those 128B will be parallely accessed from Main Memory for which overall latency is Tm only. That's why we write  missrate*(Tm+Tc+etc..) in a cache miss situation to calculate TIME

That being said, my question is are you counting memory reference in terms ok blocks ? Because they are asking in terms of bytes..please complete it in terms of Byte.


This is not related to your solution.

When you write on a hit in cache, you considered write through to lower level , ( you given it as 0.9*1 block) . So, whenever you make something dirty in cache, It can be remain dirty. Lower and upper both levels remains same in terms of data,because of write through policy implementation. Then why there is again possibility of 0.25 dirty ?

@Debashish yes, you are right. Since write through is used no need to use dirty bits. I have edited the answer.
Why did u consider the 0unit when there is a hit for Read and 1unit when there is a miss for Read?

Similarly, 1unit when there is hit for write and 1unit when there is miss for write. Why so?
0 votes
There is no use of dirty bit.

168 read out of which 10% needs memory access. 17 memory accesses for read.

32 write instructions. in case of cache miss we need 4 memory access. Because cache is write through we need 32 more memory acess for writing.

Total = 17 + 4 + 32 = 53
"dirty bits" should not have been in the question.

But why "4" extra for write case as all accesses are anyway going to memory? And final answer is asked in bytes - not words.

Related questions

3 votes
1 answer
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
asked Jan 30, 2019 in CO and Architecture Ram Swaroop 520 views
2 votes
1 answer
A CPU cache is organized into 2 level cache L1 and L2 The penalty for L1 cache miss and L2 cache miss are 60 and 30 respectively for 1200 memory references The hit time of L1 and L2 are 5 and 10 clock cycles and penalty for L2 cache miss to main memory is 70 clock cycles. The average memory access time will be
asked Jan 29, 2019 in CO and Architecture Ram Swaroop 499 views