Question

Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of memory address refere

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given,

Size of block = 2 words

Number of bits in cache offset = log ( block size ) = log 2 = 1 bit

Cache size = 8 words

Number of lines = Cache size / block size = 8 / 2 = 4

Number of bits in the index = log 4 = 2 bits

Let the address be expressed in terms of 8 bits

Then,

tag bits = Address bits - ( Offset bits + Index bits ) = 8 - ( 1 + 2 ) = 5 bits

1.

The first address in decimal is 1.

The binary address is 00000001.

Tag = 00000

Index = 00

Offset = 1

It is a miss as this address is accessed for the first time.

The cache is :

Index Tag Memory Address mapped
00 00000 M[1]
01
10
11

2.

The next address is 4.

The binary address is 00000100.

Tag = 00000

Index = 10

Offset = 0.

It is a miss as this address is accessed for the first time.

Index Tag Memory Address mapped
00 00000 M[1]
01
10 00000 M[4]
11

3.

The next address is 8.

The binary address is 00001000.

Tag = 00001

Index = 00

Offset = 0.

This is a conflict miss as the tag does not match with the tag at index 0.

Index Tag Memory Address mapped
00 00001 M[8]
01
10 00000 M[4]
11

4.

The next address is 5.

The binary address is 00000101.

Tag = 00000

Index = 10

Offset = 1.

This is a hit as the tag matches with the tag in index 10.

Index Tag Memory Address mapped
00 00001 M[8]
01
10 00000 M[5]
11

5.

The next address is 20.

The binary address is 00010100.

Tag = 00010

Index = 10

Offset = 0.

This is a miss as the tag does not match with the tag in index 10.

Index Tag Memory Address mapped
00 00001 M[8]
01
10 00010 M[20]
11

6.

The next address is 17.

The binary address is 00010001.

Tag = 00010

Index = 00

Offset = 1.

This is a conflict miss.

Index Tag Memory Address mapped
00 00010 M[17]
01
10 00010 M[20]
11

7.

The next address is 4.

The binary address is 00000100.

Tag = 00000

Index = 10

Offset = 0.

This is a miss as the tag does not match with the tag in index 10.

Index Tag Memory Address mapped
00 00010 M[17]
01
10 00000 M[4]
11

8.

The next address is 56.

The binary address is 00111000.

Tag = 00111

Index = 00

Offset = 0.

This is a miss as the tag does not match with the tag in index 00.

Index Tag Memory Address mapped
00 00111 M[56]
01
10 00000 M[4]
11

9.

The next address is 9.

The binary address is 00001001.

Tag = 00001

Index = 00

Offset = 1.

This is a miss as the tag does not match with the tag in index 00.

Index Tag Memory Address mapped
00 00001 M[9]
01
10 00000 M[4]
11

10.

The next address is 10.

The binary address is 00001010.

Tag = 00001

Index = 01

Offset = 0.

This is compulsory miss.

Index Tag Memory Address mapped
00 00001 M[9]
01 00001 M[10]
10 00000 M[4]
11

11.

The next address is 43.

The binary address is 00101011.

Tag = 00101

Index = 01

Offset = 1.

This is a miss as the tag does not match with the tag in index 01.

Index Tag Memory Address mapped
00 00001 M[9]
01 00101 M[43]
10 00000 M[4]
11

12.

The next address is 5.

The binary address is 00000101.

Tag = 00000

Index = 10

Offset = 1.

This is a hit as the tag matches with the tag in index 10.

Index Tag Memory Address mapped
00 00001 M[9]
01 00101 M[43]
10 00000 M[5]
11

13.

The next address is 6.

The binary address is 00000110.

Tag = 00000

Index = 11

Offset = 0.

This is a compulsory miss.

Index Tag Memory Address mapped
00 00001 M[9]
01 00101 M[43]
10 00000 M[5]
11 00000 M[6]

14.

The next address is 9.

The binary address is 00001001.

Tag = 00001

Index = 00

Offset = 1.

This is a hit as the tag matches with the tag in index 00.

Index Tag Memory Address mapped
00 00001 M[9]
01 00101 M[43]
10 00000 M[5]
11 00000 M[6]

15.

The next address is 17.

The binary address is 00010001.

Tag = 00010

Index = 00

Offset = 1.

This is a miss as the tag does not match with the tag in index 00.

Index Tag Memory Address mapped
00 00010 M[17]
01 00101 M[43]
10 00000 M[5]
11 00000 M[6]

Hence, the final table is :

