Computer Architecture
Computer Architecture
WEEK 4
Memory:
Cache and Virtual memory
1 Introduction
1.1 Aims
• Understand principle of mapping in cache.
• Practice determining memory accessing time and performance.
2 Quiz
Answer below questions with detailed explanation.
2.1 Question 1
Given the main memory that has an address space of 32 bit, a cache with the size of 1 MB, 1 block is
256B, the accessing unit of the system is 1 byte. Determine the bit-width of tag, index, byte-offset with
below configurations:
a. Directed map.
b. 4-way set associative.
c. Full associative.
2.2 Question 2
Given the main memory that has the capacity of 256MB, a cache with the size of 256KB, 1 block is
64 words, the accessing unit of the system is 2 bytes. Determine the bit-width of tag, index, byte-offset
with below configurations:
a. Directed map.
b. 4-way set associative.
c. Full associative.
2.3 Question 3
A program accesses data in main memory with the sequence below (word address): 0,
4, 1, 5, 65, 46, 1, 70, 2, 0
Know that the system is 256B cache, 4-word block, 1-byte accessing unit. Hit time = 6 cycles, RAM
(main memory) access time = 10ns, the system works with the frequency of 2GHz.
Determine the number of HIT/MISS when executing the program, then calculate the AMAT (Average
memory access time) with the below configurations:
a. Directed map.
b. 2-way set associative.
c. Full associative.
2.4 Question 4
Given L1 cache hit time is 10 cycles, L2 cache hit time is 15 cycles, time to access RAM (main
memory) is 100 cycles. L1 miss rate is 25%, L2 miss rate is 5%. Determine AMAT of the system.
2.5 Question 5
Determine average CPI of a pipeline system that its Instruction memory miss rate is 5% and its Data
memory miss rate is 10%. Know that the program has 1000 instructions included 100 load/store
instructions and miss penalty is 100 cycles.