Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders…
20132013
Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each track contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is <cylinder no., surface no., sector no.>. A file of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?
Answer: D. 1284 — Concept: On a cylinder/surface/sector (CHS) addressed disk with cylinder-major layout, every sector maps to one linear index: cylinder × (sectors per…
- A.
1281
- B.
1282
- C.
1283
- D.
1284
Attempted by 115 students.
Show answer & explanation
Correct answer: D
Concept: On a cylinder/surface/sector (CHS) addressed disk with cylinder-major layout, every sector maps to one linear index: cylinder × (sectors per cylinder) + surface × (sectors per track) + sector. To find where a contiguous file ends, convert its starting address and its length (in sectors) into this linear index, add them, and convert the resulting index back into a cylinder number by integer division.
Application:
File size in bytes: 42797 KB × 1024 = 43,824,128 bytes (using 1 KB = 1024 bytes).
Sectors needed: 43,824,128 ÷ 512 = 85,594 sectors.
Sectors per cylinder: 16 surfaces × 64 sectors/track = 1,024 sectors.
Absolute (linear) index of the starting sector
<1200, 9, 40>: (1200 × 1024) + (9 × 64) + 40 = 1,229,416.Absolute index of the file's last sector: 1,229,416 + 85,594 − 1 = 1,315,009.
Cylinder number = floor(1,315,009 ÷ 1024) = 1284, remainder 193 (surface 3, sector 1 of that cylinder).
Cross-check: Cylinder 1200 has 1024 − (9×64+40) = 408 sectors available from the starting sector onward (inclusive). The remaining 85,594 − 408 = 85,186 sectors fill 83 whole cylinders (83 × 1,024 = 84,992), leaving 194 sectors that spill into one more cylinder. So the file spans the start cylinder plus 83 full cylinders plus 1 partial cylinder: 1200 + 84 = 1284 — the same cylinder as above.
So the last sector of the file lies in cylinder 1284.
A video solution is available for this question — log in and enroll to watch it.