Question

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

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

a. In case of direct mapping, different blocks of main memory maps uniquely to one of the all blocks of cache memory with ith block of main memory maps to i%N block of cache where N is number of blocks in cache.

Since there are 2048 blocks, so total number of bits for each block = log2 2048 = 11 bits

And then since there are 4 words in a block, so number of bits to access a word = log2 4= 2 bits

So total number of bits for entire cache =, 11+2=13 bits

b. In Two-way set associative memory, 2 consecutive address block (with even and odd block pair like (0,1),(2,3)..) combined as single set. So 2048 blocks will make 2048/2=1024 sets.

And so the set in which ith block of cache is mapped to i%N set where N is number of sets.

Since there are 1024 sets, so number of bits to identify a set= log2 1024 = 10 bits

And then 2 bits required due to 4 words in a block.

So total bits for each cache =10+2= 12 bits

c. Four-way set associative cache will have total 2048/4=512 sets.

So number of bits to identify a set = log2 512 = 9 bits

Total bits for each cache = 9+2=11 bits

d. In fully associative memory entire block is treated as a single set so that any available cache can be assigned with any main memory block. So 0 bit is needed to identify any set and 2 bit is needed to identify the word out of 4 words in a block.

So total bits for cache =0+2= 2 bits

Please comment for any clarification.

Add a comment
Know the answer?
Add Answer to:
Assume a cache with 2048 blocks, a 4-word block size, and a 32-bit address. For each...
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
  • 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...

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

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

  • Text: Explain how a 32-bit byte memory address should be divided into Tag/Index/Offset fields for each...

    Text: Explain how a 32-bit byte memory address should be divided into Tag/Index/Offset fields for each of the cache configurations below. Note: 1KB = 210 bytes. You must explain how many bits to assign to each field and the ordering of the three fields. You get at most 50% of the credit if you give the length of each field without an explanation. 1) A fully associative cache with cache block size = 2 words and cache size = 512KB....

  • A 64-bit word computer employs a 128KB cache. The address bus in this system is 32-bits....

    A 64-bit word computer employs a 128KB cache. The address bus in this system is 32-bits. Determine the number of bits in each field of the memory address register (MAR) as seen by cache in the following organizations (show your calculations):  a. Fully associative mapping with line size of 1 word. b. Fully associative mapping with line size of 4 words c. Direct mapping with the line size of 1 word. d. Direct mapping with the line size of 8...

  • A direct- mapped cache holds 1024 (or 2^10) blocks where each block is 1 word. What...

    A direct- mapped cache holds 1024 (or 2^10) blocks where each block is 1 word. What is the actual size of one entry in the cache in bits? Assume the address is 32 bits. Include the valid bit and dirty bits in the calculation. 32 54 52 22

  • Assume there are three small caches, each consisting of four one-word blocks. One cache is fully...

    Assume there are three small caches, each consisting of four one-word blocks. One cache is fully associative, a second is two-way set-associative, and the third is direct mapped. Find the number of misses for each cache organization given the following sequence of block addresses: 2, 4, 2, 7, 0, and 8. Assume a LRU (least recently used) scheme is used to choose which block to replace.

  • question 2 and 3 2. Determine how many sets of cache blocks will be there for...

    question 2 and 3 2. Determine how many sets of cache blocks will be there for the following Cache memory size (in bytes) Direct Mapped Blocks Size (in bits) 32 64 218 2-way Set Associative Block Size (in bits) 32 64 A 2A6 [0.5 * 16 = 8] 4-way Set Associative Block Size (in bits) 32 64 SK 64K 256K 3. The physical memory address generated by a CPU is converted into cache memory addressing scheme using the following mapping...

  • Question 1 For each of the cache configurations listed below, show the decomposition of a 32 bit address to be used wit...

    Question 1 For each of the cache configurations listed below, show the decomposition of a 32 bit address to be used with it. (1 point) a. 1MB direct mapped cache with an 16-byte cache line (2 points) b. 2MB 8-way set associative cache with a 8-byte cache line (2 points) 4MB 32-way set associative cache with a 16-byte cache line (2 points) C. Question 1 For each of the cache configurations listed below, show the decomposition of a 32 bit...

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