CPU Problem
  1. For FCFS, here is the Gantt chart:

    job from to
    p1 0 120
    p2 120 180
    p3 180 360
    p4 360 410
    p5 410 710

    Here is the computation of the turnaround times

    job arrival completion turnaround time
    p1 0 120 120
    p2 0 180 180
    p3 50 360 310
    p4 100 410 310
    p5 250 710 460
    avg 276
  2. For SJN, here is the Gantt chart:

    job from to
    p2 0 60
    p1 60 180
    p4 180 230
    p3 230 410
    p5 410 710

    Here is the computation of the turnaround times

    job arrival completion turnaround time
    p1 0 180 180
    p2 0 60 60
    p3 50 410 360
    p4 100 230 130
    p5 250 710 460
    avg 238
  3. For Round Robin with timeslice of 30, here is the Gantt chart:

    job from to (remaining)
    p1 0 30 90
    p2 30 60 30
    p3 60 90 150
    p1 90 120 60
    p2 120 150 completed
    p3 150 180 120
    p4 180 210 20
    p1 210 240 30
    p3 240 270 90
    p4 270 290 completed
    p5 290 320 270
    p1 320 350 completed
    p3 350 380 60
    p5 380 410 240
    p3 410 440 30
    p5 440 470 210
    p3 470 500 completed
    p5 500 710 completed

    Here is the computation of the turnaround times

    job arrival completion turnaround time
    p1 0 350 350
    p2 0 150 150
    p3 50 500 450
    p4 100 290 190
    p5 200 710 510
    avg 330

Page-Map Addressing

  1. logical address 85= 0*1024 + 85;
    thus <page,offset> = <0,85>;
    since Page 0 is mapped to Frame 5, physical address is 5*1024 + 85 = 5205.

  2. logical address 2359= 2*1024 + 311;
    thus <page,offset> = <2,311>;
    since Page 2 is mapped to Frame 7, physical address is 7*1024 + 311 = 7479.

  3. logical address 5000= 4*1024 + 904;
    thus <page,offset> = <4,904>;
    This is an illegal address, as no such Page 4 is defined.


Michael Goldwasser
Last modified: Monday, 01 November 2004