Module 5 - 5.1 Overview of Computer Memory
Module 5 - 5.1 Overview of Computer Memory
0 MEMORY
• Lecture Taken from Chap 6 :Computer
Organization and Architecture by Linda
Null
• Additional Resources taken from John
Wiley Zybook, Module 5
1
RECALL: The Bus System
2
Overview of Computer
System Memory
• Objectives
• Master the concepts of hierarchical memory
organization.
• Understand how each level of memory contributes to
system performance, and how the performance is
measured.
• Master the concepts behind cache memory, virtual
memory, memory segmentation, paging and address
translation.
3
5.1 Introduction
4
5.2 Types of Memory
5
5.2 Types of Memory
7
5.3 The Memory Hierarchy
• Faster memory is more expensive than slower memory.
• For the best performance at the lowest cost, memory is organized in a
hierarchical fashion.
• Small, fast storage elements are kept in the CPU, larger, slower main memory
is accessed through the data bus.
• Larger, (almost) permanent storage in the form of disk and tape drives is still
further from the CPU.
Processor
Control
Secondary Tertiary
Storage Storage
Third Main (Tape)
Second Level (Disk)
Memory
On-Chip
Registers
Level
Cache
Memory hierarchy
5.3 The Memory Hierarchy
9
5.3 The Memory Hierarchy
11
5.3 The Memory Hierarchy
14
5.4 Direct Mapping
15
5.4 Direct Mapping
16
Direct Mapping
17
5.4 Cache Memory
19
5.4 Cache Memory
20
5.4 Cache Memory
21
5.4 Cache Memory
block 12 can go anywhere block 12 can go only into block 12 can go anywhere in
Block
1111111111222222222233
no.
01234567890123456789012345678901
Chapter 6: Memory 24
5.4 Cache Memory
27
Memory Mapping
28
5.4 Cache Memory
30
5.4 Cache Memory
31
5.4 Cache Memory
32
5.4 Cache Memory
33
5.4 Cache Memory
34
5.4 Cache Memory
35
5.4 Cache Memory
36
5.4 Cache Memory
37
5.4 Cache Memory
38
5.4 Cache Memory
39
5.4 Cache Memory
40
5.4 Cache Memory
41
5.4 Cache Memory
42
5.4 Cache Memory
43
5.4 Cache Memory
44
5.5 Virtual Memory
46
5.5 Virtual Memory
48
5.5 Virtual Memory
49
5.5 Virtual Memory
• If the valid bit is zero in the page table entry for the
logical address, this means that the page is not in
memory and must be fetched from disk.
– This is a page fault.
– If necessary, a page is evicted from memory and is replaced
by the page retrieved from disk, and the valid bit is set to 1.
• If the valid bit is 1, the virtual page number is replaced
by the physical frame number.
• The data is then accessed by adding the offset to the
physical frame number.
50
5.5 Virtual Memory
51
5.5 Virtual Memory
52
6.5 Virtual Memory
53
5.5 Virtual Memory
54
5.5 Virtual Memory
55
5.5 Virtual Memory
The next slide shows how all the pieces fit together.
56
5.5 Virtual Memory
57
5.5 Virtual Memory
59
5.5 Virtual Memory
62
Conclusion
64
End of Chapter 6
65