Question

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

32 bytes of memory. 16 bytes of 2-way setassociative cache, where blocks can go anywhere within the set. Block is 4 bytes, set in cache is two blocks. Populate memory starting with 0-9, then upper case letters. 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. A) Complete: Bits in Address = # bytes in cache = # bytes in set = # of sets in cache = # of blocks in memory = B) Addressing: Tag | Set |block offset ____ | ____ | ____ C) Draw the diagrams of cache and memory, with appropriate labels as per example. D) Load cache with 1st 2nd 5th 8th blocks. E) CPU generates address 10011. If this is a hit, what character is stored at that location?

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

Given Memory Size is = 32 bytes and

a 16 bytes of 4-way set-associative cache.

Block Size is = 2 bytes implies

Number of blocks in Main Memory is = N = 32 bytes / 2 bytes = 16.

Number of blocks in Cache Memory is = M = 16 bytes / 2 bytes = 8.

Number of sets in Cache Memory is = S = 8 / 4 = 2.

Here kth block of Main Memory will be placed in k mod S set of cache implies

k mod 2 set of the cache.

Main Memory will be as below,

Block Number Addresses Content I 00000 I 00010 I 00100 I 00110 I 01000 I 01010 I 01100 I 01110 I 10000 I 10010 I 10100 I 10110 I 11000 I 11010 I 11100 Block 0 Block 1 Block 2 Block 3 00001 00011 00101 00111 Block 4 01001 Block 5 01011 Block 6 Block 7 Block 8 Block 9 01101 10001 10011 Block 10 10101 Block 1:1 Block 1:2 Block 1:3 Block 14 10111 11001 11011 11101 Block 15

Given addresses 00001 00010 01000 01011 01100 11011 11100 11111,

00001 address is in block 0 of main memory and it will be placed in 0 mod 2 = 0 (Set 0).

00010 address is in block 1 of main memory and it will be placed in 1 mod 2 = 1 (Set 1).

01000 address is in block 4 of main memory and it will be placed in 4 mod 2 = 0 (Set 0).

01011 address is in block 5 of main memory and it will be placed in 5 mod 2 = 1 (Set 1).

01100 address is in block 6 of main memory and it will be placed in 6 mod 2 = 0 (Set 0).

11011 address is in block 13 of main memory and it will be placed in 13 mod 2 = 1 (Set 1).

11100 address is in block 14 of main memory and it will be placed in 14 mod 2 = 0 (Set 0).

11111 address is in block 15 of main memory and it will be placed in 15 mod 2 = 1 (Set 1).


Hence cache Memory will be as below,

Given CPU generates the address 11010, this address is there in

Block 6 of the cache and Hence this is a HIT.

Character at this address is Q

Add a comment
Know the answer?
Add Answer to:
32 bytes of memory. 16 bytes of 2-way setassociative cache, where blocks can go anywhere within...
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
  • 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...

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

  • A primary memory system consists of 128 address bits. Each block within the cache is 256...

    A primary memory system consists of 128 address bits. Each block within the cache is 256 bytes. The total cache size is 131,072 bytes. What are the sizes of the tag and index in the cache? First, find the number of blocks. 128,000 bytes # Blocks = 256 bytes per block bort = 512 blocks Where does the 128,000 come from?? Now find the number of bits required to distinguish all the blocks. This is the index aka set size....

  • This problem concerns a physical memory cache. Recall that m is the number of physical address...

    This problem concerns a physical memory cache. Recall that m is the number of physical address bits, C is the cache size (number of bytes), B is the block size in bytes, E is the associativity, S is the number of cache sets, t is the number of tag bits, s is the number of set index bits, and b is the number of block offset bits. Suppose we have a cache with the following characteristics m = 32 C...

  • Question 3: Consider a 32-bit physical address memory system with block size 16 bytes and a...

    Question 3: Consider a 32-bit physical address memory system with block size 16 bytes and a 32 blocks direct mapped cache. The cache is initially empty. The following decimal memory addresses are referenced 1020, 1006, 1022, 5106, 994, and 2019 Map the addresses to cache blocks and indicate whether hit or miss. Note: You must use the hexadecimal approach in solving this question. You must also show the computations of dividing the memory address into tag bits, cache index 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?

  • Assume a 16-way set associative cache that holds 4096 bytes, where each block is 16 bytes....

    Assume a 16-way set associative cache that holds 4096 bytes, where each block is 16 bytes. Assuming an address is 32 bits and that cache is initially empty complete the table below. (You should use hexadecimal numbers for all answers.) Address TAG Cache location (block) | Offset within block OxOFFOFABA 0x00000011 0xOFFFFFFE 0x23456719 OxCAFEBABE Which, if any of the addresses will cause a collision (forcing the block that was just brought in to be overwritten) if they are accessed one...

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

  • Consider a 2-way set associative cache consisting of 8 blocks total of byte-addressable memory with 4...

    Consider a 2-way set associative cache consisting of 8 blocks total of byte-addressable memory with 4 bytes per block. Assume that the cache is initially empty. Given the following address sequence, fill in the table below. Time Access Tag Set Offset 3 10010001 11001001 10110110 10101011 10110010

  • 7. In a cache system we have the following attributes: 4 GB of DRAM 256 MB...

    7. In a cache system we have the following attributes: 4 GB of DRAM 256 MB of physical memory space 2 MB of cache IKB per cache line Determine number of lines in cache. a) Determine the number of address bits out of the processor. b) c) Determine the number of bits needed for the block offset section of the address. If our cache is 8-way set associative, how many sets are there in the cache? d) How many bits...

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