Tutorial 8 Answers
Tutorial 8 Answers
Tutorial 8
From Lecture 8 (Memory – Part2)
2. A given computer is running a program which requires 128K of instructions and 512K of data.
The computer has 256K of primary memory and a 4K cache. Memory access time is 80 ns. If
the desired word is in cache, the access time is 15 ns. The hit ratio for this program is 0.9.
What is the effective access time?
The effective access time = 0.9 x 15 + 0.1 x 80 = 13.5 + 8 = 21.5 nanoseconds
4. Assume a cache of 32 Kbytes organized as 4 K lines of 8 bytes each. The main memory is 64
MB organized logically as 8 M blocks of 8 bytes each.
a. Determine how to split the address (s-r, r, w) for direct mapping.
b. Determine how to split the address (s, w) for associative mapping.
c. Determine how to split the address (s-d, d, w) for set associative mapping. Assume
each cache set is 4 lines of cache.
Data given:
* Memory size=64 MB * Cache size= 32KB
* Block size = line size = 8 bytes. * Number of cache lines = 4K lines.
* Number of memory blocks = 8M blocks
a. Direct mapping:
Block size = 8 = 23 = 2w w=3.
Number of lines = 4K = 22x210 = 212 = 2r r=12
Memory size = 64MB = 26x220 = 226 = 2n memory address bits n= 26
s = n-w = 26-3 = 23
s-r = 23 – 12 = 11
Tag (s-r) Line (r) Word (w)
11 12 3
b. Associative mapping:
Block size = 8 = 23 = 2w w=3.
s = n-w = 26 -3 = 23
Tag (s) Word (w)
23 3
Page 1
ITDR2102: Computer Organization – Tutorial Answers
d. Determine how to split the address (s-d, d, w) for set associative mapping. Assume
each cache set is 2 lines of cache.
Page 2