Base Register copy

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Base Register:

Each process has the separate memory space


Limit Register:
Use to define range of legal addresses.

 Every process has the separate base and limit. But we can say based on
scenario, limit of one process can be same for the next base of process.
 If base is greater than CPU address then it goes to next process, otherwise
trap occurs. And if base + limit is less than the address then it goes to
physical memory, otherwise error occurs.

 At compile time, address of logical and physical are same, but at execution
time, they are different.

Partition are of 2 types (MFT, MVT)


MFT: No of partition are fixed & in different sizes.
MVT: No of partition are not fixed & sizes varies accordingly.

Partition Allocation Policies:


First (allocate the process in the first pre large enough partition)
best (in the smallest possible memory partition)
worst (largest possible memory partition)
next (same as the first fit but is doesn’t start from first position.
NUMERICAL
Given 5 memory partition of 100k, 500k, 200k, 300k, 600k in order. How they are
in first, best and worst placed. The values of places 212kb, 417kb, 112kb, 426kb in
order.

MEMORY ALL. FIRST FIT BEST FIT WORST FIT BEST FIT
100k
500k P1 P2 P2
200k P3 P3
300k P1 P3
600k P2 P4 P1

Paging: physical memory and fixed sized.


Segmentation: logical memory and variable sized. Each segment has a name and
number.
Sag. no limit Base Address
0 300 1000
1 700 2000
2 900 3000
3 1100 4000

Displacement<limit  if this condition is false, trap/error occurs. If this condition


is true, it goes to add (+) condition (Base + displacement).
Sag. no limit Base Address P.M (B + L)
0 800 1000 1000
1 1000 2000 1800
2 700 4200 2000
3 1100 5000
Sag. no Length Base Address P.M (B + L)
0 600 219 649
1 14 2300 2310
2 100 90 Trap
3 580 1327 1727
4 96 1925 Trap

3rd and 5th segment are trap because displacement>limit.


Paging: process divided into equally sizes & put it into frames of main memory.
 Frame size = page size (must be equal) , if page size is small , frame size
must be large.
 Page size divided by process => no of pages.
 Every process have its own page table.
 Page Table = frame number.
Example Consider a table which has logical address 7 bit, physical address 6
bit, page Size 8 words. Calculate number of pages and number of frames.

You might also like