Calculating  C/H/S
Home Weekly Schedule Notes & Homework More Notes! News & Discussion Project 1 Project 2 Project 3 Project 4 Disk DEBUG Calculating  C/H/S
2003-05-04 01:19

Calculating Cylinder / Head / Sector

If a particular disk has 6 surfaces and 50 sectors/track, what is the C/H/S (Cylinder/Head/Sector) location of absolute disk sector 454 (all values in decimal)?

Method: Calculate how many full cylinders and tracks precede the given sector.

Our desired sector is number 454, therefore 454 sectors precede it (those preceding disk sector numbers are #0 through #453 inclusive).

Calculate the number of full cylinders: C
Subtract the sectors contained in full cylinders that precede given sector.
Each cylinder contains 6 surfaces times 50 sectors = 300 sectors/cylinder.
Dividing 454 by 300 gives: 1 full cylinder with a remainder of 154 sectors.
Therefore, one full cylinder precedes sector number 454.
That cylinder is numbered zero, because cylinders number from zero.
Cylinder zero is full, so the cylinder that contains our sector must be the next (not full) cylinder after cylinder zero.  That cylinder is number 1.
Therefore: C = 1
Calculate the number of full tracks: H
(Each track corresponds to a different surface and a different head.  Track = head = surface.)
Subtract, from the sectors that remain, the sectors contained in full tracks that precede the given sector.
(These full tracks are in cylinder 1, calculated above.)
Each track contains 50 sectors.
Dividing the remaining 154 sectors by 50 gives: 3 full tracks with a remainder of 4 sectors.
Therefore, in cylinder 1, 3 full tracks precede sector number 454.
Those 3 tracks are numbered 0,1,2, because the heads (tracks) number from zero.
Tracks 0-2 are full, so the track that contains our sector must be the next (not full) track after track 2.  That track is number 3.
Therefore: H = 3
Calculate the number of full track sectors: S
(Reprise: We calculated that cylinder 0 is full; tracks 0,1,2 of cylinder 1 are also full.)
How many sectors remain in cylinder 1, track 3 that precede the given sector?
The remainder of 4 above tells us that, in track 3 of cylinder 1, four track sectors precede sector number 454.
Those four track sectors are numbered 1,2,3,4,  because track sectors number from one (not from zero).
Track sectors 1-4 are full, so the track sector that contains our sector must be the next sector after track sector 4.  That track sector number is 5.
Therefore: S = 5

Therefore, disk sector 454 is located at (decimal) C/H/S = 1/3/5


Web Author: Ian! D. Allen      Updated: 2003-05-04 01:19

Internet Free Zone Level 1 logo Support free and non-commercial Internet.

Any Browser logo This site works best in Any Browser, a campaign for non-specific WWW.

Creative Commons License logo This work is licensed under a Creative Commons License.