Professional Documents
Culture Documents
COMPUTER ORGANIZATION
Lecture 24: Virtual Memory
ELEC3010
ACKNOWLEGEMENT
2
COVERED IN THIS COURSE
❑ Binary numbers and logic gates
❑ Boolean algebra and combinational logic
❑ Sequential logic and state machines
❑ Binary arithmetic
Digital logic
❑ Memories
4
MOTIVATION EXAMPLE 1
5
MOTIVATION EXAMPLE 2
6
EXTENDING AND SHARING MAIN MEMORY?
8
SHARING MAIN MEMORY
12
PAGING
13
VIEW OF VIRTUAL MEMORY WITH 32 BIT ADDRESS
14
VIRTUAL MEMORY AND PHYSICAL MM
❑ When requested, a page is brought into a physical MM location
❑ The correspondence (mapping) between virtual to physical
addresses is saved
▪ When the same virtual address is encountered, it is translated using
this saved mapping information
15
ADDRESS TRANSLATION
16
CAN YOU DO IT?
Question 1:
Page size is 16KB → how many bits is page offset?
(a) 12 (b) 13 (c) 14 (d) 15 (e) 16
Question 2:
Page size 4KB, Main Memory 512 MB
→ how many bits is PPN?
(a) 14 (b) 15 (c) 16 (d) 17 (e) 18
17
ADDRESS TRANSLATION USING A PAGE TABLE
18
PAGE TABLE OPERATION (1)
19
PAGE TABLE OPERATION (2)
20
PAGE TABLE OPERATION (3)
21
PAGE TABLE OPERATION (4)
22
PAGE FAULTS AND PAGE REPLACEMENT
23
EXAMPLE: PAGE TABLE ACCESS
❑Given the following page table and virtual address stream (in
decimal), identify the potential page faults 128, 2048, 4096,
8193
24
EXAMPLE: PAGE TABLE ACCESS
❑Given the following page table and virtual address stream (in
decimal), identify the potential page faults 128 (VPN=0), 2048
(VPN=0), 4096 (VPN=1), 8193 (VPN=2)
25
PAGE REPLACEMENT AND WRITE POLICY
26
FASTER ADDRESS TRANSLATION
27
TRANSLATION LOOKASIDE BUFFER (TLB)
28
TLB MISS SCENARIOS
29
BEFORE NEXT CLASS
30