KT14203- Computer Architecture and Organization
Sekolah Kejuruteraan dan Teknologi Maklumat
Keakitekturan Komputer
Semester 2 2013/2014
Quiz #2
Marked question (11 marks)
1. A two-way set-associative cache has a number of lines of 16 bytes each
and a total size of 8 Kbytes. The 64-Mbyte main memory is byte
addressable.
a. Show the format of main memory addresses.
Answer:
There are a total of 8 kbytes/16 bytes = 512 lines [1] in the cache.
Thus the cache consists of 256 sets [1] of 2 lines each.
Therefore 8 bits [1] are needed to identify the set number.
For the 64-Mbyte main memory, a 26-bit address is needed. Main memory
consists of 64-Mbyte/16 bytes = 222 blocks [1].
Therefore, the set plus tag lengths must be 22 bits, so the tag length is 14
bits [1] and the word field length is 4 bits (16 bytes = 24) [2].
TAG SET WORD
Main memory address = 14 8 4
b. For a hexadecimal memory address of 2FE8907, show the Tag, Set
and Word values using the address format identified in (a).
Answer:
Binary of 2FE8907 = 10 1111 1110 1000 1001 0000 0111 [1]
Tag = 10111111101000 = 2FE8 [1]
Set = 10010000 = 90 [1]
Word = 0111 = 7 [1]