Hi,
Everyone
My Name is:
Radhesham Khatri
My Presentation Topic Is:
CACHE MEMORY
What does Cache mean?
The word CACHE means collections of items of
same type stored in hidden place.
What does Memory mean?
The ability to remember information, experiences,
and people
Cache brief:
Small amount of fast memory.
An auxiliary memory from which high
speed retrieval is possible.
Sits between normal main memory and CPU
May be located on CPU chip or module
How Cache Looks :
Cache Memory Flowchart
Cache Importance :
If the ACTIVE portions of the program and data
are place in a fast small memory,
the average memory access time can be
REDUCED, thus reducing the total execution time
of the program. Such a FAST SMALL MEMORY
is referred to as a CACHE MEMORY.
How Cache Looks Like In
Mobile Phone:
Cache and Main Memory
CPU Cache Main Memory
Hit
Hit
Latency
Miss
Miss Latency
Mapping
Types of Cache Mapping
1 : Direct Mapping
2 : Associative Mapping
3: Set Associative Mapping
Cache
Main Memory
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
64 Words
Blocks(4 words)
Lines
16 Words
No of blocks in MAIN MEMORY =64/4 =
16
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
No of Lines in CACHE=16/4 = 4
0 0 0 1 0 1
Block No Block offset
5
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
20 21 22 23
24 25 26 27
28 29 30 31
32 33 34 35
36 37 38 39
40 41 42 43
44 45 46 47
48 49 50 51
52 53 54 55
56 57 58 59
60 61 62 63
Round Robin Order
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
Lines
Blocks
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
20 21 22 23
24 25 26 27
28 29 30 31
32 33 34 35
36 37 38 39
40 41 42 43
44 45 46 47
48 49 50 51
52 53 54 55
56 57 58 59
60 61 62 63
Main Memory
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
0
1
2
3
Binary Representation
0 0 0 1 0 1
Block Number Block offset
LineTag
0
1
2
3
0 0
1 1
1 0
1 1
Tag LINE
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 1 0
0 0 0 0 1 1
Block Number
Block offsetTag Line
0
1
Main Memory
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
64 Words
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
20 21 22 23
24 25 26 27
28 29 30 31
32 33 34 35
36 37 38 39
40 41 42 43
44 45 46 47
48 49 50 51
52 53 54 55
56 57 58 59
60 61 62 63
5
0 ,1,2 ,3
1 1 0 1 0 0
1 1 0 1 0 1
1 1 0 1 1 0
1 1 0 1 1 1
Block Number
Block offsetTag Line
52,53,54,55
1 : Direct Mapping
0 0 0 1 0 1
Block Number Block offset
LineTag
Main Memory
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
64 Words
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
20 21 22 23
24 25 26 27
28 29 30 31
32 33 34 35
36 37 38 39
40 41 42 43
44 45 46 47
48 49 50 51
52 53 54 55
56 57 58 59
60 61 62 63
0
1
2
3
0 0
1 1
1 0
1 1
Tag LINE
Cache
1 : Direct Mapping
One- One
A main memory block can load into any line
of cache
2 : Associative Mapping
Main Memory
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
64 Words
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
20 21 22 23
24 25 26 27
28 29 30 31
32 33 34 35
36 37 38 39
40 41 42 43
44 45 46 47
48 49 50 51
52 53 54 55
56 57 58 59
60 61 62 63
Cache
0
1
2
3
16 Words
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
0-15
Main Memory
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
64 Words
Blocks(4 words)
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
16 17 18 19
20 21 22 23
24 25 26 27
28 29 30 31
32 33 34 35
36 37 38 39
40 41 42 43
44 45 46 47
48 49 50 51
52 53 54 55
56 57 58 59
60 61 62 63
Set
MAIN MEMORY size = 64
CACHE Size = 32
Block size of Main Memory = 4
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
0
1
2
3
2-way Set Associative
Sets = Lines/ Set Size
Sets =8 / 2 = 4 Sets
Lines = Cache size / Block Size
Lines = 32 / 4 = 8 Lines
Set Size = 2 Lines
0
1
2
3
4
5
6
7
Set 0
Set 1
Set 2
Set 3
0 0 0 1 0 1
Block Number Block offset
Set NoTag
0 1 1 0 1 1
c
c
3 : Set Associative Mapping
Cache presentation on Mapping and its types

Cache presentation on Mapping and its types

  • 1.
    Hi, Everyone My Name is: RadheshamKhatri My Presentation Topic Is: CACHE MEMORY
  • 2.
    What does Cachemean? The word CACHE means collections of items of same type stored in hidden place. What does Memory mean? The ability to remember information, experiences, and people
  • 3.
    Cache brief: Small amountof fast memory. An auxiliary memory from which high speed retrieval is possible. Sits between normal main memory and CPU May be located on CPU chip or module
  • 4.
  • 5.
  • 6.
    Cache Importance : Ifthe ACTIVE portions of the program and data are place in a fast small memory, the average memory access time can be REDUCED, thus reducing the total execution time of the program. Such a FAST SMALL MEMORY is referred to as a CACHE MEMORY.
  • 7.
    How Cache LooksLike In Mobile Phone:
  • 8.
    Cache and MainMemory CPU Cache Main Memory Hit Hit Latency Miss Miss Latency Mapping
  • 9.
    Types of CacheMapping 1 : Direct Mapping 2 : Associative Mapping 3: Set Associative Mapping
  • 10.
    Cache Main Memory 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 64 Words Blocks(4words) Lines 16 Words No of blocks in MAIN MEMORY =64/4 = 16 0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15 No of Lines in CACHE=16/4 = 4 0 0 0 1 0 1 Block No Block offset 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Round Robin Order 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 Lines Blocks
  • 11.
    0 0 00 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Main Memory 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15 0 1 2 3 Binary Representation
  • 12.
    0 0 01 0 1 Block Number Block offset LineTag 0 1 2 3 0 0 1 1 1 0 1 1 Tag LINE 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 Block Number Block offsetTag Line 0 1 Main Memory 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 64 Words 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 5 0 ,1,2 ,3 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1 Block Number Block offsetTag Line 52,53,54,55 1 : Direct Mapping
  • 13.
    0 0 01 0 1 Block Number Block offset LineTag Main Memory 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 64 Words 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 0 1 2 3 0 0 1 1 1 0 1 1 Tag LINE Cache 1 : Direct Mapping One- One
  • 14.
    A main memoryblock can load into any line of cache 2 : Associative Mapping Main Memory 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 64 Words 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Cache 0 1 2 3 16 Words 0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15 0-15
  • 15.
    Main Memory 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 64 Words Blocks(4words) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Set MAIN MEMORY size = 64 CACHE Size = 32 Block size of Main Memory = 4 0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15 0 1 2 3 2-way Set Associative Sets = Lines/ Set Size Sets =8 / 2 = 4 Sets Lines = Cache size / Block Size Lines = 32 / 4 = 8 Lines Set Size = 2 Lines 0 1 2 3 4 5 6 7 Set 0 Set 1 Set 2 Set 3 0 0 0 1 0 1 Block Number Block offset Set NoTag 0 1 1 0 1 1 c c 3 : Set Associative Mapping