Question

Cache Layout: A processor has a separate D-cache and an I-cache. D-cache: 64KB, 4-way set associative,...

Cache Layout: A processor has a separate D-cache and an I-cache.

D-cache: 64KB, 4-way set associative, block size of 1 word, write-back policy

I-cache: 32KB, direct mapped cache, block size of 1 word The processor uses the LRU algorithm for its replacement policy.

Answer the following questions. Make sure that you account for all the book -keeping bits.

A word is 4 bytes

(a) Calculate the number of tag, index and offset bits for the D-cache.

(b) Calculate the number of tag, index and offset bits for the I-cache.

(c) How many bits are needed to implement the D-cache?

(d) How many bits are needed to implement the I-cache?

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

Assuming the processor is 32 bit i.e. address size is 32 bit.

a. In D-cache, 1 word = 4 byte.

Number of blocks = D-cache size/ block size = 64KB / 4 byte = 16K blocks

Since it is 4-way set associative, therefore number of sets = Number of blocks/4 = 16K/4 = 4K sets

Since the block size is 1 word and since memory is word-addressable with 1 word = 4 byte

So, offset bits = log2 ( Number of words in a block) = log2 1 = 0 bit

So no bit will be used for offset since every block has single word.

Index bits = log2 ( Number of sets) = log2 (4K) = log2 (4*210) = 12 bits

Number of tag bits = 32 - Index bits = 32 - 12 = 20 bits

b. Number of blocks = (size of cache)/block size = 32 KB/ 4 Byte = 8K

Since size of block = 1 word, hence there will be 0 bit for offset

Number of bits in index field in direct mapped cache = log2 ( Number of blocks) = log2 8K = log2 (8*210) = 13 bits

Number of bits in Tag = 32 - 13 = 19 bits

c. Since D-cache used write-back policy, so it will use 1 bit as dirty bit for every cache block to indicate whether a particular block has been modified or flushed into main memory.

Number of bits needed to implement D-cache = (Number of blocks)*(Number of bits in Tag field + 1 bit due to dirty bit)

= 16K * (20 + 1) bits = 21*214 bits

d. Since I-cache do not need dirty bit

So, Number of bits needed to implement I-cache = Number of blocks * Number of bits in tag field = 8K * 19 bits = 19*213 bits

Please comment for any clarification.

Add a comment
Know the answer?
Add Answer to:
Cache Layout: A processor has a separate D-cache and an I-cache. D-cache: 64KB, 4-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
  • Given a 32-bit address, calculate the following values for a two-way set associative for: Cache size:...

    Given a 32-bit address, calculate the following values for a two-way set associative for: Cache size: 32KB Block size: 64B i) The number of bits in the block offset field. ii) The number of index bits. iii) The number of sets in the cache. iv) The number of tag bits.

  • A direct-mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that...

    A direct-mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that the block size is 32-byte and the address is 32-bit, find the number of bits needed for tag, index, and byte select fields of the address. Number of bits for offset bits Number of bits for index bits Number of bits for tag bits

  • A 256kiB (2^18 bytes) cache has a block size of 32 bytes and is 32-way set-associative....

    A 256kiB (2^18 bytes) cache has a block size of 32 bytes and is 32-way set-associative. How many bits of a 32-bit address will be in the Tag, Index, and Bock Offset?

  • Question 17 12 points A direct mapped cache holds 64KB of useful data (not including tag...

    Question 17 12 points A direct mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that the block size is 32-byte and the address is 32-bit, find the number of bits needed for us inder, and by selection of the address. Number of bits for offset bits Number of bits for index bis Number of bits for tag 170188

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

  • 12 points A direct mapped cache holds 64KB of useful data (not including tag or control...

    12 points A direct mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that the block streis 32-byte and the address is 32-bit, find the number of bits needed for tag index and byte select fields of the address Number of bits for offset bits Number of bits for index bits Number of bits for tag Moving to another question will save this response. Question 17 of 18

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

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

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

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

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