Explore BrainMass
Share

Cache associativity: memory and cache blocks mapping

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Consider a memory of 64 blocks (labeled 0 through 63) and a cache of 16 blocks (labeled 0 through 15). In the questions below, list only correct results.

(i) Under 2-way set associativity, to which blocks of cache may element 31 of memory go?

(ii) In the sequence of memory block references from the CPU [0,2,10,45,10,2,44,35,26,44,45,10], beginning from an empty cache, will layout for a direct mapped and a 4-way set associative cache differ? What will be the mappings between cache block number and memory block number in each case?

© BrainMass Inc. brainmass.com October 17, 2018, 12:16 am ad1c9bdddf
https://brainmass.com/computer-science/memory/287750

Solution Preview

Memory of 64 blocks can be addressed using 6 bits address.

(i) Under 2-way set associative organization, the cache of 16 blocks will be organized in 8*2 format i.e. 8 sets of size 2 blocks each. Since each memory block has to be mapped to one unique set in this cache organization, we look at the lower 3 bits of the block's memory address, and use that to determine which cache set it will go in.

31 (decimal) = 011111 (binary)
Lower 3 bits in above address are 111, indicating that the memory block with above address will go to cache set number 7.
Assuming that the cache is currently empty, in that ...

Solution Summary

Solution gives detailed explanations as well.

$2.19
Similar Posting

A computer using direct-mapped cache has 2^24 words of main memory and a cache of 256 blocks.

1. A computer using direct-mapped cache has 2^24 words of main memory and a cache of 256 blocks. Each cache block contains 64 words.

a) How many blocks of main memory are there?
b) What is the format of a memory address as seen by the cache? (What are the sizes of the tag, block and word fields?)
c) To which block will the memory reference 01BD36 (in hexadecimal) map?

2. A computer using fully-associative cache has 2^32 words of main memory and a cache of 1024 blocks. Each cache block contains 32 words.

a) How many blocks of main memory are there?
b) What is the format of a memory address as seen by the cache? (What are the sizes of the tag, block and word fields?)
c) To which block will the memory reference 025A13CF (in hexadecimal) map?

View Full Posting Details