SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
Memory
Exercise:
Review Of Essential Terms And Concepts
Question:12 | ISBN:9780763704445 | Edition: 3

Question

12. Explain how fully associative cache is different from direct mapped cache.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

Associative cache :

  1. Needs comparison with all tag bits, i.e., the cache control logic must examine every block’s tag for a match at the same time in order to determine that a block is in the cache/not.
  2. Main Memory Address is divided into 1 fields : TAG & WORD.
  3. The mapping of the main memory block can be done with any of the cache block.
  4. If the processor need to access same memory location from 2 different main memory pages frequently, cache hit ratio has no effect.
  5. Search time is more as the cache control logic examines every block’s tag for a match. 

Direct mapped cache :

  1. Needs only one comparison because of using direct formula to get the effective cache address.
  2. Main Memory Address is divided into 3 fields : TAG, BLOCK & WORD. The BLOCK & WORD together make an index. The least significant TAG bits identify a unique word within a block of main memory, the BLOCK bits specify one of the blocks and the Tag bits are the most significant bits.
  3. There is one possible location in the cache organization for each block from main memory because we have a fixed formula.
  4. If the processor need to access same memory location from 2 different main memory pages frequently, cache hit ratio decreases.
  5. Search time is less here because there is one possible location in the cache organization for each block from main memory.

 

1 0

Discussions

Post the discussion to improve the above solution.