Question

Consider the following 2-way set associative cache with 24 blocks 8-bits addresses, using the Least Recently used Scheme: Blo

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

here tag bits=5 (Most significant 5 bits)

Set index = 3bits( Least significant 3 bits)

1) 10110000 => Tag =10110 , Set =000 2 = 010.

Block valid LRU Tag Data
000 T T 10110 data@10110000
000 F
001 F
001 F
010 T T 01101 data @ 10110010
010 T F 10110 data @ 1011010
011 F
011 F
100 F
100 F
101 T T 01101 data @01101101
101 F
110 F
110 F
111 T F 00101 data @ 00101111
111 T T 10110 data@ 10110111

2) 00101111 => Tag =00101, set =111 =710 . This is a hit. Its LRU bit will be set to True since it is the recent referred one.

Block valid LRU Tag Data
000 T T 10110 data@10110000
000 F
001 F
001 F
010 T T 01101 data @ 10110010
010 T F 10110 data @ 1011010
011 F
011 F
100 F
100 F
101 T T 01101 data @01101101
101 F
110 F
110 F
111 T T 00101 data @ 00101111
111 T F 10110 data@ 10110111

3) 00110101 => Tag = 00110 , set = 101 = 510.  This a miss. Move the data in block.

Block valid LRU Tag Data
000 T T 10110 data@10110000
000 F
001 F
001 F
010 T T 01101 data @ 10110010
010 T F 10110 data @ 1011010
011 F
011 F
100 F
100 F
101 T F 01101 data @01101101
101 F T 00110 data @ 00110101
110 F
110 F
111 T T 00101 data @ 00101111
111 T F 10110 data@ 10110111

4) 00110010 => Tag = 00110, set =010=2. This is a miss. Replace the block in set 2 whose LRU bit is False.

Block valid LRU Tag Data
000 T T 10110 data@10110000
000 F
001 F
001 F
010 T F 01101 data @ 10110010
010 T T 00110 data @ 00110010
011 F
011 F
100 F
100 F
101 T F 01101 data @01101101
101 F T 00110 data @ 00110101
110 F
110 F
111 T T 00101 data @ 00101111
111 T F 10110 data@ 10110111

5) 01101010 => tag =01101, set =010 =2. This is a hit, so no changes in cache. Just change of LRU bits.

therefore the final cache is :

Block valid LRU Tag Data
000 T T 10110 data@10110000
000 F
001 F
001 F
010 T T 01101 data @ 10110010
010 T F 00110 data @ 00110010
011 F
011 F
100 F
100 F
101 T F 01101 data @01101101
101 F T 00110 data @ 00110101
110 F
110 F
111 T T 00101 data @ 00101111
111 T F 10110 data@ 10110111

If you have any questions, comment down .Also please upvote thanks.

Add a comment
Know the answer?
Add Answer to:
Consider the following 2-way set associative cache with 24 blocks 8-bits addresses, using the Least Recently...
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
  • Consider a 2-way set associative cache consisting of 8 blocks total of byte-addressable memory with 4...

    Consider a 2-way set associative cache consisting of 8 blocks total of byte-addressable memory with 4 bytes per block. Assume that the cache is initially empty. Given the following address sequence, fill in the table below. Time Access Tag Set Offset 3 10010001 11001001 10110110 10101011 10110010

  • ) Consider an 8-way associative 64 Kilo Byte cache with 32 byte cache lines. Assume memory...

    ) Consider an 8-way associative 64 Kilo Byte cache with 32 byte cache lines. Assume memory addresses are 32 bits long. a). Show how a 32-bit address is used to access the cache (show how many bits for Tag, Index and Byte offset). b). Calculate the total number of bits needed for this cache including tag bits, valid bits and data c). Translate the following addresses (in hex) to cache set number, byte number and tag (i) B2FE3053hex (ii) FFFFA04Ehex...

  • 32 bytes of memory. 16 bytes of 2-way set-associative cache, where blocks can go anywhere within...

    32 bytes of memory. 16 bytes of 2-way set-associative cache, where blocks can go anywhere within the set. Block is 2 bytes, set in cache is two blocks. Populate memory starting with upper-case letters, then 0-5. Hint- with full associativity in the set: each block has its own set of Tag bits in the cache. Memory is not organized by sets, though blocks get assigned to sets, and load in the cache per set.
1) Break down the addressing: Tag...

  • Suppose we have a 32-bit MIPS processor, which includes a 2-way set associative data cache with...

    Suppose we have a 32-bit MIPS processor, which includes a 2-way set associative data cache with capacity 16384 bytes, 16 bytes block, and a least recently used (LRU) replacement policy. Assume that the cache is empty (all valid bits are 0) before the following code is executed. lw $t1, 0x1040($0) lw $t2, 0x2044($0) lw $t3, 0x3048($0) lw $t4, 0x1044($0) lw $t5, 0x504c($0) lw $t6, 0x3040($0) For each of the six assembly instructions above, state i) the set field value for...

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