Consider the following segment table a What arc the physical

Consider the following segment table: (a) What arc the physical addresses for the following virtual addresses? (i) 4, 44 (ii) 1, 22 (b) Briefly compare segmentation to paging.

Solution

Answer

a.

i.

Check in 4th segment if (offset < segment limit)
   (44<96), so it is OK
   Physical address = 2200 + 44 = 2244

ii)

Check in 1st segment if (offset < segment limit)
   (22<600), so it is OK
   Physical address = 444 + 22 = 466

b

Paging – Computer memory is divided into small partitions and every partition is of the same size and referred to as, page frames. When a process is loaded, the whole process gets divided into pages which are of the same size as those previous frames. After the division, the process pages are loaded into the frames.

Segmentation – Computer memory is allocated in various sizes, which is refered to as segments, depending on the need for address space by the process. These segments can be individually protected or shared between processes. One of the common error called “Segmentation Faults” in programs occur because the data that is about to be read or written is outside the permitted address space of that process.

So below differences can be derived for the two:

Paging:
i. Transparent to programmer (system allocates memory)
ii. No separate protection available
iii. No separate compiling needed
iv. No shared code allowed

Segmentation:
i. Involves programmer (allocates memory to specific function inside code)
ii. Separate compiling needed
iii. Separate protection available
iv. Sharing of code allowed

 Consider the following segment table: (a) What arc the physical addresses for the following virtual addresses? (i) 4, 44 (ii) 1, 22 (b) Briefly compare segment

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site