I am getting 4.4 cycles.

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+3 votes

+1

I don't have solution with me. It's actually from here(5th question): https://www.cse.buffalo.edu//~stevko/courses/cse490/spring11/files/midterm-sol.pdf

This question was also asked in Virtual GATE full length test.

+1 vote

Best answer

$L_3$ Miss penalty $=$ Memory hit time $= 100\space cycles$

$L_3$ hit time$ = 50$ $cycles$

$L_3$ hit ratio $= 50$%

So, $L_2$ miss penalty $= \frac{50}{100}$ x $L_3$ $hit$ $time + \frac{50}{100}$ x $L_3$ $miss$ $penalty$

$ = \frac{50}{100}$ x $100 + \frac{50}{100}$ x $50 = 75$ $cycles$

$L_2$ hit time $= 8$ $cycles$

$L_2$ hit ratio $= 80$%

So, $L_1$ miss penalty $= \frac{80}{100}$ x $L_2$ $hit$ $time$ $+ \frac{20}{100}$ x $L_2$ $miss$ $penalty$

$= \frac{80}{100}$ x $8 + \frac{10}{100}$ x $75 = 21.4$ $cycles$

$TLB$ hit time $= 1$ $cycle$

$TLB$ miss penalty $=$ Page table walk and TLB update time $= 200$ $cycles$

$TLB$ hit ratio $= 95$%

So, $TLB$ $access$ $time = TLB$ $hit$ $time$ x $\frac{95}{100} + (TLB$ $hit$ $time + TLB$ $miss$ $penalty)$ x $\frac{5}{100}$

$= 1$ x $\frac{95}{100} + (1+200)$ x $\frac{5}{100} = 11$ $cycles$

$L_1$ hit time $= 1$ $cycle$

$L_1$ hit ratio $= 95$%

So, Average memory access time $= TLB$ $access$ $time + (\frac{95}{100}$ x $L_1$ $hit$ $time + \frac{5}{100}$ x $L_1$ $miss$ $penalty)$

$= 11 + (\frac{95}{100}$ x $1 + \frac{5}{100}$ x $21.4)$

$= 11 + 2.02 = 13.02$ $cycles$.

$L_3$ hit time$ = 50$ $cycles$

$L_3$ hit ratio $= 50$%

So, $L_2$ miss penalty $= \frac{50}{100}$ x $L_3$ $hit$ $time + \frac{50}{100}$ x $L_3$ $miss$ $penalty$

$ = \frac{50}{100}$ x $100 + \frac{50}{100}$ x $50 = 75$ $cycles$

$L_2$ hit time $= 8$ $cycles$

$L_2$ hit ratio $= 80$%

So, $L_1$ miss penalty $= \frac{80}{100}$ x $L_2$ $hit$ $time$ $+ \frac{20}{100}$ x $L_2$ $miss$ $penalty$

$= \frac{80}{100}$ x $8 + \frac{10}{100}$ x $75 = 21.4$ $cycles$

$TLB$ hit time $= 1$ $cycle$

$TLB$ miss penalty $=$ Page table walk and TLB update time $= 200$ $cycles$

$TLB$ hit ratio $= 95$%

So, $TLB$ $access$ $time = TLB$ $hit$ $time$ x $\frac{95}{100} + (TLB$ $hit$ $time + TLB$ $miss$ $penalty)$ x $\frac{5}{100}$

$= 1$ x $\frac{95}{100} + (1+200)$ x $\frac{5}{100} = 11$ $cycles$

$L_1$ hit time $= 1$ $cycle$

$L_1$ hit ratio $= 95$%

So, Average memory access time $= TLB$ $access$ $time + (\frac{95}{100}$ x $L_1$ $hit$ $time + \frac{5}{100}$ x $L_1$ $miss$ $penalty)$

$= 11 + (\frac{95}{100}$ x $1 + \frac{5}{100}$ x $21.4)$

$= 11 + 2.02 = 13.02$ $cycles$.

- All categories
- General Aptitude 1.6k
- Engineering Mathematics 7.3k
- Digital Logic 2.7k
- Programming & DS 4.9k
- Algorithms 4.2k
- Theory of Computation 5.4k
- Compiler Design 2.1k
- Databases 4k
- CO & Architecture 3.5k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 570
- Exam Queries 566
- Tier 1 Placement Questions 23
- Job Queries 70
- Projects 18

48,756 questions

52,850 answers

183,548 comments

68,745 users