ith the following parameters: Assu b: block size given number of words S: number
ID: 3704960 • Letter: I
Question
ith the following parameters: Assu b: block size given number of words S: number of sets N: number of ways A: number of address bits word: 4 bytes A 16-word cache has the parameters given 2 above. Assume that a program running on this computer executes the followin 0x74 OxAO 0x78 0x38C OxAC 0x84 0x88 0x8C 0x7C 0x34 0x38 0x13C 0x388 Ox18C Assuming least recently used (LRU) replacement strategy for associative caches, show the placement of the instruction addresses in cache for each of the following cache design 3.A.) A direct mapped cache with b-1 word 3.B.) A fully associative cache with b-2 words 3.?.) A two-way set associative cache with b-2 words 3.D.) A direct mapped cache with b-4 words me a cache w g sequence of lw addresses in the exact sequence given:Explanation / Answer
Solution:
3. A)
Block 0
0xA0
Block 1
Block 2
Block 3
Block 4
(0x74)=> (0x84)=> 0x34
Block 5
Block 6
Block 7
Block 8
(0x78)=> (0x88)=>(0x38)=>0x388
Block 9
Block 10
Block 11
Block 12
(0x38C)=> (0xAC)=>(0x8C)=>(0x7C)=>(0x13C)=>0x18C
Block 13
Block 14
Block 15
3. B)
In fully set associate the words can go to anywhere in the cache.
The entire cache will act as a single set.
The mapping can be generated as given below.
The replacement will happen only id entire cache will full.
Block 0
0x74
Block 1
0xA0
Block 2
0x78
Block 3
0x38C
Block 4
0xAC
Block 5
0x84
Block 6
0x88
Block 7
0x8C
Block 8
0x7C
Block 9
0x34
Block 10
0x38
Block 11
0x13C
Block 12
0x388
Block 13
0x18C
Block 14
Block 15
3. C)
Here the last 8 bits of the address will be taken and it will be mapped to either of the sets based on the first 3 bits among this.
Since 16 words cache, there will be 8 sets.
Set 0
0x34=>0x13C
1
0x38
Set 1
1
Set 2
1
Set 3
0x74=>0x7C
1
0x74
Set 4
0x38C=>0x18C
1
0x388
Set 5
0xA0
1
0xAC
Set 6
0x88
1
0x8C
Set 7
1
3. D)
The directed mapped cache with block size 4 words can be populated as given below.
Block 0
0x74=>0x88
0xA0=>0x34
0x78=>0x38
0x84=>0x388
Block 1
Block 2
0x38C=>0x13C
0xAC=>0x18C
0x8C
0x7C
Block 3
Block 0
0xA0
Block 1
Block 2
Block 3
Block 4
(0x74)=> (0x84)=> 0x34
Block 5
Block 6
Block 7
Block 8
(0x78)=> (0x88)=>(0x38)=>0x388
Block 9
Block 10
Block 11
Block 12
(0x38C)=> (0xAC)=>(0x8C)=>(0x7C)=>(0x13C)=>0x18C
Block 13
Block 14
Block 15
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.