6.1 Introduction
In previous chapters, we studied the components
from which memory is built and the ways in which
memory is accessed by various ISAs.
In this chapter, we focus on memory organization.
A clear understanding of these ideas is essential
for the analysis of system performance.
Objectives: understand
The concepts of hierarchical memory organization.
how each level of memory contributes to system
performance, and how the performance is measured.
H FI J H # "
H FI
7 B # %C D E C %? F+' 1- , 6 * ' )- +%' - %$ / . - 12
Works
! " # $ %2 %!Note:
- 3 4 56 How
3 6 ) , ( SRAM
' 7 %" 6 , ( 5%
# 8 +9 6 %$6 3 +0- ) 9 : 0, - '
! " # $ %+* %, 1 6 %3 - * , %4 - 4 : 5( ' %, 6 01 ) - 5- ; 7
Semiconductor transistors as switches.
< ( * 6 9 %- ) %$ +5+0- ) %( %$ 6 3 +0- ) 9 : 0, - ' %3 ( , 6 ' +( 5
D@D
>
$ / +, 01 %! E# $ F =
<
>
<
<
>
<
DA D
>
$ / +, 01 %# G F H
! = > %? @A ? %B C) , ' - 9 : 0, +- ) %, - %" 6 3 - ' 7
@I
= 7> A %5
"
= 7>? = # " A %4
= 7>
? %4
5 "
= 7>@= # "
? %5
F . 1G/ ;/ , 3
2 EH
@! # %A B C A %D E( 31. - : , 3+. ( %3. %$ / * . 1'
10
11
12
13
14
14
15
17
CPU
Registers
Cache
Main
Memory
Hard Drive
18
19
20
21
|
|
|
|
LOAD Addr
STORE Next
LOAD Num
SUBT One
104
105
106
107
|
|Loop
|
|
STORE Ctr
LOAD Sum
ADDI Next
STORE Sum
108 |
LOAD Next
109 |
10A |
ADD One
STORE Next
10B |
22
10C
|
10D |
LOAD Ctr
SUBT One
STORE Ctr
10E
10F
110
111
112
113
114
115
116
117
118
119
11A
11B
|
|
|
|Addr
|Next
|Num
|Sum
|Ctr
|One
|
|
|
|
|
SKIPCOND 000
JUMP Loop
HALT
HEX 117
HEX 0
DEC 5
DEC 0
HEX 0
DEC 1
DEC 10
DEC 15
DEC 2
DEC 25
DEC 30
|If,
|
|
|
|Then,
|
|
|
|Else,
|
|
|Endif,
|X,
|Y,
24
With direct
mapped cache
consisting of N
blocks of cache,
block X of main
memory maps to
cache block Y =
X mod N.
27
28
29
30
31
10
1010
32
33
34
35
36
37
38
39
41
Logical view
Linear view
43
44
45
46
47
48
49
50
51
52
53
54
55
Chapter 6 Conclusion
Computer memory is organized in a hierarchy, with the
smallest, fastest memory at the top and the largest,
slowest memory at the bottom.
Cache memory gives faster access to main memory,
while virtual memory uses disk storage to give the
illusion of having a large main memory.
Cache maps blocks of main memory to blocks of cache
memory. Virtual memory maps page frames to virtual
pages.
There are three general types of cache: Direct mapped,
fully associative and set associative.
56
Chapter 6 Conclusion
With fully associative and set associative cache, as
well as with virtual memory, replacement policies must
be established.
Replacement policies include LRU, FIFO, or LFU.
These policies must also take into account what to do
with dirty blocks.
All virtual memory uses main memory and hard disk
to simulate a large memory space than the physical
memory -- Not covered.
57
End of Chapter 6
58
60
61
62
63
64
66
68
69
70
71
72
73
74
76
77
80
81
82
83
84
85
86
87
90