edited by
48,527 views
116 116 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$

11 Answers

Best answer
308 308 votes
First convert $\langle 1200,9,40\rangle$ into sector address.

$(1200  \times  \mathbf{16  \times 64}) + ( 9 \times  \mathbf{64}) + 40 = 1229416$

Number of sectors to store file $= (42797 \ KB) / 512 = 85594$

Last sector to store file $= 1229416+85594=1315010$

Now, do reverse engineering,

$1315010/(\mathbf{16 \times 64})=1284.189453$ $(1284$ will be cylinder number and remaining sectors $=194)$

$194/\mathbf{64} = 3.03125$  $(3$ is surface number and remaining sectors are $2)$

$\therefore \langle 1284,3,1\rangle$ is last sector address.

Correct Answer: $D$
edited by
65 65 votes
$42797\; KB = 42797 \times 1024$ bytes require $42797 \times 1024 / 512$ sectors $=  85594$ sectors.

$\langle 1200, 9, 40 \rangle$ is the starting address. So, we can have $24$ sectors in this recording surface. Remaining $85570$ sectors.

$85570$ sectors require $\lceil \frac{85570}{64}\rceil= 1338$ recording surfaces. We start with recording surface $9,$ so we can have $7$ more in the given cylinder. So, we have $1338 - 7 = 1331$ recording surfaces left.

In a cylinder, we have $16$ recording surfaces. So, $1331$ recording surfaces require  $\lceil \frac{1331}{16}\rceil = 84$ different cylinders.

The first cylinder (after the current one) starts at $1201.$ So, the last one should be $1284.$

$\langle 1284, 3, 1 \rangle$ will be the end address. $(1331 - 16 \times 83 +1  - 1 = 3$ $(3$ surfaces full and $1$ partial and $-1$ since address starts from $0),$ and $ 85570 - 1337 \times 64 -1 = 1)$
29 29 votes
  • 16 Surfaces(0-15)
  • 16384 cylinders (0-16383)
  • Each cylinder has 64 sectors (0-63)
  • Sector Capacity=512 Byte
  • File Size =42797KB
  • Number of sectors required by file = $\frac{42797*1024(Bytes)}{512}= 85594$
  • #Sectors per cylinder = 16*64 = 1024
  • Starting disk location of file = <1200,9,40>
  • Remaining sectors to be filled till next cylinder 1201 will be
    (63-40+1)(Head number 9(means surface 10th) is completely filled + (15-10+1)*64 = 408
  • Remaining sectors to be allocated to file  = 85594-408=85186
  • These 85186 sectors will take  = $\left \lceil \frac{85186}{1024} \right \rceil = 84$ cylinders
  • Means inclusive of 1201, we need to add 83 more cylinders, so answer= 1201+83=1284 Cylinder number
10 10 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)

 

9 9 votes

Cylinder no 1284

2 2 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:
Position:
Show:

Related questions

91 91 votes
9 answers 9 answers
43.2k
43.2k views
go_editor asked Apr 21, 2016
43,168 views
A computer uses $46\text{-bit}$ virtual address, $32\text{-bit}$ physical address, and a three–level paged page table organization. The page table base register stores th...
183 183 votes
11 answers 11 answers
47.2k
47.2k views
Arjun asked Sep 24, 2014
47,155 views
A certain computation generates two arrays a and b such that $a[i] = f(i)$ for $0 \leq i < n$ and $b[i] = g(a[i])$ for $0 \leq i < n$. Suppose this computation is decompo...
94 94 votes
10 answers 10 answers
38.0k
38.0k views
Arjun asked Sep 24, 2014
38,018 views
A shared variable $x$, initialized to zero, is operated on by four concurrent processes $W, X, Y, Z$ as follows. Each of the processes $W$ and $X$ reads $x$ from memory, ...
86 86 votes
13 answers 13 answers
28.9k
28.9k views
Arjun asked Sep 23, 2014
28,930 views
Three concurrent processes $X$, $Y$, and $Z$ execute three different code segments that access and update certain shared variables. Process $X$ executes the $P$ operation...