• edited by
44,056 views
115 115 votes
The memory access time is $1$ nanosecond for a read operation with a hit in cache, $5$ nanoseconds for a read operation with a miss in cache, $2$ nanoseconds for a write operation with a hit in cache and $10$ nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves $100$ instruction fetch operations, $60$ memory operand read operations and $40$ memory operand write operations. The cache hit-ratio is $0.9$. The average memory access time (in nanoseconds) in executing the sequence of instructions is ______.

12 Answers

Best answer
96 96 votes
The question is to find the time taken for,

$\frac{100 \space \text{fetch operations and $60$ operand read operations and $40$ memory operand write operations}}{\text{total number of instructions}}$.

Total number of instructions $=100+60+40 =200$

Time taken for $100$ fetch operations(fetch = read) $= 100*((0.9*1)+(0.1*5))$

$1$ corresponds to time taken for read when there is cache hit $= 140 \,\text{ns}$

$0.9$ is cache hit rate

Time taken for $60$ read operations,

$= 60*((0.9*1)+(0.1*5))$
$= 84\,\text{ns}$

Time taken for $40$ write operations

$= 40*((0.9*2)+(0.1*10))$
$= 112\,\text{ns}$

Here, $2$ and $10$ are the times taken for write when there is cache hit and no cache hit respectively.

So,the total time taken for $200$ operations is,

$= 140+84+112$
$= 336\,\text{ns}$

Average time taken $=$ time taken per operation

$=\dfrac{336}{200}$

$= 1.68\,\text{ns}$
• edited by
54 54 votes
Fetch is also a memory read operation.

Avg access time $= \dfrac{160 (0.9 \times 1+0.1 \times 5)+ 40(0.9 \times 2+0.1 \times 10)}{200} \\=\dfrac{160\times 1.4+40 \times 2.8}{200} \\=\dfrac{336}{200} \\=1.68$
• edited by
8 8 votes
TavgR = 0.9 * 1 + 0.1 * 5 = 1.4 //TavgR here is avg time needed to one read operation

TavgW=0.9 *2 + 0.1*10 =2.8 //TavgW here is avg time needed to one write operation

Tavg = Total time needed to read/write operations / total no.of operations

Here Read operations are=100(fetch) + 60(memory read) = 160

Here Write operations are=40

So= (160 * 1.4 + 40 * 2.8 ) / 200

    =336/200=1.68ns
5 5 votes

……………………....………….….………..……..........................….……..…

1 1 vote
Memory access time means howlong it takes for an element in memory to be transferred to or from the cpu....so its the relation between the cpu and memory(in theory....now this memory can be either cache or main memory(in practical)...so when its given memory access time when cache hit then its means the time related to cache and cpu...and when its given memory access time when cache miss then its means its the time related with cpu and higher level memory (not cache)...
Answer:
Position:
Show:

Related questions

9 9 votes
5 answers 5 answers
8.9k
8.9k views
go_editor asked Sep 28, 2014
8,913 views
In the context of modular software design, which one of the following combinations is desirable?High cohesion and high couplingHigh cohesion and low couplingLow cohesion ...
75 75 votes
9 answers 9 answers
40.3k
40.3k views
Kathleen asked Sep 13, 2014
40,326 views
The access times of the main memory and the Cache memory, in a computer system, are $500$ n sec and $50$ nsec, respectively. It is estimated that $80\%$ of the main memor...
89 89 votes
13 answers 13 answers
36.3k
36.3k views
go_editor asked Sep 28, 2014
36,348 views
An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (EX), memory access (MEM), a...
48 48 votes
7 answers 7 answers
14.6k
14.6k views
go_editor asked Sep 28, 2014
14,621 views
Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency. $\text{P1:}$ Four-stage pipeline with stage latencies...