Lesson 6
Lesson 6
2
Embedded Processors and
Memory
Version 2 EE IIT, Kharagpur 1
Lesson
6
Memory-II
Version 2 EE IIT, Kharagpur 2
Instructional Objectives
After going through this lesson the student would
Memory Hierarchy
Cache Memory
- Different types of Cache Mappings
- Cache Impact on System Performance
Dynamic Memory
- Different types of Dynamic RAMs
Memory Management Unit
Pre-Requisite
Digital Electronics, Microprocessors
Process
Registers
Cache
Main memory
Disk
Tape
Direct Mapping
• Main memory address divided into 2 fields
Index which contains
- cache address
- number of bits determined by cache size
Tag
- compared with tag stored in cache at address indicated by index
- if tags match, check valid bit
• Valid bit
indicates whether data in slot has been loaded from memory
• Offset
used to find particular word in cache line
V T D
Data
Valid
=
Tag Offset
Data
V T V T V T
Valid
= =
=
Set-Associative Mapping
• Compromise between direct mapping and fully associative mapping
• Index same as in direct mapping
• But, each cache address contains content and tags of 2 or more memory address locations
• Tags of that set simultaneously compared as in fully associative mapping
• Cache with set size N called N-way set-associative
2-way, 4-way, 8-way are common
V T D V T D
Data
Valid
= =
0.16
0.14
0.12
% cache miss
0.1 1 way
2 way
0.08
4 ways
0.06 8 way
0.04
0.02
0
cache size
1 Kb 2 Kb 4 Kb 8 Kb 16 Kb 32 Kb 64 Kb 128 Kb
data Refresh
Circuit
. Buffer
In Sense
Buffer
Addr Amplifiers
Data Col Decoder ras, clock
rd/ wr Col cas
Row
Out Buff Decod cas,
Buffer er er
Data Addr.
Row ras
address Bit storage array
cas
ras
cas
ras
cas
6.12 Question
Q1. Discuss different types of cache mappings.
Ans:
0.16
0.14
0.12
0.1 1 way
% cache miss
2 way
0.08
4 ways
0.06 8 way
0.04
0.02
0
cache size
1 Kb 2 Kb 4 Kb 8 Kb 16 Kb 32 Kb 64 Kb 128 Kb
Ans:
EDO RAM
ras
cas
ras
cas