Question

Assume a memory model where you have a cache size of 4 blocks, a block size of 8, and addresses f...

Assume a memory model where you have a cache size of 4 blocks, a block size of 8, and addresses from 0 through 511. Assume that the n-way associative cache and fully associative cache use a LRU (least recently used) eviction strategy. Consider the following sequence of memory accesses: 17, 66, 22, 66, 80, 41, 85, 66, 17, 104.

  1. (a) Show the updates to a 2-way associative cache in a table using a similar format to the table shown on Slide 69 of Module 3. All of the values in the table should be decimal numbers (not bits). Since there are 10 accesses, there should be 10 rows of data in the table.

  2. (b) Show the updates to a fully associative cache in a table using a similar format to the table shown on Slide 70 of Module 3. All of the values in the table should be decimal numbers (not bits). Since there are 10 accesses, there should be 10 rows of data in the table.

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

As there is not format for answers is mentioned I have done the best I could it to make it easy to understand.

Columns Access1 to Access 10 shows the states of each block of the cache.

A GREEN colored cell denotes a new insertion of a block which did not need any replacement

A RED colored cell denotes accesses where a replacement(Or eviction of existing block needed)

2-Way Associative mapping

The cache has 4 blocks in total.

In 2 way mapping all the 4 blocks are divided into 2 sets;Set 0 and Set 1

There 4*8 32 blocks in cache in total. 5 bit are needed to address each block.

As there is only 2 sets only. Least significant 4 bits will be used for block offset and 5th bit will be used for deciding in which cache block should the incoming block should be placed.

For Eg. Block 17

Binary 17=10001 5th bit is 1 and it will be placed in Set 1

2-Way Set associative m 41 41 80 85 41 Set 0 17 1. 17 85 Set 1

Fully Associative Cache

In this any block can be placed anywhere in the cache.

Fully Associative Block 1 Block 2 Block 3 Block 4 17 17 17 17 .1 AS MS 85 80 17

Add a comment
Know the answer?
Add Answer to:
Assume a memory model where you have a cache size of 4 blocks, a block size of 8, and addresses f...
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
  • Assume you have: 32-bit addresses, 4KB Page size, 4MB Physical Memory Space, 4KB Cache with 4-way...

    Assume you have: 32-bit addresses, 4KB Page size, 4MB Physical Memory Space, 4KB Cache with 4-way set associative and LRU replacement, 32 Byte Cache block size, 4-entry fully associative TLB. A program to be run on this machine begins as follows:   double A[1024]; int i, j; double sum = 0; for( i = 0; i < 1024; i++ )       // first loop      A[i] = i; for( j = 0; j < 1024; j += 16 )   // second loop     ...

  • Assume a cache with 2048 blocks, a 4-word block size, and a 32-bit address. For each...

    Assume a cache with 2048 blocks, a 4-word block size, and a 32-bit address. For each of the following configurations, find the total number of bits for each cache block and the total numbers of bits for the entire cache. a. Direct-mapped b. Two-way set associative c. Four-way set associative d. Fully-associative

  • Using the sequences of 32-bit memory read references, given as word addresses in the following table:...

    Using the sequences of 32-bit memory read references, given as word addresses in the following table: 6 214 175 214 6 84 65 174 64 105 85 215 For each of these read accesses, identify the binary address, the tag, the index, and whether it experiences a hit or a miss, for each of the following cache configurations. Assume the cache is initially empty. A direct-mapped cache with 16 one-word blocks. A direct-mapped cache with two-word blocks and a total...

  • 1. A cache holds 64 words where each word is 4 bytes. Assume a 32 bit...

    1. A cache holds 64 words where each word is 4 bytes. Assume a 32 bit address. There are four different caches a. A direct-mapped cache with block size = 16 words b. 2-way set-associative cache with block size = 8 words c. 4-way set-associative cache with block size=4 words d. A fully associative cache with block size = 16 words. Complete the table for each cache. Cache a Cache be Cache Cache de 16 Number of bits needed for...

  • Suppose we have a byte-addressable computer with a cache that holds 8 blocks of 4 bytes...

    Suppose we have a byte-addressable computer with a cache that holds 8 blocks of 4 bytes each. Assuming that each memory address has 8 bits and cache is originally empty, for the cache mapping technique, two-way set associative, trace how cache is used when a program accesses the following series of addresses in order: 0x01, 0x04, 0x09, 0x05, 0x14, 0x21, and 0x01.

  • Cache of 4096 blocks, a 4-word block size, and a 32-bit address, find the total number...

    Cache of 4096 blocks, a 4-word block size, and a 32-bit address, find the total number of sets and the total number of tag bits for caches that are direct mapped, four-way set associative, and fully associative.

  • Assume the following about a computer with a cache: .. The memory is byte addressable. •...

    Assume the following about a computer with a cache: .. The memory is byte addressable. • Memory accesses are to 1-byte words (not to 4-byte words). .. Addresses are 8 bits wide. .. The cache is 2-way associative cache (E=2), with a 2-byte block size (B=2) and 4 sets (5=4). • The cache contents are as shown below (V="Valid"): Set #Way #0 Way #1 V=1;Tag=0x12; Data = v=1;Tag=0x10; Data = Ox39 0x00 0x26 Ox63 V=1;Tag=0x09; Data = v=1;Tag=0x11; Data =...

  • 6. (30) Consider a 64B direct-mapped cache with 16B blocks and 4 sets for an 8-bit architecture (...

    6. (30) Consider a 64B direct-mapped cache with 16B blocks and 4 sets for an 8-bit architecture (i.e., 256 bytes of memory): a. (5) Write a C function unsigned char getTag(unsigned char address) that returns the cache tag for the specified address using bitwise operators: b. (5) Write a C function unsigned char getSet(unsigned char address) that returns the cache set for the specified address using bitwise operators: c. (10) Considering the following sequence of memory addresses, which addresses will...

  • Assume a 16-way set associative cache that holds 4096 bytes, where each block is 16 bytes....

    Assume a 16-way set associative cache that holds 4096 bytes, where each block is 16 bytes. Assuming an address is 32 bits and that cache is initially empty complete the table below. (You should use hexadecimal numbers for all answers.) Address TAG Cache location (block) | Offset within block OxOFFOFABA 0x00000011 0xOFFFFFFE 0x23456719 OxCAFEBABE Which, if any of the addresses will cause a collision (forcing the block that was just brought in to be overwritten) if they are accessed one...

  • 4. Assume that we have a machine with the following memory specifications: Virtual addresses are 32...

    4. Assume that we have a machine with the following memory specifications: Virtual addresses are 32 bits wide Physical addresses are 26 bits wide . Page size is 16 Kbytes 4/A) How many pages are in the virtual memory space? 4/B) How many page frames are in the physical memory space? 4/C) If each page table entry consists of a physical frame number, 1 present/absent bit Answers Pages .Page Frames and 1 dirty/clean bit (which shows if the page has...

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