# CS443 – Lab 4 solution

\$25.00

Original Work ?

## Description

5/5 - (1 vote)

Question 1:

Consider a disk with the following characteristics: block size B=512 bytes, interblock gap size G=128 bytes, number of blocks per track=20, number of tracks per surface=400. A disk pack consists of 15 double-sided disks.

• What is the total capacity of a track and what is its useful capacity (excluding interblock gaps)?
• How many cylinders are there?
• What is the total capacity and the useful capacity of a cylinder?
• What is the total capacity and the useful capacity of a disk pack?
• Suppose the disk drive rotates the disk pack at a speed of 2400 rpm (revolutions per minute); what is the transfer rate (tr) in bytes/msec and the block transfer time (btt) in msec? What is the average rotational delay (rd) in msec? What is the bulk transfer rate (btr)?
• Suppose the average seek time is 30 msec. How much time does it take (on the average) in msec to locate and transfer a single block given its block address?
• Calculate the average time it would take to transfer 20 random blocks (may not be on the same cylinder) and compare it with the time it would take to transfer 20 consecutive blocks (all in on cylinder).

Question 2:

A file has r=200000 STUDENT records of fixed-length. Each record has the following fields: NAME (30 bytes), SSN (9 bytes), ADDRESS (40 bytes), PHONE (10 bytes), BIRTHDATE (8 bytes), SEX (1 byte), MAJORDEPTCODE (4 bytes), MINORDEPTCODE (4 bytes), CLASSCODE (4 bytes, integer), and DEGREEPROGRAM (3 bytes). An additional byte is used as a deletion marker. The file is stored on the disk whose parameters are given in Question 1.

• Calculate the record size R in bytes.
• Calculate the blocking factor (bfr) and the number of file blocks b assuming an unspanned organization.
• Calculate the average time it takes to find a record by doing a linear search on the file if
1. the file blocks are stored contiguously, and
2. if the file blocks are not stored contiguously.

• Assume the file is ordered by SSN; calculate the time it takes to search for a record given its SSN value by doing a binary search.