Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Your machine has an L1 cache and memory with the following properties Memory add

ID: 3835013 • Letter: Y

Question

Your machine has an L1 cache and memory with the following properties Memory address space 24 bits Cache block size 16 bytes Cache associativity: direct-mapped Caches size 256 bytes 1. (2 points) Identify the number of tag bits. Show calculation for your answer. 2. (2 points) Identify the number of bits for the cache index. 3. (2 points) Identify the number of bits for the cache size. 4. (15 points) Consider the memory address trace (similar to PA3) and indicate which access is a hit and miss. show work. Memory address HTTIMISS Why is it a hit/miss? 0x000010 0x000014 0x000018 0x 00001 C 0x001010 0x110020 0x110010 0x110014 110024 0x001120

Explanation / Answer

Address width: 24bits
Block size: 16 bytes
cache size: 256bytes

Since each block has 16bytes, block offset is 4 bits (answer 3)

To calculate the width of index field, we need to calculate the number of blocks in the cache
so, # of blocks: 256/16 = 16 blocks.
So width of index field is 4bits (answer 2)

So width of tag field is (24 – 8 – 8)bits or 16 bits (answer 1)

4.

Address(0x)

Tag(0x)

Index(0x)

Hit/Miss

Why hit/miss

000010

0000

1

Miss

Cache empty

000014

0000

1

Hit

Spatial locality

000018

0000

1

Hit

Spatial locality

00001C

0000

1

Hit

Spatial locality

001010

0010

1

Miss

Index occupied

110020

1100

2

Miss

Index empty

110010

1100

1

Miss

Index occupied

110014

1100

1

Hit

Spatial locality

110024

1100

2

Hit

Temporal locality

001120

0011

2

Miss

Index occupied


Answer of question 5 and 6 included above.

Address(0x)

Tag(0x)

Index(0x)

Hit/Miss

Why hit/miss

000010

0000

1

Miss

Cache empty

000014

0000

1

Hit

Spatial locality

000018

0000

1

Hit

Spatial locality

00001C

0000

1

Hit

Spatial locality

001010

0010

1

Miss

Index occupied

110020

1100

2

Miss

Index empty

110010

1100

1

Miss

Index occupied

110014

1100

1

Hit

Spatial locality

110024

1100

2

Hit

Temporal locality

001120

0011

2

Miss

Index occupied