Question

Make an assumption that your cache is either: Fully associative Direct mapped Two-way set-associative Four-way set-associative...

Make an assumption that your cache is either:

  • Fully associative
  • Direct mapped
  • Two-way set-associative
  • Four-way set-associative

determine:

the size of the Tag and Word for Associative cache;

OR

the size of the Tag, Line, and Word for Direct-Mapped Cache ;

Or

the size of Tag, Set, and Word for K-Way Set-Associative Cache.

You may make any assumptions necessary including the number of Words in each block (recommend 2 or 4 or 8)

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

Answer:

I am assuming K-Way Set-Associative Cache.

A cache in the primary storage hierarchy contains cache lines that are grouped into sets. If each set contains k lines then we say that the cache is k-way associative.

A data request has an address specifying the location of the requested data. Each cache-line sized chunk of data from the lower level can only be placed into one set. The set that it can be placed into depends on its address.

This mapping between addresses and sets must have an easy, fast implementation. The fastest implementation involves using just a portion of the address to select the set. When this is done, a request address is broken up into three parts:

  • An offset part identifies a particular location within a cache line.
  • A set part identifies the set that contains the requested data.
  • A tag part must be saved in each cache line along with its data to distinguish different addresses that could be placed in the set.

Example:

A computer uses 32-bit byte addressing. The computer uses a 2-way associative cache with a capacity of 32KB. Each cache block contains 16 bytes. Calculate the number of bits in the TAG, SET, and OFFSET fields of a main memory address.

Answer

Since there are 16 bytes in a cache block, the OFFSET field must contain 4 bits (24 = 16). To determine the number of bits in the SET field, we need to determine the number of sets. Each set contains 2 cache blocks (2-way associative) so a set contains 32 bytes. There are 32KB bytes in the entire cache, so there are 32KB/32B = 1K sets. Thus the set field contains 10 bits (210 = 1K).

Finally, the TAG field contains the remaining 18 bits (32 - 4 - 10). Thus a main memory address is decomposed as shown below:

Tag = 18 Set = 10 Offset = 4

Please give thumbsup, if you like it. Thanks.

Add a comment
Know the answer?
Add Answer to:
Make an assumption that your cache is either: Fully associative Direct mapped Two-way set-associative Four-way set-associative...
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
  • Find a wrong description about associative cache. 1-way set associative cache is identical to the direct...

    Find a wrong description about associative cache. 1-way set associative cache is identical to the direct mapped cache Each cache block contains one valid bit and one tag regardless of the number of data blocks Fully associative cache requires all entries to be searched at once Associative cache can decrease miss rate compared to direct mapped cache

  • Cache question computer architecture A cache holds 128 words where each word is 4 bytes. Assuming...

    Cache question computer architecture A cache holds 128 words where each word is 4 bytes. Assuming a 32-bit address, for each of the following organizations, complete the table. a.A direct-mapped cache with block size = 16words b.2-way set-associative cache with block size = 8words c.4-way set-associative cache with block size = 4words d.A fully associative cache with block size = 2words. Cache a Cache b Cache c Cache d total # bits for word & byte displacement # bits in...

  • Consider a 32-bit microprocessor that has on-chip 16Kbyte four-way set associative cache. Assume that cache has...

    Consider a 32-bit microprocessor that has on-chip 16Kbyte four-way set associative cache. Assume that cache has a line size of four 32-bit words. How many number of set are there? Sketch block diagram of this cache showing its organization. Where in the cache is the word from memory location ABCDE7F4.

  • 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.

  • 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...

  • Part I Consider a computer that you have used or now use. (You may make an...

    Part I Consider a computer that you have used or now use. (You may make an assumption on word size if needed.) How large is the memory of the computer? How long is a word in the computer above? How many bits are required to address the bytes in that memory? How many data lines are required to read data from the computer memory? Part II Does your computer have cache? If so how big is it? How does your...

  • Q2. Consider a four-way set associative cache with a data size of 64 KB. The CPU...

    Q2. Consider a four-way set associative cache with a data size of 64 KB. The CPU generates a 32-bit byte addressable memory address. Each memory word contains 4 bytes. The block size is 16 bytes. Show the logical partitioning of the memory address into byte offset, cache index, and tag components.

  • 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

  • Suppose a computer using set associative cache has 216 words of main memory and a cache...

    Suppose a computer using set associative cache has 216 words of main memory and a cache of 32 blocks, and each cache block contains 8 words. 3. If this cache is 2-way set associative, what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, set, and word fields? If this cache is 4-way set associative, what is the format of a memory address as seen by the cache?...

  • Suppose a computer has 216 words of main memory, and a cache of 64 blocks, where...

    Suppose a computer has 216 words of main memory, and a cache of 64 blocks, where each cache block contains 32 words. Please explain step by step. a) If this cache is a direct-mapped cache, what is the format of a memory address as seen by the cache, i.e., what are the sizes of the tag and word fields? b) To which cache block will the memory reference F8C9 map?   c) If this cache is fully associative, what is 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