[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [ 86 ] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117]

SUBROUTINE FIFO [REF.W.FRm.PAGES}

" (1) ,fiEF(2).....REF(N,

"frames-

, "PAGES= - -

. -

FIFO ( - !

- }. -

REF{1)...REF(N), FAULTd)

.,,(),- FAULT(1)«=1, REF(IJ

, FAULTd)=0 0001

.

*

,

PEF(U...REF(N)

FRAMES

PAGES

FAUL{1),,.FAULT(N1 ! REFfl)

FRAHEd) ,

i

TABLEdJ -j ;, 1 J

.=6 6

total

INTEGER REF(fl) .FRAMES.PAGES . INTEGER FAULTdOOO) ,FRAH£(50) ,P;TABUEt1C0l .TOTAL

10 1 = 1,N FA.ULTdJ =0 1 CONTINUE P=PAGES+1 20 I = 1.P TAELECI) « 0 20 CONTINUE

EO 3D I » 1,FRAMES FRAMEd) a P 30 CONTINUE 0 = 1 TOTAL « D

. 5.4.2. FIFO.



fiEF(1)...REF(N)

100 I " 1,N

- BEFdJ

IF( TABUE(K) .NE. 0) 60 TO 100

MS FfiAME(Jl J?A3-

L = FRAME(J) TABLE(L) = TAELE(K) = I FRAME(J) =

J =. J - J/FRAHES» FRAMES + 1 FAULTtO = 1 TOTAL = TOTAL +1 10C CONTINUE *

WRITE (6,900) FRAMES,PAGES 900 F0RMAT(1H0,3eHArrOPMTH , 1 FIFO ,I3,12H , 13,8 )

WplTE (6,950)

550 FURMAT(1HD.38HCTP0KA 1 7HD0TKA3OB)

WRITE (6,1000) (REF(I),,I=1,N) WRITE (6,1000) (FAULT(I),I-1,N) F0RMAT(1H0,40I3)

«FRAMES=. -

TOTAL » TOTAL - FRAMES-RATE FLOAT(TOTAL) / (N - FRAMES) WRITE (6.1010) TOTAL,BATE 1010 0(10,0 , 13,11 I 1 6 ,F6.31

RETURN END

. 5.4.2.

AFTER (/). FRONT , . , , FRONT, ( ), , , END . , , END. . 5.4 3 LRU.



SUBROUTINE LRU (REF.N.FfiAXES.PAGES)

;10 LRU,

. . . REF(I)...BEF(N). - FAULTd)...FAULT(N), FAULT(I)-1, REFtI) , FAULTd)=0 .

===

REF(1)...riEF(N)

FRAMES

PAGES

==

BEFORE! I) AFTERd)

FAULT(I)

FRONT,END

J

TABLE(I)

TOTAL

, BEFORECI) (AFTERd)) - , () I

e1 REFd) , =0

FRONT (END) , ( )

==J I J, =0

; REF(1)...REF(N)

. 5.4.3. LRU



[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [ 86 ] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117]

0.0013