edited by
29,771 views
80 votes
80 votes

Consider a hard disk with $16$ recording surfaces $(0-15)$ having $16384$ cylinders $(0-16383)$ and each cylinder contains $64$ sectors $(0-63)$. Data storage capacity in each sector is $512$ bytes. Data are organized cylinder-wise and the addressing format is $\langle \text{cylinder no.}, \text{surface no.}, \text{sector no.} \rangle$ . A file of size $42797$ KB is stored in the disk and the starting disk location of the file is $\langle 1200, 9, 40\rangle$. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?

  1. $1281$
  2. $1282$
  3. $1283$
  4. $1284$
edited by

10 Answers

2 votes
2 votes

Surface$:16(0-15)$ Cylinders$:16384(0-16383)$ Sectors$:64(0-63)$ Size$:512B$

File Size $:42797KB=43824128B$

Currently $:<cylinder,surface,sector> : <1200,9,40>$

In order to complete the current surface we have to go through $24(40,41...63)$ more sectors.

Now address is $: <1200,10,0>$

In order to complete the current cylinder we have to go through $6(10,11...15)$ more surfaces each having $64$ sectors.

How much data is accessed till now $:(24+6\times 64)\times 512B=209408B$

Now address is $: <1201,0,0>$

In order to complete this cylinder we have to go through $16(0,1...15)$  surfaces each having $64$ sectors.

Now look at the options and we are sure that we need to cross $1280^{th}$ cylinder for sure.

How much data is accessed till now $:209408B+((16\times64)\times 80)\times 512=42152448B$

Now address is $: <1281,0,0>$

In order to complete this cylinder we have to go through $16(0,1...15)$  surfaces each having $64$ sectors.

How much data is accessed till now $:42152448B+(16\times64)\times 512=42676736B$

Now similarly you cross $<1282,0,0>$ and $<1283,0,0>$ each having 16 surfaces which in turn have 64 sectors each.

How much data is accessed till now $:42676736B+((16\times64)\times 2)\times 512=43725312B$

It's very close to the file size and if you observe we are currently on the address $<1284,0,0>$ and hence the answer.

 

Correct Answer $:(D)$

2 votes
2 votes

If we treat the <c,h,s> format as some number system (<0,0,0> to <16383,15,63>) then we can do additions directly. 

We just need to convert the given file size 42797KB into <c,h,s> format & add this file size in <c,h,s> format ( <83,9,25> )

to the given file starting location <1200,9,40> 

( like any other additions we need to consider the ‘carry’ while adding)

 

1 votes
1 votes

Answer is 1284

 

1 votes
1 votes
If you have understood the way how Hard Disk stores data, you can solve it just like I did.
First of all the data given to us is

16384 cylinders,16 recording surfaces per cylinder,64 sectors per surface,512B data per sector
Size of the file stored at <1200,9,40> is 42797 KB
Find the cylinder number of the last sector of the file

Approach:

Find the cylinder capacity
$Cylinder$ $capacity$ $=$ $16$ $*$ $64$ $*$ $512$ = $512KB$
Now to find number of cylinders consumed in this data= $\frac{42797 KB}{512KB} = 83.58$

$1200+83.58 = 1283.58$
Now as we know our starting address has 9 surfaces
Multiplying $0.58789*16 = 9$
$1284$ is the answer as it will cross 16 surfaces limit of 1283 cylinder no as $9+9=18$
So correct answer is $1284$
edited by
Answer:

Related questions