GATE / CS ARCHIVE

GATE CSE 2013 / QUESTION 29

Last cylinder of a contiguous disk file

Computer Organization & Architecture · Secondary Storage · Full GATE CSE 2013 paper

GATE 2013, Q29 2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Secondary Storage

Question 29, GATE 2013: A disk has 16 surfaces, 16384 cylinders, 512 bytes/sector and the source says 64 sectors per cylinder. A contiguous 42797 KB file begins at<cylinder 1200, surface 9, sector 40>. Find last cylinder: A1281, B1282, C1283, D1284. The answer model interprets64 sectors per surface-track and KB=1024 bytes.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: D under 64 sectors per track and binary KB

Using the intended geometry, each cylinder has 16×64=1024 sectors and each 512-byte sector is half a KiB. The file occupies 42797×2=85594 sectors. Its starting within-cylinder offset is 9×64+40=616. The last sector is therefore at cylinder 1200+floor((616+85594−1)/1024)=1284, D. The source literally says each cylinder contains 64 sectors, but also supplies a surface coordinate and uses the geometry above in the key. The calculation needs 64 sectors per surface-track, rather than per entire cylinder, and KB=1024 bytes; these are explicit intended interpretations.

Under the intended track geometry, one cylinder contains 16×64=1024 sectors, hence 512 KiB. Convert the file to sectors:42797 KiB×1024/512=85594. The starting surface/sector is offset 9×64+40=616 within cylinder 1200. Numbering the first file sector as offset 0 makes its last sector offset 85593, so the combined last offset is 86209. Divide by 1024:84 full cylinders and remainder 193. Add84 to 1200 to obtain 1284. Subtracting1 before the division prevents an off-by-one error for a file ending on a cylinder boundary.

Original paper, page 6 · Answer key