Question

You have a 2-way set associative L1 cache that is 8KB, with 4-word cache lines. You get the following sequence of writes to t

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

Since 1 word = 4 byte. Hence size of cache line = 4*4 = 16 Bytes

Number of bits needed for line offset = log2 16 = 4 bits

Total number of cache lines = size of cache / size of line = 8KB/ (4*4) Byte = 512 lines

Since it's a 2-way set associative memory, hence number of sets = number of lines/2 = 512/2 = 256 sets

Hence number of bits needed for set number field = log2 256 = 8 bits

So out of 32 bits field, last 4 bit will be line offset, then 8 bits will be set number field and number of bits for tag = 32-8-4 = 20 bits

For example address 0x32E4 , last hexadecimal digit is 0x4, which is line offset, Set index will be 0x2E and remaining is tag field which is 0x00003.

Now given the sequence of address, since rightmoat 16 bits are given so we can append 16 zeroes to make them 32 bit address.

Here in above above memory request, hit occurs only on following addresses:-

0x8004

0x800C

0x72E8

So out of 11 request there are 3 hit and 8 miss.

So the table will be filled as:-

Memory address Tag Set Index Hit/miss Set...Way...
0x32E4 0x00003 0x2E miss Set 2E Way 0
0x8000 0x0008 0x00 miss Set 00 Way 0

b. 0x32E4 miss compulsory miss since set 2E accessed for first time

0x8000 miss compulsory miss since set 00 accessed for the first time

Please comment for any clarification.

Add a comment
Know the answer?
Add Answer to:
You have a 2-way set associative L1 cache that is 8KB, with 4-word cache lines. You get the follo...
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
  • A 2-way set associative cache consists of four sets 0, 1, 2, 3. The main memory...

    A 2-way set associative cache consists of four sets 0, 1, 2, 3. The main memory is word addressable (i.e. treat the memory as an array of words indexed by the address). It contains 2048 blocks 0 through 2047, and each block has eight words. (a) How many bits are needed to address the main memory? (b) Show how a main memory address will be translated into a tag, a set number, and an offset within a block. Illustrate this...

  • Assume the cache can hold 64 kB. Data are transferred between main memory and the cache...

    Assume the cache can hold 64 kB. Data are transferred between main memory and the cache in blocks of 4 bytes each. This means that the cache is organized as 16K=2^14 lines of 4 bytes each. The main memory consists of 16 MB, with each byte directly addressable by a 24-bit address (2^24 =16M). Thus, for mapping purposes, we can consider main memory to consist of 4M blocks of 4 bytes each. Please show illustrations too for all work. Part...

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

  • 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

  • Base machine has a 2.4GHz clock rate. There is L1 and L2 cache. L1 cache is...

    Base machine has a 2.4GHz clock rate. There is L1 and L2 cache. L1 cache is 256K, direct mapped write through. 90% (read) hit rate without penalty, miss penalty is 4 cycles. (cost of reading L2) All writes take 1 cycle. L2 cache is 2MB, 4 way set associative write back. 95% hit rate, 60 cycle miss penalty (cost of reading memory). 30% of all instructions are reads, 10% writes. All instructions take 1 cycle - except reads which take...

  • Computer architecture How many SRAM bits are needed to implement an 8KB two-way set associative cache...

    Computer architecture How many SRAM bits are needed to implement an 8KB two-way set associative cache with 64B block size? Assume that each line (entry) has a single valid bit and no dirty bits. There is one bit per set for true LRU. Assume that the address size of the machine is 32-bits and that the machine allows for byte addressing.

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

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

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

  • 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