# ¦´||"!

·+"´¬-:¨¬-¹·:·"````¹
`|" `|" `|" `|" ¨> ¨> ¨> ¨>94 94 94 94 4 44 4 80 80 80 80 | || |( (( (`"· `"· `"· `"·` `` ` · l ¯` l ¯
´¹ ´¹ ´¹ ´¹ ·..{´¬-: ·~¹ ·~¹ ·~¹ ·~¹ -· ´ ´´ ´ · ·· · :¹ :¹ :¹ :¹ ]×¸
`|| `|| `|| `|| ``|'` `W´ `W´ `W´ `W´ ·-· 09·00·l0·80
1. (15°)
(a). DeIine the diIIerence between preemptive and nonpreemptive CPU scheduling.
(b). State why strict nonpreemptive CPU scheduling is unlikely to be used in a computer center.
2. (15°)
(a). Write a correct soItware solution to the critical-section problem Ior two processes.
(b). Prove your algorithm in (a) satisIies all three requirements Ior the critical-section problem.
3. (10°)
Consider the Iollowing snapshot oI a system:
Allocation Max Available

P
0
0 0 1 2 3 0 1 2 1 4 2 0
P
1
1 0 0 0 1 9 5 0
P
2
1 3 3 4 2 3 6 6
P
3
0 2 3 2 0 6 5 2
P
4
0 0 1 2 0 6 5 9
Please use the banker`s algorithm to determine whether the system is in a saIe state?
4. (10°)
Given memory partitions oI 100 KB. 500 KB. 200 KB. 300 KB. and 600 KB (in order). how would each oI the Iirst-Iit.
best-Iit. and worst-Iit algorithms place processes oI 212 KB. 417 KB. 112 KB. and 426 KB (in order)? Which algorithm
makes the most eIIicient use oI memory?
5. (10°)
Assume that we have a demand-paged memory. The page table is held in registers. It takes 8 milliseconds to service a page
Iault iI an empty Irame is available or iI the replaced page is not modiIied. and 20 milliseconds iI the replaced page is
modiIied. Memory access time is 100 nanoseconds.
Assume that the page to be replaced is modiIied 70 percent oI the time. What is the maximum acceptable page-Iault rate
Ior an eIIective access time oI no more than 200 nanoseconds?
6. (15°)
(a). What is pipelining?
(b). What is DMA?
(c). Why memory hierarchy is useIul and important in a computer system?
7. (10°)
Please represent the decimal number. 212.125. with IEEE 754 single precision Iloat point Iormat.
8. (15°)
Sketch a truth table and logic gates oI a binary adder Ior a 2-bit addition. And. explain how it works Ior 11
2
¹01
2
.

· `
l, l, l, l,`´·´. `´·´. `´·´. `´·´. --··¯´`· --··¯´`· --··¯´`· --··¯´`· `´¦´. `´¦´. `´¦´. `´¦´.
2, 2, 2, 2,5`·.´. 5`·.´. 5`·.´. 5`·.´. `·´·´.¯´`~ `·´·´.¯´`~ `·´·´.¯´`~ `·´·´.¯´`~
`¹.+·`"l,`¹+¨´´°÷`+·"·]¨¬`I¦÷¨·|~¯´°+`·+·`
2,÷¨W`·¹¹´¨´°¯·

Sign up to vote on this title