Consider a computer system with 4 GB memory and 1MB cache with 256-byte block (l
ID: 3821757 • Letter: C
Question
Consider a computer system with 4 GB memory and 1MB cache with 256-byte block (line) size. a) Find the size in bits of byte offset, line/set index, and tag in case of direct mapping, full-associative, 2-way set associative, and 4-way set associative. b) For the memory reference of address 0 times 87651234. Show the values (in Hexadecimal) of the byte offset, line/set index, and tag in each of the four cases above. c) Considering 2-way set associative mapping, complete the table below and explain the actions taken for the memory access sequence of operations given in the first column:Explanation / Answer
Given that Main memory = 4GB = 229 bytes.
Therefor physical address = 29 bytes.
cache memory = 1MB = 220
Block size = 256 bytes = 28
Therefore byte offset = 8
Therefore no.of lines = cachesize/blocksize
= 220 / 28
=212.
no. of lines = 12.
Direct mapping:
.............
In direct mapping , no. of lines = Index
Therefore index= 12
Then Tag = PHYSICAL ADDRESS-INDEX-BYTEOFF
= 32-12-8
= 12 bytes.
Tag
Index
Byteoff
12
12
8
2-way set associiative:
.........................
In 2-way set associative ,index = line size/2
= 212/2
= 211
Therefore index= 11
Then Tag = PHYSICAL ADDRESS-INDEX-BYTEOFF
= 32-11-8
= 13 bytes.
Tag
Index
Byteoff
13
11
8
4-way set associiative:
.........................
In 4-way set associative ,index = line size/4
= 212 / 22
= 210
Therefore index= 10
Then Tag = PHYSICAL ADDRESS-INDEX-BYTEOFF
= 32-10-8
= 14 bytes.
Tag
Index
Byteoff
14
10
8
Tag
Index
Byteoff
12
12
8
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.