Question

3. (12 points) Consider a cache has lines of 16 bytes and a total size of 16 kB. The main memory is 16MB and a word takes 4 b

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

Line size = 16 bytes = 24 bytes

Cache size = 16 KB = 24*210 bytes = 214 bytes

Main memory size = 16 MB = 24*220 bytes = 224 bytes

So, the address size is of 24 bits.

I'm assuming that the memory is byte addressable.

a) ASSOCIATIVE:

As line size is 24 bytes so, line offset is of 4 bits.

Remaining bits = 24-4 = 20 bits.

Therefore, TAG is of 20 bits.

TAG(20 bits) OFFSET(4 bits)

Address = FFF666 = 11111111111101100110 0110

Therefore TAG = 11111111111101100110 (in binary) = FFF66(in hex)

WORD = 0110 ( in binary) = 6(in hex)

b) SET ASSOCIATIVE:

As line size is 24 bytes so, line offset is of 4 bits.

Number of cache lines = Cache size/ line size = 214 bytes/24 bytes = 210

Number of sets = number of cache lines / associativity = 210 / 2 = 29 [ as 2 way set associative ]

Therefore Set Index is of 9 bits.

Remaining bits = 24-4-9 = 11 bits.

Therefore, TAG is of 11 bits.

TAG(11 bit) SET(9 bit) OFFSET(4 bit)

Address = FFF666 = 11111111111 101100110 0110

Therefore TAG = 11111111111 (in binary) = 7FF(in hex)

SET = 101100110 = 166(in hex)

WORD = 0110 ( in binary) = 6(in hex)

Add a comment
Know the answer?
Add Answer to:
3. (12 points) Consider a cache has lines of 16 bytes and a total size of...
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 four-way set-associative cache has lines of 32 bytes and a total size of 4 kB....

    A four-way set-associative cache has lines of 32 bytes and a total size of 4 kB. The 32-MB main memory is byte addressable. Show the format of main memory addresses.

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

  • cache memory related question

    A two-way set-associative cache has lines of 4 bytes and a total size of 4 kB. The 32-MB main memory is byte addressable. Show the format of main memory addresses.

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

  • Problem 6. Suppose we have a computer with 32 megabytes of main memory, 256 bytes of...

    Problem 6. Suppose we have a computer with 32 megabytes of main memory, 256 bytes of cache, and a block size of 16 bytes. For each configuration below, determine the memory address format, indicating the number of bits needed for each appropriate field (i.e. tag, block, set, offset). Show any relevant calculations. Direct cache mapping and memory is byte-addressable a) Direct cache mapping and memory is word-addressable with a word size of 16 bits b) c) 2-way set associative cache...

  • A computer with a 24‐bit address bus has a main memory of size 16 MB and...

    A computer with a 24‐bit address bus has a main memory of size 16 MB and a cache size of 64 KB. The word length is two bytes. a. What is the address format for a direct mapped cache with a line size of 32 words? b. What is the address format for a fully associative cache with a line size of 32 words? c. What is the address format for a 4‐way set associative cache with a line size...

  • Example 4.2 For all three cases, the example includes the following elements: The cache can hold...

    Example 4.2 For all three cases, the example includes the following elements: The cache can hold 64 Kbytes. Data are transferred between main memory and the cache in blocks of 4 bytes each. This means that the cache is organized as 16K = 214 lines of 4 bytes each. The main memory consists of 16 Mbytes, with each byte directly addressable by a 24-bit address (24 = 16M). Thus, for mapping purposes, we can consider main memory to consist of...

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

  • 32 bytes of memory. 16 bytes of 2-way set-associative cache, where blocks can go anywhere within...

    32 bytes of memory. 16 bytes of 2-way set-associative cache, where blocks can go anywhere within the set. Block is 2 bytes, set in cache is two blocks. Populate memory starting with upper-case letters, then 0-5. Hint- with full associativity in the set: each block has its own set of Tag bits in the cache. Memory is not organized by sets, though blocks get assigned to sets, and load in the cache per set.
1) Break down the addressing: Tag...

  • A cache has lines of 4 bytes and a total size of 64 Kbytes with 16-Mbyte...

    A cache has lines of 4 bytes and a total size of 64 Kbytes with 16-Mbyte main memory. what is the address length?

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