454.3-09.Solution1

# 454.3-09.Solution1 - CMPT-454 Fall 2009 Instructor Martin...

This preview shows pages 1–3. Sign up to view the full content.

CMPT-454 Fall 2009 Instructor: Martin Ester TA: Yi Liu Solution Assignment 1 Total marks: 200 (20 % of the assignments) Due date: September 30, 2009 Problem 1.1 (50 marks) Consider a disk with a sector size of 512 bytes, 1,000 tracks per surface, 100 sectors per track, 5 double-sided platters and a block size of 2,048 bytes. Suppose that the average seek time is 5 msec, the average rotational delay is 5 msec, and the transfer rate is 100 MB per second. Suppose that a file containing 1,000,000 records of 100 bytes each is to be stored on such a disk and that no record is allowed to span two blocks. a) How many records fit onto a block? 2048 / 100 = 20. We can have at most 20 records in a block. b) How many blocks are required to store the entire file? If the file is arranged sequentially (according to the ‘next block concept’) on disk, how many cylinders are needed? 1,000,000/20=50,000 blocks are required to store the entire file. A track has 25 blocks, a cylinder has 25*10=250 blocks. Therefore, we need 50,000/250=200 cylinders to store the file sequentially. c) How many records of 100 bytes each can be stored using this disk? The disk has 1000 cylinders with 250 blocks each, i.e. it has 250,000 blocks. A block contains 20 records. Thus, the disk can store 5,000,000 records. d) If blocks of the file are stored on disk according to the next block concept, with the first block on block 1 of track 1, what is the number of the block stored on block 1 of track 1 on the next disk surface? There are 25 blocks in each track. It is block 26 on block 1 of track 1 on the next disk surface. e) What is the time required to read the file sequentially? We need to read 200 cylinders. In order to read one cylinder, we have 1 seek, no rotational delays and the transfer of 250 blocks = 500KB. Therefore, the time to read one cylinder is 5msec

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
+ 500K/100M sec = 5msec + 5 msec = 10 msec. The time to read the entire file is 200*10msec = 2sec. f) What is the time required to read the file in random order? Note that in order to read a record, the block containing the record has to be fetched from disk. In random access, the read of every block requires an average seek time of 5 msec, an average rotational delay of 5 msec and a transfer time of 2K/100M sec = 0.02 msec, i.e. 10.02 msec. Therefore, the time to read the entire file is 50,000*10.02msec ~ 500sec.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 7

454.3-09.Solution1 - CMPT-454 Fall 2009 Instructor Martin...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online