Decimal address Binary address Tag Index Offset Miss or Hit
1 00000001 00000 00 1 Miss
4 00000100 00000 10 0 Miss
8 00001000 00001 00 0 Miss
5 00000101 00000 10 1 Hit
20 00010100 00010 10 0 Miss
17 00010001 00010 00 1 Miss
4 00000100 00000 10 0 Miss
56 00111000 00111 00 0 Miss
9 00001001 00001 00 1 Miss
10 00001010 00001 01 0 Miss
43 00101011 00101 01 1 Miss
5 00000101 00000 10 1 Hit
6 00000110 00000 11 0 Miss
9 00001001 00001 00 1 Hit
17 00010001 00010 00 1 Miss
Add a comment
Know the answer?
Add Answer to:
Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of...

    Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253 For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with two-word blocks and a total size of 8 blocks. Also list if each reference is a hit or a miss, assuming the cache is initially...

  • 5.2 Caches are important to providing a high-performance memory hierarchy to processors. Below is a list...

    5.2 Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253 5.2.6 The formula shown in Section 5.3 shows the typical method to index a direct-mapped cache, specifically (Block address) modulo (Number of blocks in the cache). Assuming a 32-bit address and 1024 blocks in the cache, consider a diff erent

  • If I have a problem set like so: Below is a list of 64-bit memory address...

    If I have a problem set like so: Below is a list of 64-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253 5.2.1 BLOCK SIZE: 1 word CACHE SIZE: 16 1-word blocks a) For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 16 one-word blocks. Also list if each reference is a hit or a miss, assuming the cache...

  • ui May 17, 2018 Question 2. (30 points) Caches are important to a list of 32-bit...

    ui May 17, 2018 Question 2. (30 points) Caches are important to a list of 32-bit memory address references in Below is providing high performance memory hierarchy to processors. decimal, given as byte addresses 3, 180, 43, 2, 191, 88, 190, 14, 181, 4 44, 186 . 253 You are asked to optimize a cache design for the g mapped cache designs possible, all wit iven references. There are three direct- h a total of 8 words of data: C1...

  • Please help with this Below is a list of 32-bit (1 word) memory address references a...

    Please help with this Below is a list of 32-bit (1 word) memory address references a program makes, given as word addresses (not byte addresses): 2, 4, 5, 4, 6, 4, 12, 13, 2, 13, 4, 253 For each of these references, identify the tag and index, given a 16 word, direct-mapped cache which has 8 two-word blocks. Also, list if each reference is a hit or a miss, assuming the cache is initially empty. Your answer should be a...

  • Question 3: Consider a 32-bit physical address memory system with block size 16 bytes and a...

    Question 3: Consider a 32-bit physical address memory system with block size 16 bytes and a 32 blocks direct mapped cache. The cache is initially empty. The following decimal memory addresses are referenced 1020, 1006, 1022, 5106, 994, and 2019 Map the addresses to cache blocks and indicate whether hit or miss. Note: You must use the hexadecimal approach in solving this question. You must also show the computations of dividing the memory address into tag bits, cache index bits,...

  • use the following list of 32 bit memory address references, given as word addresses. Note that...

    use the following list of 32 bit memory address references, given as word addresses. Note that you will need to convert them to binary: 3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253 4. Assume a direct-mapped cache with 16 one-word blocks. For each reference, list the binary address, the tag, the index, and if the reference is a hit or a miss, assuming the cache is initially empty.

  • 3. 12+2-4 points] We are comparing the two caches in Problem 1 and Problem 2. Suppose both caphes have a hit time of 2 cycles. The cache in Problem 1 has a miss penalty of 15 cycles. The o...

    3. 12+2-4 points] We are comparing the two caches in Problem 1 and Problem 2. Suppose both caphes have a hit time of 2 cycles. The cache in Problem 1 has a miss penalty of 15 cycles. The one in Problem 2 has a miss penalty of 25 cycles. Calculate the total time taken (in cycles) for all accesses, for each cache. Which cache is better- the one in Problem 1 or Problem 2? 3. 12+2-4 points] We are comparing...

  • Question 6 For the following figure shows a hypothetical memory hierarchy going from a virtual address to L2 cache acce...

    Question 6 For the following figure shows a hypothetical memory hierarchy going from a virtual address to L2 cache access. The page size is 8KB, the TLB is direct mapped with 128 entries. The L1 cache is a direct mapped 8 KB, and the L2 cache is 2MB and direct mapped. Both use 64 byte blocks. The virtual address is 64 bits and the physical address is 41 bits. For each block in the figure below, fill in the number...

  • 2. A computer uses a memory with addresses of 8 bits. (What's the size of the...

    2. A computer uses a memory with addresses of 8 bits. (What's the size of the MM?) This computer has a 16-byte cache with 4 bytes per block. (How many blocks in the cache?) The computer accesses a number of memory locations throughout the course of running a program. Suppose this computer uses direct-mapped cache. a. What's the format of a memory address as seen by the cache ? Tag ? bits Block ? bits Offset ? bits b. The...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT