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 cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is . A file of size 42797 KB is stored in the disk and the starting disk location of the file is . What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?
- A.
1281
- B.
1282
- C.
1283
- D.
1284
Attempted by 67 students.
Show answer & explanation
Correct answer: D
Key insight: convert the file size to sectors, find how many sectors fit in a cylinder, then compute how many cylinders are needed and the last cylinder number.
File size in bytes: 42797 KB = 42797 × 1024 = 43,824,128 bytes (assuming KB = 1024 bytes).
Total sectors needed: 43,824,128 / 512 = 85,594 sectors.
Sectors per cylinder: 16 surfaces × 64 sectors = 1,024 sectors per cylinder.
Cylinders required: ceil(85,594 / 1,024) = 84 cylinders.
Last cylinder calculation: if the file starts at cylinder 1201, the last cylinder is 1201 + 84 − 1 = 1284.
Conclusion: the last sector of the file is in cylinder 1284. (This uses KB = 1024 and assumes contiguous allocation and that the starting cylinder is 1201 as implied by the answer.)
A video solution is available for this question — log in and enroll to watch it.