The Gateway to Computer Science Excellence

0 votes

*$h_1→L1$ hit ratio
$h_2→L2$ hit ratio
$C_1→ L1$ access time
$C_2→ $Miss penalty to transfer information from L2 to L1
$M→$ Miss penalty to transfer information from main memory to L2*

*Average access time given in Carl Hamacher's book is*

*$t_{avg}=h_1C_1+(1-h_1)h_2C_2+(1-h_1)(1-h_2)M$*

*Shouldn’t it be*

*$t_{avg}=h_1C_1+(1-h_1)h_2(C_2\color{red}{+C_1})+(1-h_1)(1-h_2)(\color{red}{C_1+C_2’+C_2+}M)$*

where $C_2’\rightarrow$ L2 access time (note that this is different from $C_2$)

When L2 miss occurs, book formula considers only $M$, that is moving data from memory to L2. Isnt this data also moved from L2 to L1 making us add $C_2$? Also $C_2$ and $M$ are duration for moving data from L2 to L1 and memmory to L2 respectively. These are penalties. But before penalties, a miss occurs which requires $C_1$ time for L1 miss and $C_2’$ time for L2 miss. But these does not seem to have added in the book formula. I have added them as highlighted in red.

Is my equation correct or book’s equation. Or something more is going on here, which I am unaware of?

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,647 questions

56,497 answers

195,490 comments

100,815 users