384 views
0 votes
0 votes
In a computer system, three files of size 11052 B, 4992 B and 5172 B need to be stored. For storing these files on disk, we can use either 100 B disk block or 200 B disk block. For each block used to store a file, 2 bytes of book keeping information also needs to be stored on the disk. Thus, the total space used to store a file is the sum of space taken to store the file and space taken to store the book keeping information for the blocks allocated for storing the file. A disk block can store either book keeping information for a file or data from a file, but not both. What is the total space required for storing the files using 100 B and 200 B disk blocks respectively___________

1 Answer

Best answer
4 votes
4 votes

1. When Block Size = $100$$B$ used.

For File $F1$ = 11052 B

Number of Blocks required to store the File $F1$ : $\left \lceil \frac{11052}{100} \right \rceil = 111 \,\,Blocks$

Number of Blocks required to store the Bookkeeping Info of File $F1$ : $\left \lceil \frac{111 \times 2}{100} \right \rceil = 3 \,\,Blocks$

Total number of Blocks required for File $F1$ = $111 + 3 = 114 \,\,Blocks$

For File $F2$ = 4992 B

Number of Blocks required to store the File $F2$ : $\left \lceil \frac{4992}{100} \right \rceil = 50 \,\,Blocks$

Number of Blocks required to store the Bookkeeping Info of File $F2$ : $\left \lceil \frac{50 \times 2}{100} \right \rceil = 1 \,\,Blocks$

Total number of Blocks required for File $F2$ = $50 + 1= 51 \,\,Blocks$

For File $F3$ = 5172 B

Number of Blocks required to store the File $F3$ : $\left \lceil \frac{5172}{100} \right \rceil = 52 \,\,Blocks$

Number of Blocks required to store the Bookkeeping Info of File $F3$ : $\left \lceil \frac{52 \times 2}{100} \right \rceil = 2 \,\,Blocks$

Total number of Blocks required for File $F3$ = $52 + 2 = 54 \,\,Blocks$

So, Total space required for storing the files using $100 B$ Blocks = $114 + 51 + 54 = 219 \,\,Blocks \,\, \times 100 B = 21,900 B$


2. When Block Size = $200 B$ used.

For File $F1$ = 11052 B

Number of Blocks required to store the File $F1$ : $\left \lceil \frac{11052}{200} \right \rceil = 56 \,\,Blocks$

Number of Blocks required to store the Bookkeeping Info of File $F1$ : $\left \lceil \frac{56 \times 2}{200} \right \rceil = 1 \,\,Blocks$

Total number of Blocks required for File $F1$ = $56 + 1 = 57 \,\,Blocks$

For File $F2$ = 4992 B

Number of Blocks required to store the File $F2$ : $\left \lceil \frac{4992}{200} \right \rceil = 25 \,\,Blocks$

Number of Blocks required to store the Bookkeeping Info of File $F2$ : $\left \lceil \frac{25 \times 2}{200} \right \rceil = 1 \,\,Blocks$

Total number of Blocks required for File $F2$ = $25 + 1= 26 \,\,Blocks$

For File $F3$ = 5172 B

Number of Blocks required to store the File $F3$ : $\left \lceil \frac{5172}{200} \right \rceil = 26 \,\,Blocks$

Number of Blocks required to store the Bookkeeping Info of File $F3$ : $\left \lceil \frac{26 \times 2}{200} \right \rceil = 1 \,\,Blocks$

Total number of Blocks required for File $F3$ = $26 + 1 = 27 \,\,Blocks$

So, Total space required for storing the files using $200 B$ Blocks = $57 + 26 + 27 = 110 \,\,Blocks \,\, \times 200 B = 22,000 B$

selected by

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
0 answers
2