The University of The South Pacific: EE326 Embedded Systems
The University of The South Pacific: EE326 Embedded Systems
The University of The South Pacific: EE326 Embedded Systems
Question 2 Given a 2-level cache design where the hit rates are 88% for the smaller cache
and 97% for the larger cache, the access costs for a miss are 12 cycles and 20 cycles,
respectively, and the access cost for a hit is one cycle, calculate the average cost of access.
1|Page
The University of the South Pacific
Avg. cost ≈ (0.88 * 1) + (0.12 * 0.97 * 12) + (0.12 * 0.03 * 20) ≈ 0.88 + 1.3968 + 0.072 ≈ 2.3488
cycles
Question 3 You are asked to perform capacity planning for a two-level memory system. The
first level, M1, is a cache with three capacity choices of 64 Kbytes, 128 Kbytes, and 256 Kbytes.
The second level, M2, is a main memory with a 4-Mbyte capacity. Let c1 and c2 be the costs per
byte and t1 and t2 the access times for M1 and M2, respectively. Assume c1 = 20 c2 and t2 = 10 t1.
The cache hit ratios for the three capacities are assumed to be 0.7, 0.9, and 0.98, respectively.
a) What is the average access time ta in terms of t1 = 20ns in the three cache designs?
(Note that t1 is the time from CPU to M1 and t2 is that from CPU to M2, not from M1 to
M2).
b) Express the average byte cost of the entire memory hierarchy if c2 = $0.2/Kbyte.
c) Compare the three memory designs and indicate the order of merit in terms of average
costs and average access times, respectively. Choose the optimal design based on the
product of average cost and average access time.
c ≈ (c1 s1 + c2 s2) / (s1 + s2) ≈ (20 c2 s1 + 4K c2) / (s1 + 4K) ≈ (20 x 0.2 s1 + 0.2 x 4K) / (s1
+ 4K) ≈ (4 s1 + 0.8K) / (s1 + 4K)
c) For the three design choices, the product of average access time and average cost is
19.24, 12.16, and 10.15, respectively. Therefore, the third option is the best choice.
2|Page