Professional Documents
Culture Documents
Lecture18 19
Lecture18 19
Lecture18 19
Main memory and the registers built into the processor itself are
the only storage that the CPU can access directly.
PROGRAM 0
j 1200
OS OS OS OS OS OS OS OS OS
compaction
P1 P1 P1 P1 P1 P5 P5
P4 P4 P4 P4
P2 P2
P3
P3 P3 P3 P3 P3 P6
Divide physical memory into fixed-
sized blocks called frames (size is Virtual Physical
power of 2, between 512 bytes and Page # Page #
8192 bytes) 0x0000
0 0 0x0000
1 1
Divide logical memory into blocks of 2 2
same size called pages. 3 3
4 4
Any virtual page can be located at 5 5
any physical page 0x6000
6
0x0000 7
Translation box converts from virtual 0
8
pages to physical pages 1
9
2
10
3
0x4000 11
12
Translation
13 0xE000
Address generated by CPU is divided into:
◦ Page number (p) – used as an index into a page table
which contains base address of each page in physical memory
◦ Page offset (d) – combined with base address to define the
physical memory address that is sent to the memory unit
Page Size=
4bytes
Physical
Memory=
32bytes
In paging we have no external fragmentation. Any free frame
can be allocated to a process that needs it. However, we may
have some internal fragmentation?