A swapping system eliminates holes by compaction. Assuming a random distribution of many holes and many data segments and a time to read or write a 32-bit memory word of 4 nsec, about how long does it take to compact 4 GB? For simplicity, assume that word 0 is part of a hole and that the highest word in memory contains valid data.

Respuesta :

Answer:

The compaction time is 8192 s

Explanation:

Compaction time = (read + write) × Memory address.

Compaction time = 2 × 4⁻⁹s × Memory address

Memory address can be estimated as follows:

given;

data size = 4 GB = (4 x 2³⁰) bytes

memory = 32-bit  = 4 bytes

Memory address [tex]=4.GB*\frac{(2^{30})bytes}{1.GB} *\frac{1}{4.bytes} = 2 ^{30}[/tex]

Compaction time = 2 × 4⁻⁹s ×2³⁰

                             [tex]= 2^1 X 2^2^{(-9)} X 2^{30}\\\\= 2^{31} X 2^{-18}\\\\=2^{(31-18)}\\ =2^{13} s\\\\= 8192 s[/tex]

Therefore, the compaction time is 8192 s