You are on page 1of 15

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : U.Rajya Lakshmi
Designation : Lecturer
Branch : Computer Engg.,
Institute : Govt.Polytechnic for Women,
PALAMANER.
Year/Semester : III Semester
Subject : Computer Architecture
Subject Code : CM-303
Topic : Memory Organization
Duration : 50 Min
Sub Topic : Set Associative Mapping of
Cache Memory
Teaching aids : PPT,drawings
CM303.49 1
Do you Know

• What is the disadvantage of direct mapping cache


memory?

• What are the different mapping methods of cache?

CM303.49 2
Recap of previous lesson
• Various mapping methods
• Associative mapping
• Direct mapping
• Set associative mapping

• In Associative mapping cache stores both the


data and address of a memory word

• In direct mapping each word in cache consists


of data and its associated tag
CM303.49 3
Objectives

On completion of this period you would be able to


know

• The set associative mapping method of cache


memory

CM303.49 4
Need of SET associative mapping

• Associative mapping is expensive and complicated

• In direct mapping no two words with different tags


can be stored at the same time

• To overcome this disadvantage of direct mapping,


a third type called set associative mapping is used

CM303.49 5
Set Associative Mapping of Cache memory
Contd.,

• Two or more words of memory can be stored


under same index

• Each word is stored along with its tag

CM303.49 6
Set Associative Mapping of Cache memory
Contd.,
• Two way set associative cache
• Stores two words with same index but with different
tags

• Improves hit ratio because more words with same


index can reside in cache

• Example of set associative cache organization is


shown in fig.1

CM303.49 7
Set Associative Mapping of Cache memory
Index Tag Data Tag Data
000 01 3452 02 3189

02 2367 00 1234
777

Fig.1
CM303.49 8
Set Associative Mapping of Cache memory
Contd.,
• Two way set associative cache
• When CPU wants to access a word
– index part (n bits) is used to search cache

– Tag field of the address is compared with the


two tags in the cache

– If tag of address match with any one of two tags


in cache, there is a hit

CM303.49 9
Set Associative Mapping of Cache memory

• Disadvantage

• More complex comparison logic is required

CM303.49 10
Summary

• In this class you have studied


• Disadvantage of direct mapping
• No two words with different tags can be stored at a
time

• Set-associative mapping
• Allows to store more words with same index but with
different tags
• More complex comparison logic is required

CM303.49 11
QUIZ

CM303.49 12
1. Two way Set associative cache organization can
store

a) One word under same index


b) Zero words under same index
c) Three words with same index
d) Two words with same index

CM303.49 13
1. Two way Set associative cache organization can
store

• One word under same index


• Zero words under same index
• Three words with same index
• Two words with same index

CM303.49 14
Frequently asked Questions

1. Explain the set associative mapping of cache


memory organization with the help of an
example

CM303.49 15

You might also like