---
# System prepended metadata

title: 第13周

---

# 題目
* 林子皓
Which of the following is correct?
(A)cpu will send logical addresses when Execution-time address-binding scheme.
(B)if the starting address changes the code must be recompiled
(C)when Compile time & Load time address binding，logical address not equal physical address
(D)when Execution-time address binding ，logical address equal  physical address

ans:B
* 楊秉沅
A computer has 1000K of main memory.The jobs arrive and finish in the following sequence.
Job 1 requiring 270K arrives
Job 2 requiring 310K arrives
Job 3 requiring 190K arrives
Job 2 finishes
Job 4 requiring 190K arrives
Job 5 requiring 220K arrives
Job 6 requiring 100K arrives
Among best fit and first fit,which perform better for this sequence?
(A)First fit
(B)Best Fit
\(C)Both perform the same
Ans:(A)
First fit
|Job1|Job4|Job6|20|Job3|Job5|10|
Best fit
|Job1|Job5|90|Job3|Job4|40| 
Job 6 unable get memory to execute

* 王尚鵬
According to the logical memory, the page table, and the physical memory, please determine the result of following p and d:
(1) (p,d)=(0,2)
(2) (p,d)=(2,1)
(3) (p,d)=(3,0)

Ans:
(1):c
(2):j
(3):m

![image](https://hackmd.io/_uploads/BJRIdxdXke.png)






楊閔恩
Please explain the advantages and disadvantages of dynamic linking and static linking.

Ans:
**dynamic linking**

Advantages: Can save memory usage.
Disadvantages: Execution speed might be slower since the dynamic library needs to be loaded during runtime, and it requires operating system support.

**static linking**

Advantages: Execution speed might be faster, and it does not require operating system support.
Disadvantages: Uses more memory.