retagged by
2,929 views
6 votes
6 votes
Consider a disk with $c$ cylinders,  $t$ tracks per cylinder, $s$ sectors per track and a sector length $s_l$. A logical file $d_l$ with fixed record length $r_l$ is stored continuously on this disk starting at location $(c_L, t_L, s_L)$, where $c_L, t_L$ and $S_L$ are the cylinder, track and sector numbers, respectively. Derive the formula to calculate the disk address (i.e. cylinder, track and sector) of a logical record n assuming that $r_l=s_l$.
retagged by

5 Answers

12 votes
12 votes

GIVEN: Consider a disk with c cylinders,  t tracks per cylinder, s sectors per track

from this, we can conclude that 1 cylinder contains = t*s sectors

and one track contains =s sectors

now we have to drive the formula of logical address n

so the cylinder no is $\left \lfloor \left ( \frac{n}{ts} \right ) \right \rfloor$

and track number will be floor of ( (n%ts)/s)

and sector no will be n%s

edited by
1 votes
1 votes
disk address= cL(C)+tL(t)+SL(s)

we must know the cylinder number and track number in advance then only we can calculate the address of of record
1 votes
1 votes

Here logical file size d1

Now , d1 has n records of size r1

So, d1= n r1

No of sectors for the file say (sec)=n r1 % s [Now, r1=s1, then sec=0]

No of tracks say (track) =sec % t

No. of cylinder say (cyl)= sec / t

Now, disk address of the logical record is <cL ,tL , sL>+  <cyl, track,sec>

0 votes
0 votes

n%s will give the number of sectors left after making n records as groups of 's' sectors.

Now we need to add it to S​​​​​L and check whether it will fill the current track and if yes then we will have to take that into consideration too.

Therefore, sector number of the nth record will be, let Sn= [ S​​L + (n%s) ]%s

Now for finding track number,we start with total number of tracks = n/s.

BUT we again need to check whether on adding it to T​​​​​​L, will it fill the current track.

 

Temp=[ S​​L + (n%s) ]÷s ,

just consider the non fractional part, it will tell us whether we need to jump track for leftover sectors. If 0._ that means we don't need extra track or else if 1._ then we need one extra track jump.

Therefore, track number of the nth record will be, let Tn = T​​​​​​L + (n/s) + Temp

And cylinder number of nth record Cn = C​​​​​​L + (Tn - T​​​​​​L)/t

Related questions

26 votes
26 votes
3 answers
1
Kathleen asked Sep 26, 2014
5,183 views
Free disk space can be used to keep track of using a free list or a bit map. Disk addresses require $d$ bits. For a disk with $B$ blocks, $F$ of which are free, state the...
22 votes
22 votes
3 answers
3
Kathleen asked Sep 25, 2014
7,336 views
Formatting for a floppy disk refers toarranging the data on the disk in contiguous fashionwriting the directoryerasing the system datawriting identification information o...
45 votes
45 votes
4 answers
4