in Operating System edited by
10,222 views
33 votes
33 votes

A hard disk has $63$ sectors per track, $10$ platters each with $2$ recording surfaces and $1000$ cylinders. The address of a sector is given as a triple $\langle c, h, s \rangle$, where $c$ is the cylinder number, $h$ is the surface number and $s$ is the sector number. Thus, the 0$^{th}$ sector is addresses as $\langle 0, 0, 0 \rangle$, the 1$^{st}$ sector as $\langle 0, 0, 1 \rangle$, and so on

The address of the 1039$^{th}$ sector is

  1. $\langle 0, 15, 31 \rangle$
  2. $\langle 0, 16, 30 \rangle$
  3. $\langle 0, 16, 31 \rangle$
  4. $\langle 0, 17, 31 \rangle$
in Operating System edited by
10.2k views

4 Comments

@chauhansunil20th 15 is taken because we need to cross 0 to 14 platters (15 platters) each with 63 sectors.

can u explain this line bit more. i m not getting how 1 platter has 63 sectors. There are 63 sectors per track and there may be many tracks per surface. 

0
0
edited by
in this question we have find address of 1039 sector .

but we have total sector=1039+1=1040 because
0th sector=1

 1st sector=2

2nd sector=3

3rd sector=4

.....................................

1039 sector=1040

1040/63=16.50793650793651(16 completely filled and 1 partially filled ,so total number of surface is 17)

sector covered in 16 surface is =16*63=1008

so remaining sector is=1040-1008=32

address start with 0 so, 32-1=31

<0,16,31>
0
0

surface = 1039/63 = 16th surface

sector = 1039mod63 = 31th sector 

0
0

5 Answers

57 votes
57 votes
Best answer

$1039^{th}$ sector will be stored in track number $(1039 + 1)/63 = 16.5$ (as counting starts from $0$ as given in question) and each track has $63$ sectors. So, we need to go to $17^{th}$ track which will be numbered $16$ and each cylinder has $20$ tracks $(10$ platters $\times 2$ recording surface each) . Number of extra sectors needed $= 1040-16 \times 63 = 32$ and hence the sector number will be $31$. So, option (C). 

edited by

4 Comments

@ayushak, if we count from 0th sector to 1039th sector, we get 1040 sectors. That is why doing +1 is necessary. 

Coming to your statement,

Because then (62+1)/63 will give 1 but it should be 0.

No it should not be 0 but 1. Because this expression gives the number of tracks required to accommodate the given number of sectors. It doesn’t give the track number. Both are different here. To accommodate sectors upto  sector 62 (i.e. total 63 sectors), only 1 track is needed. This track is numbered 0, but track count is 1 only. 

This question is a bit confusing due to the combination of indexing starting from 0 as well as numbering of indexes also starting from 0.

0
0
@shantanu4raje, I thought that expression gives track number.

Just to clarify, so floor(track number/63) gives track number right?
0
0

@ayushak, by the following statement,

Just to clarify, so floor(track number/63) gives track number right?

maybe you mean “floor(sector number/63) gives track number”. This expression gives the track count not the track number. Generally, track count and track number are same but here, track count = track number + 1. For example, the track count upto 2 (i.e. 0, 1 and 2) is 3 but the track number is 2 only.

In my previous reply, I had written 

 Because this expression gives the number of tracks required to accommodate the given number of sectors.

here, by the number of tracks, I mean track count (i.e. “how many tracks”) not track number.

1
1
11 votes
11 votes

a sector address is given like this $\langle c, h, s \rangle$ so it means that, we traverse in this way:

this all is happening in a single cylinder:
means first move sector wise(covering a track on a surface),
when all sector are over change the surface (also means a single track is over)

then move in all surfaces(a cylinder has $2\times 10 = 20$ total surfaces) as done previously,
when all surface are over then at last move into next cylinder

for a single track, it has 63 sectors
for a single surface, it has 1 track = 63 sectors
this means that for a single cylinder, it has 20 surfaces = 20 tracks = 20 $\times$ 63 sectors

on checking option C:
$\langle0,16,31\rangle$
Number of sectors to be crossed $= 0+ (16 \times 63) + 31 \\ = 1039$

option C is the answer

@cse23

edited by

4 Comments

@Satbir bhai mujhe bhi ye doubt hai jo kuljeet bhai ne pucha. could u explain ?

0
0
They have given $<c,h,s >$ to reach a sector and on a surface we will have $1$ track in which there will be $63$ sectors. If there would had been multiple tracks per surface then they would have either mentioned it or given address format like $<c,h,t,s>$ where $t$ means track number.

On the contrary , if you assume more than $1$ track per surface then how will you address a sector using $<c,h,s>$ only ?
0
0
@amar ji how does 1 surface have 1 track? As there are 1000 cylinders, should there not be 1000 tracks? Please correct me.
0
0
7 votes
7 votes
track no= $\frac{1039}{63}$ =$16.492063492063492063492063492063 ....$ so track no = $16 ..$

now i am considering the fractional part ... sector no=$0.492063492063492063492063492063* 63 = 31$

so the address is $\langle0,16,31\rangle $....  

correct me if i am wrong ...
edited by

3 Comments

Can u explain what's the logic behind multiplying the fractional part by no of sectors to get the sector number
0
0
think of it like this way, 1 track has 63 sectors, therefore to find the location of 1039 sector we need to divide it  by 63.
Now after dividing we get 16.4920634920634920  , this means that our sector lies somewhere between 16 and 17 track that means 16 track for sure.
now we reached 16 track , now we need to go to sector on 16th track. So multiplying this fractional part should give us the sector number. This is why we multiply it.
0
0
better do like this to get the remainder : 1039 - 16*63 = 31
3
3
0 votes
0 votes

(C) IS THE CORRECT ANSWER

1st sector start at <0,0,0> (in the question they are calling the 1st sector as the 0th sector) 

so, if we are asked to calculate the address of the 1039th sector and if we go by our assumption then they must be asking about the address of the 1040th sector.

Now, we have to calculate the <c,h,s> i.e. the cylinder number, the surface number and the sector number.

First, let's calculate the cylinder number:

we know that a cylinder will contain= 10x2x63 sectors = 1260 sectors and we need the address of the 1040th sector so it is clear that the 1040th sector is inside the 1st cylinder only, and in the question, they are representing the address of the 1st cylinder as 0 so c = 0.

Second, lets calculate the surface number: 

a surface will contain = 63 sectors (NOTE: if h starts from 0 then for any number h it means that we have to cross that many surfaces in order to get to the surface we want) h = 1040/63 = 16.507 (it means that we have to cross 16 surfaces) so, h = 16.

now calculate the remaining sectors = 0.507 x 63 = 31.941 (it means that we have to cross 31 sectors) so, s=31.

hence, <c,h,s> = <0,16,31>

edited by
Answer:

Related questions