Navi

Mapping Function 1.0

Hi~~ How are your guys?

Today, I want to show you what is Mapping Function.


First,
 Mapping function can be determine as 3 topic below:
a)Direct Mapping
b) Associative Mapping
c) Set Associative Mapping

For examples,

Cache of 64K Bytes,
Cache block of 4 Bytes.
That's mean cache is organized as
(64/4)KB Lines of 4 bytes each.

Or,

16 MBytes main memory,
Main memory consists of
(16/4)MB Lines of 4 bytes each.

From the solutions at above,
Lines is equal to capacity of cache/main memory divide by the capacity of cache block.



Direct Mapping



-Each block of main memory maps to ONLY one cache line.
-Address is in 2 parts.
-Least Significant 'w' bits identify unique word/byte within a block of main memory.
-Most Significant 's' bits specify one of 2 power of 's' memory block.








Direct Mapping Address Structure



Direct Mapping Cache Organization




Well...Let me do a summary for the direct mapping..

According to the all diagram above,

We can know that:
a)Address length = (s+w) bits.
b)Block size=Line size= 2^(w) words or bytes.
c)Number of blocks in main memory = 2^(s)
d)Number of lines in cache = m = 2^(r)
e)Size of tag = (s-r) bits


Direct Mapping is simple and inexpensive but its fixed location for given block.


Youtube:Direct mapped function


To be continues....





                                                                                         Written by--®æŋ




0 comments: