11 Virtual Memory kuic kyonggi ac krdssung 11

  • Slides: 51
Download presentation
제 11 장 Virtual Memory

제 11 장 Virtual Memory

kuic. kyonggi. ac. kr/~dssung 11. 1 Comparison of Cache and Virtual Memory Hit CPU

kuic. kyonggi. ac. kr/~dssung 11. 1 Comparison of Cache and Virtual Memory Hit CPU address = Memory address Cache Memory Cache address Memory address CPU address는 Cache address로 변환된 후, Cache address내의 해당 정보가 CPU에게 제공된다.

kuic. kyonggi. ac. kr/~dssung Cache CPU C block F (F 0 -FF) C block

kuic. kyonggi. ac. kr/~dssung Cache CPU C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) CPU address 0 x 01 F 8 Cache address 범위 0 x 00 – 0 x. FF 0 x 01 F 8 Memory M block FFF (FFF 0 -FFFF) M block FFE (FFE 0 -FFEF) … … … M block 01 F (01 F 0 -01 FF) … … M block 002 (0020 -002 F) M block 001 (0010 -001 F) M block 000 (0000 -000 F) Memory address 범위 0 x 0000 – 0 x. FFFF

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F 8 CPU 1 0 0 1 1 1 1 1 0 x 234 0 x 000 0 x 01 C 0 x 01 E 0 x 553 0 x 000 0 x 766 0 x 023 0 x 011 0 x 126 0 x 123 0 x 222 0 x 111 0 x 01 F C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) CPU address : 0 x 01 F 8 -> Cache address : 0 x 08

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F 8 CPU 1 0 0 1 1 1 1 1 0 x 234 0 x 000 0 x 01 C 0 x 01 E 0 x 01 F 0 x 000 0 x 766 0 x 023 0 x 011 0 x 126 0 x 123 0 x 222 0 x 111 0 x 554 C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) CPU address : 0 x 01 F 8 -> Cache address : 0 x. A 8

kuic. kyonggi. ac. kr/~dssung miss CPU Cache Memory

kuic. kyonggi. ac. kr/~dssung miss CPU Cache Memory

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F 8 CPU 1 0 0 1 1 1 1 1 0 x 234 0 x 000 0 x 01 C 0 x 01 E 0 x 553 0 x 000 0 x 766 0 x 023 0 x 011 0 x 126 0 x 123 0 x 222 0 x 111 0 x 010 C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) CPU address : 0 x 01 F 8 -> Cache address :

kuic. kyonggi. ac. kr/~dssung miss 0 x 01 F 8 CPU C block F

kuic. kyonggi. ac. kr/~dssung miss 0 x 01 F 8 CPU C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) Parallel Reading of Cache and Memory

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F

kuic. kyonggi. ac. kr/~dssung Full Associative Method Valid bit Tag 0 x 01 F 8 CPU 1 0 0 1 1 1 0 x 234 0 x 000 0 x 01 C 0 x 01 E 0 x 553 0 x 000 0 x 01 F 0 x 766 0 x 023 0 x 011 0 x 126 0 x 123 0 x 222 0 x 111 0 x 010 C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) CPU address : 0 x 01 F 8 -> Cache address : 0 x 88

kuic. kyonggi. ac. kr/~dssung Virtual Memory Hit CPU address = Virtual address Memory Swap

kuic. kyonggi. ac. kr/~dssung Virtual Memory Hit CPU address = Virtual address Memory Swap Space in Hard Disk Virtual Memory address = Physical address Virtual address CPU가 제공하는 virtual address는 physical address로 변환된 후, physical address내의 해당 정보가 CPU에게 제공된다.

kuic. kyonggi. ac. kr/~dssung miss CPU Memory Virtual Memory Block : miss가 발생 시

kuic. kyonggi. ac. kr/~dssung miss CPU Memory Virtual Memory Block : miss가 발생 시 memory에서 cache로 복사하는 정보 단위 Page : miss가 발생 시 virtual memory에서 memory로 복사하는 정보 단위

kuic. kyonggi. ac. kr/~dssung Cache와 Virtual Memory를 사용하는 경우 구성도 CPU address = Virtual

kuic. kyonggi. ac. kr/~dssung Cache와 Virtual Memory를 사용하는 경우 구성도 CPU address = Virtual address Cache Memory Virtual Memory Cache address Physical address Virtual address

kuic. kyonggi. ac. kr/~dssung -> Virtual Address : The address used by program before

kuic. kyonggi. ac. kr/~dssung -> Virtual Address : The address used by program before mapping into physical memory Hit CPU address = Virtual address Memory address = Physical address program Swap Space in Hard Disk Virtual Memory Virtual address

kuic. kyonggi. ac. kr/~dssung Program 1 1000 1004 1008 … 7000 … 7010 …

kuic. kyonggi. ac. kr/~dssung Program 1 1000 1004 1008 … 7000 … 7010 … 7020 … MOVE R 1, $7000 ADD R 1, $7010 MOVE $7020, R 1 … Program 2 Program 3

kuic. kyonggi. ac. kr/~dssung -> Computer can execute the program which size is bigger

kuic. kyonggi. ac. kr/~dssung -> Computer can execute the program which size is bigger than main memory. Hit CPU Memory ex) Memory Size = 64 Kbyte program Swap Space in Hard Disk Virtual Memory ex) Program Size = 1 M byte

kuic. kyonggi. ac. kr/~dssung -> Computer are running multiple processes with its own address

kuic. kyonggi. ac. kr/~dssung -> Computer are running multiple processes with its own address space (Divide physical memory into blocks(pages) and allocates them to different processes) CPU Memory program Virtual Memory

kuic. kyonggi. ac. kr/~dssung -> Protection is need CPU Memory Program 1 Program 2

kuic. kyonggi. ac. kr/~dssung -> Protection is need CPU Memory Program 1 Program 2 Virtual Memory

kuic. kyonggi. ac. kr/~dssung -> Sharing a smaller amount of physical memory between many

kuic. kyonggi. ac. kr/~dssung -> Sharing a smaller amount of physical memory between many processes -> program : code, data, stack j stack -> read/write i, k data -> read/write int i; main(){ int j; static k; k = i + j; . . } code -> read only 여러 프로그램에서 동일 코드 공유 가능

kuic. kyonggi. ac. kr/~dssung

kuic. kyonggi. ac. kr/~dssung

kuic. kyonggi. ac. kr/~dssung CPU Memory Program 1 Program 2 Virtual Memory -> code

kuic. kyonggi. ac. kr/~dssung CPU Memory Program 1 Program 2 Virtual Memory -> code

kuic. kyonggi. ac. kr/~dssung 11. 2 Page Placement => Full Associative CPU Memory Virtual

kuic. kyonggi. ac. kr/~dssung 11. 2 Page Placement => Full Associative CPU Memory Virtual Memory miss가 발생시 virtual memory에서 해당되는 page를 memory로 가지고 와야 하며, 이때, 어디에 둘 것인가 ?

kuic. kyonggi. ac. kr/~dssung Fully Associative : A page can be placed anywhere in

kuic. kyonggi. ac. kr/~dssung Fully Associative : A page can be placed anywhere in the memory Memory Virtual Memory Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung 11. 3 Page Identification CPU가 원하는 virtual address 정보가 memory에

kuic. kyonggi. ac. kr/~dssung 11. 3 Page Identification CPU가 원하는 virtual address 정보가 memory에 있는지를 어떠한 방법으로 확인할 것인가 ? Hit Miss CPU Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung Page Identification => Virtual Address Mapping by use of page

kuic. kyonggi. ac. kr/~dssung Page Identification => Virtual Address Mapping by use of page table Virtual Address Virtual Page Number Page Offset Main Memory Page M … Page Table + Physical Address Physical Page Number Page N … Page 0

kuic. kyonggi. ac. kr/~dssung example) main memory : 64 Kbyte page size : 4

kuic. kyonggi. ac. kr/~dssung example) main memory : 64 Kbyte page size : 4 Kbyte M Page F (F 000 -FFFF) M Page E (E 000 -EFFF) M Page D (D 000 -DFFF) M Page C (C 000 -CFFF) M Page B (B 000 -BFFF) M Page A (A 000 -AFFF) M Page 9 (9000 -9 FFF) M Page 8 (8000 -8 FFF) M Page 7 (7000 -7 FFF) M Page 6 (6000 -6 FFF) M Page 5 (5000 -5 FFF) M Page 4 (4000 -4 FFF) M Page 3 (3000 -3 FFF) M Page 2 (2000 -2 FFF) M Page 1 (1000 -1 FFF) M Page 0 (0000 -0 FFF)

kuic. kyonggi. ac. kr/~dssung example) virtual memory : 1 Mbyte page size : 4

kuic. kyonggi. ac. kr/~dssung example) virtual memory : 1 Mbyte page size : 4 Kbyte VM Page FF (FF 000 -FFFFF) VM Page FE (FE 000 -FEFFF) … VM Page 79 (79000 -79 FFF) VM Page 78 (78000 -78 FFF) … VM Page 38 (38000 -38 FFF) VM Page 37 (37000 -37 FFF) VM Page 36 (36000 -36 FFF) … VM Page 17 (17000 -17 FFF) VM Page 16 (16000 -16 FFF) VM Page 15 (15000 -15 FFF) … VM Page 01 (01000 -01 FFF) VM Page 00 (00000 -00 FFF)

kuic. kyonggi. ac. kr/~dssung Page Table Valid Table FF 0 0 1 FE 1

kuic. kyonggi. ac. kr/~dssung Page Table Valid Table FF 0 0 1 FE 1 … … … 2 79 1 78 1 A … … … 7 38 1 37 0 0 6 36 1 … … … 0 17 0 16 0 0 3 15 1 … … … 0 01 0 00 0 0 Main Memory M Page F (F 000 -FFFF) M Page E (E 000 -EFFF) M Page D (D 000 -DFFF) M Page C (C 000 -CFFF) M Page B (B 000 -BFFF) M Page A (A 000 -AFFF) M Page 9 (9000 -9 FFF) M Page 8 (8000 -8 FFF) M Page 7 (7000 -7 FFF) M Page 6 (6000 -6 FFF) M Page 5 (5000 -5 FFF) M Page 4 (4000 -4 FFF) M Page 3 (3000 -3 FFF) M Page 2 (2000 -2 FFF) M Page 1 (1000 -1 FFF) M Page 0 (0000 -0 FFF) Virtual Page 0 x 15 (0 x 15000 – 0 x 15 FFF) 는 Physical Page 0 x 3 (0 x 3000 – 0 x 3 FFF)에 있음을 의미

kuic. kyonggi. ac. kr/~dssung Valid Table FF 0 0 1 FE 1 … …

kuic. kyonggi. ac. kr/~dssung Valid Table FF 0 0 1 FE 1 … … … 2 79 1 78 1 A … … … 7 38 1 37 0 0 6 36 1 … … … 0 17 0 16 0 0 3 15 1 … … … 0 01 0 00 0 0 Main Memory M Page F (F 000 -FFFF) M Page E (E 000 -EFFF) M Page D (D 000 -DFFF) M Page C (C 000 -CFFF) M Page B (B 000 -BFFF) M Page A (A 000 -AFFF) M Page 9 (9000 -9 FFF) M Page 8 (8000 -8 FFF) M Page 7 (7000 -7 FFF) M Page 6 (6000 -6 FFF) M Page 5 (5000 -5 FFF) M Page 4 (4000 -4 FFF) M Page 3 (3000 -3 FFF) M Page 2 (2000 -2 FFF) M Page 1 (1000 -1 FFF) M Page 0 (0000 -0 FFF) Virtual Page 0 x 79 (0 x 79000 – 0 x 79 FFF) 는 Physical Page 0 x 2 (0 x 2000 – 0 x 2 FFF)에 있음을 의미

kuic. kyonggi. ac. kr/~dssung Virtual address : 0 x 79123 Virtual Page : 0

kuic. kyonggi. ac. kr/~dssung Virtual address : 0 x 79123 Virtual Page : 0 x 79, Page Offset : 0 x 123 Virtual Address Virtual Page Number Page Offset Main Memory Page M … Page Table + Physical Address Physical Page Number Page N … Page 0 Virtual Page (0 x 79) -> Physical Page (0 x 2) Physical address = Physical Page + Page Offset = 0 x 2123

kuic. kyonggi. ac. kr/~dssung 0 x 79123 CPU Valid Table FF 0 0 1

kuic. kyonggi. ac. kr/~dssung 0 x 79123 CPU Valid Table FF 0 0 1 FE 1 … … … 2 79 1 78 1 A … … … 7 38 1 37 0 0 6 36 1 … … … 0 17 0 16 0 0 3 15 1 … … … 0 01 0 00 0 0 Main Memory 0 x 2123 M Page F (F 000 -FFFF) M Page E (E 000 -EFFF) M Page D (D 000 -DFFF) M Page C (C 000 -CFFF) M Page B (B 000 -BFFF) M Page A (A 000 -AFFF) M Page 9 (9000 -9 FFF) M Page 8 (8000 -8 FFF) M Page 7 (7000 -7 FFF) M Page 6 (6000 -6 FFF) M Page 5 (5000 -5 FFF) M Page 4 (4000 -4 FFF) M Page 3 (3000 -3 FFF) M Page 2 (2000 -2 FFF) M Page 1 (1000 -1 FFF) M Page 0 (0000 -0 FFF) Virtual Page (0 x 79) -> Physical Page (0 x 2) Physical address = Physical Page + Page Offset = 0 x 2123

kuic. kyonggi. ac. kr/~dssung 0 x 78 CDE CPU Valid Table FF 0 0

kuic. kyonggi. ac. kr/~dssung 0 x 78 CDE CPU Valid Table FF 0 0 1 FE 1 … … … 2 79 1 78 1 A … … … 7 38 1 37 0 0 6 36 1 … … … 0 17 0 16 0 0 3 15 1 … … … 0 01 0 00 0 0 Main Memory 0 x. ACDE M Page F (F 000 -FFFF) M Page E (E 000 -EFFF) M Page D (D 000 -DFFF) M Page C (C 000 -CFFF) M Page B (B 000 -BFFF) M Page A (A 000 -AFFF) M Page 9 (9000 -9 FFF) M Page 8 (8000 -8 FFF) M Page 7 (7000 -7 FFF) M Page 6 (6000 -6 FFF) M Page 5 (5000 -5 FFF) M Page 4 (4000 -4 FFF) M Page 3 (3000 -3 FFF) M Page 2 (2000 -2 FFF) M Page 1 (1000 -1 FFF) M Page 0 (0000 -0 FFF) Virtual Page (0 x 78) -> Physical Page (0 x. A) Physical address = Physical Page + Page Offset = 0 x. ACDE

kuic. kyonggi. ac. kr/~dssung 11. 4 Page Replacement CPU Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung 11. 4 Page Replacement CPU Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung LRU (Least Recently Used) Algorithm Use bit : MMU Set

kuic. kyonggi. ac. kr/~dssung LRU (Least Recently Used) Algorithm Use bit : MMU Set bit whenever a page is accessed OS Clears the bit periodically Dirty bit : MMU Set bit whenever a page is modified

kuic. kyonggi. ac. kr/~dssung Dirty bit = 1 인 경우 Miss CPU Memory swap

kuic. kyonggi. ac. kr/~dssung Dirty bit = 1 인 경우 Miss CPU Memory swap out swap in Virtual Memory Swap Space in Hard Disk

kuic. kyonggi. ac. kr/~dssung CPU Memory Virtual Memory Swap Space in Hard Disk

kuic. kyonggi. ac. kr/~dssung CPU Memory Virtual Memory Swap Space in Hard Disk

kuic. kyonggi. ac. kr/~dssung Dirty bit = 0 인 경우 Miss CPU Memory swap

kuic. kyonggi. ac. kr/~dssung Dirty bit = 0 인 경우 Miss CPU Memory swap in Virtual Memory Swap Space in Hard Disk

kuic. kyonggi. ac. kr/~dssung 11. 5 Write Strategy => Write Back -> The information

kuic. kyonggi. ac. kr/~dssung 11. 5 Write Strategy => Write Back -> The information is written only to the page in the memory. The modified page block is written to virtual memory only when it is replaced. -> Multiple write in a page => One write to virtual memory -> Virtual Memory는 Hard Disc에 있으며 access time이 memory의 access time에 비하여 매우 느리다. 따라서, write through를 사용하면 매우 비 효율적이다.

kuic. kyonggi. ac. kr/~dssung Write hit Replacement Write hit CPU CPU Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung Write hit Replacement Write hit CPU CPU Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung Write Allocate CPU miss Memory write Memory read Virtual Memory

kuic. kyonggi. ac. kr/~dssung Write Allocate CPU miss Memory write Memory read Virtual Memory CPU Virtual Memory

kuic. kyonggi. ac. kr/~dssung 11. 6 Virtual Address Translation Page Table은 Main Memory내에 있으며

kuic. kyonggi. ac. kr/~dssung 11. 6 Virtual Address Translation Page Table은 Main Memory내에 있으며 이 중 사용되는 부분들이 MMU (Memory Management Unit) 내의 TLB (Translation Lookaside Buffer)내에 저장되어 있다.

kuic. kyonggi. ac. kr/~dssung CPU Virtual address MMU Physical address Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung CPU Virtual address MMU Physical address Memory Virtual Memory

kuic. kyonggi. ac. kr/~dssung Use of TLB (Translation Lookaside Buffer) in MMU (Memory Management

kuic. kyonggi. ac. kr/~dssung Use of TLB (Translation Lookaside Buffer) in MMU (Memory Management Unit) - The on-chip cache for page table - Stem from locality - Virtual address tag , Physical page-frame number Protection field, Use bit, Dirty bit

kuic. kyonggi. ac. kr/~dssung Virtual Address Virtual Page Number Page Offset Main Memory Page

kuic. kyonggi. ac. kr/~dssung Virtual Address Virtual Page Number Page Offset Main Memory Page M … TLB in MMU + Physical Address Page N … Physical Page Number Page 0 Page Table in Main Memory Virtual Address Translation with TLB

kuic. kyonggi. ac. kr/~dssung Cache와 Virtual Memory를 사용하는 경우 구성도 1 CPU Virtual address

kuic. kyonggi. ac. kr/~dssung Cache와 Virtual Memory를 사용하는 경우 구성도 1 CPU Virtual address MMU Physical address Cache Memory Virtual Memory Cache address

kuic. kyonggi. ac. kr/~dssung Cache Hit 0 x 79123 CPU Valid bit Tag Valid

kuic. kyonggi. ac. kr/~dssung Cache Hit 0 x 79123 CPU Valid bit Tag Valid Table FF 0 0 1 0 x 234 1 FE 1 0 0 x 000 … … … 0 0 x 000 2 79 1 1 0 x 01 C 78 1 A 1 0 x 01 E … 1 0 x 553 … … 7 0 0 x 000 38 1 37 0 0 x 000 0 x 2123 6 36 1 1 0 x 766 … … … 1 0 x 023 0 17 0 1 0 x 011 16 0 0 1 0 x 126 3 1 0 x 123 15 1 … 1 0 x 222 … … 0 01 0 1 0 x 111 00 0 0 1 0 x 212 C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) Virtual Page (0 x 79) -> Physical Page (0 x 2) Physical address : 0 x 2123 -> Physical address = Physical Page + Page Offset Cache address : 0 x 03 = 0 x 2123

kuic. kyonggi. ac. kr/~dssung Cache Miss 0 x 79123 CPU Valid bit Tag Valid

kuic. kyonggi. ac. kr/~dssung Cache Miss 0 x 79123 CPU Valid bit Tag Valid Table FF 0 0 1 0 x 234 1 FE 1 0 0 x 000 … … … 0 0 x 000 2 79 1 1 0 x 01 C 78 1 A 1 0 x 01 E … 1 0 x 553 … … 7 0 0 x 000 38 1 37 0 0 x 000 0 x 2123 6 36 1 1 0 x 766 … … … 1 0 x 023 0 17 0 1 0 x 011 16 0 0 1 0 x 126 3 1 0 x 123 15 1 … 1 0 x 222 … … 0 01 0 1 0 x 111 00 0 0 1 0 x 01 A C block F (F 0 -FF) C block E (E 0 -EF) C block D (D 0 -DF) C block C (C 0 -CF) C block B (B 0 -BF) C block A (A 0 -AF) C block 9 (90 -9 F) C block 8 (80 -8 F) C block 7 (70 -7 F) C block 6 (60 -6 F) C block 5 (50 -5 F) C block 4 (40 -4 F) C block 3 (30 -3 F) C block 2 (20 -2 F) C block 1 (10 -1 F) C block 0 (00 -0 F) Virtual Page (0 x 79) -> Physical Page (0 x 2) Physical address : 0 x 2123 -> Physical address = Physical Page + Page Offset Cache address : ? ? ? = 0 x 2123

kuic. kyonggi. ac. kr/~dssung Valid Table 0 x 234 C block F (F 0

kuic. kyonggi. ac. kr/~dssung Valid Table 0 x 234 C block F (F 0 -FF) FF 0 0 0 x 987 C block E (E 0 -EF) 1 FE 1 0 x. ABC C block D (D 0 -DF) … … … 0 x 01 C C block C (C 0 -CF) 2 79 1 0 x 01 E C block B (B 0 -BF) 78 1 A Cache Miss 0 x 553 C block A (A 0 -AF) … … … 0 x 922 C block 9 (90 -9 F) 7 38 1 0 x 812 C block 8 (80 -8 F) 37 0 0 0 x 79123 0 x 2123 0 x 01 F C block 7 (70 -7 F) 6 36 1 CPU 0 x 023 C block 6 (60 -6 F) … … … 0 x 011 C block 5 (50 -5 F) 0 17 0 0 x 126 C block 4 (40 -4 F) 16 0 0 3 0 x 212 C block 3 (30 -3 F) 15 1 … 0 x 222 C block 2 (20 -2 F) … … 0 x 111 C block 1 (10 -1 F) 0 01 0 0 x 01 A C block 0 (00 -0 F) 00 0 0 Memory

kuic. kyonggi. ac. kr/~dssung 왜, Virtual Memory를 이용하는가 ? -> Computer can execute the

kuic. kyonggi. ac. kr/~dssung 왜, Virtual Memory를 이용하는가 ? -> Computer can execute the program which size is bigger than main memory. Hit CPU Memory ex) Memory Size = 64 Kbyte program Swap Space in Hard Disk Virtual Memory ex) Program Size = 1 M byte

kuic. kyonggi. ac. kr/~dssung -> Computer are running multiple processes with its own address

kuic. kyonggi. ac. kr/~dssung -> Computer are running multiple processes with its own address space (Divide physical memory into blocks(pages) and allocates them to different processes) CPU Memory program Virtual Memory