※ 引述《koala0716 ()》之铭言:
: https://drive.google.com/file/d/0B1pKe1BYhAiPbVNhSXRwR0cxT0E/view?usp=sharing
: 不知道是理解还是计算错误
: 想了好久一直凑不出答案
: 有请高人指点了
电脑排版 建议用电脑看
看到这题好像没人解小弟就先抛砖引玉,借此来让大家帮小弟修正观念 : 目
有误请帮小弟纠正 感谢
A.
┌──────────────────┐
│ MEM │
┌────┐│ ┌────┐ ┌───┐│
│ CPU ├┼───┤L1 Cache├────┤MEM││
└────┘│1 C.C └────┘100 C.C └───┘│
│ │
└──────────────────┘
=> CPI(effective) = 3 C.C = CPI(base) + Memory-stall cycles per instr.
= 1 + Cache access * Miss rate * Miss pently
= 1 * + 1 * x % * 100
=> x = 2 %
=> Hit ratio = 1 - Miss rate = 98 %
Ans : X
B.
1 + 1 * ( 1 - 99.4% ) * 100 C.C.
= 1 + 0.6 / 100 * 100
= 1 + 0.6 = 1.6 C.C.
1 + 1 * ( 1 - 100% ) * 100 C.C.
= 1
the effective CPI ( 1.6 C.C ~ 1 C.C. != 2.5 )
Ans : X
C.
┌────────────────────────────┐
│ 1-X % │
┌────┐│ ┌────┐ 2% ┌────┐ X % ┌───┐│
│ CPU ├┼───┤L1 Cache├────┤L2 Cache├────┤MEM││
└────┘│1 C.C └────┘ 3 C.C └────┘100 C.C └───┘│
│ │
└────────────────────────────┘
┌L1 hit
Mem access ┤ ┌ L2 hit
└L1 miss ┤
└ L2 miss ─ main MEM
└ (A) ┴ (B) ┴ (C) ┘
Mem access =(A) Cache L1 access times * L1 R/W Cycle +
(B) Cache L2 access times * L1 Miss rate * L2 Cycle +
(C) Cache L2 access times * L1 miss rate * L2 miss rate * Mem Cycle
The 2nd level cache with read / write time = 3 C.C.
The 2nd level cache for an effective time of 2.5 C.C
2.5 = 1 * 1 + 1 * 2% * 3 C.C. + 1 * 2% * X% * 100 C.C.
1.5 = 0.06 + 2X /100
X = 144 / 2
= 72
Hit ratio = 1 - Miss rate = 28%
Ans : X
D.
┌────────────────────────────┐
│ 80 % │
┌────┐│ ┌────┐ 2% ┌────┐ 20 % ┌───┐│
│ CPU ├┼───┤L1 Cache├────┤L2 Cache├────┤MEM││
└────┘│1 C.C └────┘ x C.C └────┘100 C.C └───┘│
│ │
└────────────────────────────┘
┌L1 hit
Mem access ┤ ┌ L2 hit
└L1 miss ┤
└ L2 miss ─ main MEM
└ (A) ┴ (B) ┴ (C) ┘
Mem access =(A) Cache L1 access times * L1 R/W Cycle +
(B) Cache L2 access times * L1 Miss rate * L2 Cycle +
(C) Cache L2 access times * L1 miss rate * L2 miss rate * Mem Cycle
The 2nd level cache for an effective time of 1.5 C.C
1.5 = 1 * 1 C.C. + 1 * 2% * x C.C. + 1 * 2% * 20% * 100 C.C.
0.5 = 200x /10000 + 4000 / 10000
5000 = 4000 +200x
x = 5
Ans : O
E.
┌────────────────────────────┐
│ 90 % │
┌────┐│ ┌────┐ 2% ┌────┐ 10 % ┌───┐│
│ CPU ├┼───┤L1 Cache├────┤L2 Cache├────┤MEM││
└────┘│1 C.C └────┘ 4 C.C └────┘100 C.C └───┘│
│ │
└────────────────────────────┘
┌L1 hit
Mem access ┤ ┌ L2 hit
└L1 miss ┤
└ L2 miss ─ main MEM
└ (A) ┴ (B) ┴ (C) ┘
Mem access =(A) Cache L1 access times * L1 R/W Cycle +
(B) Cache L2 access times * L1 Miss rate * L2 Cycle +
(C) Cache L2 access times * L1 miss rate * L2 miss rate * Mem Cycle
The effective time is lower than 1.3 C.C.
1 * 1 C.C. + 1 * 2 % * 4 C.C. + 1 * 2% * 10% * 100C.C.
= 10000 / 10000 + 800 / 10000 + 2000 / 10000
= (10000 + 800 + 2000) / 10000 = 1.28
Ans : O