answersLogoWhite

0


Best Answer

Disadvantage: if a program happens to reference words repeatedly from two different blocks that map into the same line, then the blocks will be continually swapped in the cache, and the hit ratio will be low. Thus, the performance isn't optimal compared to the other techniques.

Advantage: It's easy to implement.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

•Advantages

-Almost as simple to build as a

direct-mapped cache.

  • -Only n comparators are
  • needed for an n-way set
  • associative cache. For 2-way
  • set-associative, only 2
  • comparators are needed to
  • compare tags.

-Supports temporal locality by

having full associativity within

a set.

•Disadvantages -Not as good as fully-

associative cache in

supporting temporal locality.

-For LRU schemes, because of

small associativity, actually

possible to have 0% hit rate

for temporally local data.

-E.g. If our accesses are A1 A2

A3 A1 A2 A3, and if A1, A2

and A3 map to the same

2-way set, then hit rate is 0%

as subsequent accesses

replace previous accesses in

the LRU scheme.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the disadvantages and advantages of direct mapping?
Write your answer...
Submit
Still have questions?
magnify glass
imp