Address mapping
-
Upload
rockymani -
Category
Technology
-
view
3.249 -
download
1
description
Transcript of Address mapping
![Page 1: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/1.jpg)
ADDRESS MAPPING
![Page 2: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/2.jpg)
There are three commonly used methods totranslate main memory addresses to cachememory addresses.
• Direct-Mapping• Associative Mapping• Set-Associative Mapping
Methods of Address Mapping :
![Page 3: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/3.jpg)
BLOCK: Fixed sized packet of information that moves back and forth between a cache and main memory.
LINE: Container in a cache that stores a block as well as other information such as the valid bit and tag bits.
SET: Collection of one or more lines. Sets in direct-mapped caches consist of a single line. Set in fully associative and set associative caches consists of multiple lines.
![Page 4: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/4.jpg)
Dir
ect
m
appin
g
![Page 5: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/5.jpg)
Direct-Mapping
![Page 6: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/6.jpg)
• Each cache slot corresponds to an explicit set of main memory.
• In our example we have 4096 memory blocks and 128 cache slots.
• 128 blocks of main memory save in 1 block of cache memory.
• It is simplest mapping technique. • It is easy to implement.
![Page 7: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/7.jpg)
Advantages:• The tag memory is much smaller than
in associative mapped cache.• It is less costly compare to other
mapping technique.
Disadvantages: • It is not flexible.
![Page 8: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/8.jpg)
Ass
oci
ati
ve
Mappin
g
![Page 9: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/9.jpg)
Associative Mapping
• Any main memory blocks can be mapped into each cache slot.
• The 12-tag bits are required to identify a memory block when it is in the cache.
![Page 10: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/10.jpg)
• The mapping from main memory blocks to cache slots is performed by partitioning an address into fields.
• There is no fix block, the memory address has only two fields : Tag & Word.
![Page 11: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/11.jpg)
Advantage:• Flexibility. Main Memory block can be
mapped anywhere in Cache Memory.
Disadvantage: • Slow or expensive.
![Page 12: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/12.jpg)
Set-
Ass
oci
ati
ve
Mappin
g
![Page 13: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/13.jpg)
Set-Associative Mapping• Combines the simplicity of direct
mapping with the flexibility of associative mapping.
• For this example, two slots make up a set. Since there are 214 slots in the cache, there are 214/2 =213 sets.
![Page 14: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/14.jpg)
• When an address is mapped to a set, the direct mapping scheme is used, and then associative mapping is used within a set.
• The format for an address has 13 bits in the set field, which identifies the set in which the addressed word will be found. Five bits are used for the word field and 14-bit tag field.
![Page 15: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/15.jpg)
Advantages:
• In our example the tag memory increases only slightly from the direct mapping and only two tags need to be searched for each memory reference.
• The set-associative cache is widely used in today’s microprocessors.
![Page 16: Address mapping](https://reader035.fdocuments.us/reader035/viewer/2022081821/547ddf50b4af9fc16b8b459a/html5/thumbnails/16.jpg)
Thank You…