GATE / CS ARCHIVE

SIMILAR QUESTIONS / OPERATING SYSTEMS

Convert between CHS and logical sector numbers

2 questions solved the same way, newest first. Back to Operating Systems

How these are solved

The shared disk geometry gives zero-based mixed-radix addressing. One part encodes cylinder/head/sector to logical sector, the other decodes a different logical sector with quotient/remainder.

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Convert cylinder-head-sector address

I/O & Disk Scheduling

Question 51, GATE 2009: Disk has 63 sectors/track, 10 platters with 2 surfaces each, 1000 cylinders. Zero-based address(c, h, s) orders sectors then surfaces then cylinders. Convert(400, 16, 29) to linear sector index: A 505035; B 505036; C 505037; D 505038.
Question 51, GATE 2009: Disk has 63 sectors/track, 10 platters with 2 surfaces each, 1000 cylinders. Zero-based address(c, h, s) orders sectors then surfaces then cylinders. Convert(400, 16, 29) to linear sector index: A 505035; B 505036; C 505037; D 505038.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

There are 10×2=20 recording surfaces, hence 20 tracks per cylinder. With 63 sectors per track and all indices starting at zero, linear sector index = ((c×20)+h)×63+s. For (400, 16, 29) this is (8000+16)×63+29=505008+29=505037, option C. No one-based correction applies because the shared statement explicitly labels the first sector (0, 0, 0) as sector 0.

There are 20 tracks per cylinder because each recording surface supplies one track at that radius. Convert cylinder and surface to track index 400·20+16=8016. Convert to sector index 8016·63+29=505037. Every multiplication moves one level down the address hierarchy. The explicit zero-based convention means no extra 1 is added at the end.

Original paper, page 11

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Convert sector number to disk address

I/O & Disk Scheduling

Question 52, GATE 2009: For the same disk with 20 surfaces/cylinder and 63 sectors/track, convert zero-based linear sector 1039 to(c, h, s): A(0, 15, 31); B(0, 16, 30); C(0, 16, 31); D(0, 17, 31).
Question 52, GATE 2009: For the same disk with 20 surfaces/cylinder and 63 sectors/track, convert zero-based linear sector 1039 to(c, h, s): A(0, 15, 31); B(0, 16, 30); C(0, 16, 31); D(0, 17, 31).
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Each cylinder contains 20×63=1260 sectors. Divide 1039 by 1260: cylinder c=0 with remainder 1039. Then 1039=16×63+31, giving surface h=16 and sector s=31. Thus the address is (0, 16, 31), option C. This uses the zero-based indexing explicitly defined in the common data on physical page 11.

Invert the mixed-radix calculation. One cylinder spans 1260 sectors, so 1039 lies in cylinder 0. Divide the remainder by 63: quotient 16 is the surface and remainder 31 is the sector. Check by recomposition:((0·20)+16)·63+31=1039. This is C; options differing by one reveal the common mistake of silently switching to one-based counting.

Original paper, page 12