Question
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?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2013 answer key
Solution
Compute the total number of sectors required for the file and add to the starting linear sector index, taking into account the disk geometry.
Let us analyze the disk parameters:
- Number of surfaces = 16 (numbered 0 to 15).
- Number of cylinders = 16384 (numbered 0 to 16383).
- Number of sectors per track on each surface = 64 (numbered 0 to 63).
- Therefore, number of sectors per cylinder sectors.
- Capacity per sector = 512 bytes KB.
Now calculate the file size in sectors:
Next, determine the linear sector index of the starting position :
- The cylinder number is 1200.
- Preceding cylinders (0 to 1199) contribute: sectors.
- Within cylinder 1200, surface 9 sector 40 is at relative sector offset: .
- Thus, starting linear sector index .
The file spans 85594 contiguous sectors. The linear index of the last sector of the file is:
Now, find the cylinder number of this last sector by dividing by the number of sectors per cylinder (1024):
Therefore, the last sector of the file lies in cylinder 1284.
D
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2013 Computer Science and Information Technology (CS)
- Question
- 29 of 65, printed as CS Q.29
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.