edited by
1,580 views
0 0 votes
Quantify the effect on performance that result from the use of a cache in the case of a program that has a total of $500$ instruction including a $100$ instruction loop that is executed $25$ times.Determine the ratio of execution time without the cache to execution time with the cache.Assume that main memory access require $10$ units of time and cache access require $1$ unit of time.We also make the following assumption

1)Program execution time is proportional to the total amount of time needed to fetch the instruction from either the main memory or the cache.with operand data access being ignored

2)Initially all instruction is stored in main memory and the cache is empty.

3)The cache is large enough to contain all loop instruction.

_________________________________________________________________

my solution is

execution time without cache is=$400*10+100*10*25=29000$

execution time with cache =$500*10+100*1*25=7500$,

but in  original solution execution time with cache is =$500*10+100*1*24=7400$.

my doubt is loop is occuring $25$ times so why there is multiplication of $24$ ??why not $25$??

1 Answer

1 1 vote
It is so because for the first time, 100 instructions will be fetched from the main memory, that requires 10 units of time and after that stored in cache and so for the next 24 times, 1 unit of time will be required.
Position:
Show:

Related questions

3 3 votes
1 answers 1 answer
4.6k
4.6k views
Rishabh Gupta 2 asked Oct 18, 2017
4,624 views
Problem: A computer system uses 32-bit memory addresses and it has a main memory consisting of 1G bytes. It has a 4K-byte cache organized in the block-set-associative man...
0 0 votes
0 0 answers
1.3k
1.3k views
srestha asked Apr 2, 2019
1,318 views
Register $R_{1}$ and $R_{2}$ of a computer contain the decimal values $1200$ and $4600$ . What is the effective address of the memory operand in each of the following ins...
0 0 votes
0 0 answers
853
853 views
cynicthnkr asked Apr 6, 2018
853 views
1. Computer Organization and Embedded Systems 6e Paperback – 1 Jul 2017 2. Computer Organization Paperback 5e – 4 Nov 2011Are these two same, because titles are different...
5 5 votes
2 answers 2 answers
6.5k
6.5k views
reena_kandari asked Jun 7, 2017
6,451 views
A computer system has a main memory consisting 1M 16 bit-words.It also has a 4K-word cache organized in the block-set-associative manner,with 4 blocks per set and 64 word...