In a computer system, four files of size 11050 bytes. 4990 bytes, 5170 bytes and 12640 bytes need to be stored. For storing these files on disk, we can use either 100 byte disk blocks or 200 byte disk blocks (but can't mix block sizes). For each block used to store a file, 4 bytes of bookkeepiing information also needs to be stored on the disk. Thus, the total space used to store a file is the sum of the space taken to store the file and the space taken to store the book keeping information for the blocks allocated for storing the file. A disk block can store either bookkeeping information for a file or data from a file, but not both.
What is the total space required for storing the files using 100 byte disk blocks and 200 byte disk blocks respectively?
File size | 100 B block |
Bytes needed for Book keeping |
Block for Information |
11050 4990 5170 12640 |
111 50 52 127 |
111 × 4 = 44 50×4=200 52×4=208 127×4=508 |
5 2 3 6 |
Total | 340 | 16 |
File size | 100 B block |
Bytes needed for Book keeping |
Block for Information |
11050 4990 5170 12640 |
56 25 26 64 |
56 × 4 = 244 25×4=100 26×4=104 64×4=256 |
2 1 1 2 |
Total | 171 | 6 |