|
|||||||||||||||
Comparison of Storage Devices
|
|||||||||||||||
|
|||||||||||||||
Example 1:
Calculate how many books can be stored in a CD-ROM?
Solution:
Magnetic tapes used for archival proposes. We can store records on
the tape sequentially. Between records we need an empty space, because tapes need some
space to start and stop. When a read command comes from computer, tape starts to turn and
it has to reach a speed, which is required to read the record. Each record contains some
characters and these characters stored as bytes. And each byte contains 8 bits (Actually a
byte contains one more bit to check the correctness of the byte).
Bytes are located horizontally and bits are located vertically.
Length of the magnetic tapes are 600/1200/2400 feet/reel and 1 foot = 12 inch =
12’’
the width of the magnetic tapes are 0.5 ’’
Tape Capacity is determined by
1. Tape Density
2. Blocking Factor
3. Inter record/block gap Length
4. Tape Length
Tape Density: Bytes/inch
(bpi) 586,800,1600,6250
Blocking Factor:
If we store records one by one we will waste too much space for example
Assume that Tape density = 1600 dpi, Record Size = 80 bytes, IBG size =
0.5’’
Space used by each record = 80 bytes / 1600 dpi = 0.05 inch
|
To increase tape capacity use blocking
Note: The block factor on a tape is constant. It means all the blocks have the same number of records. But the sizes of records are changeable.
Buffer:
When we are using blocking the records move from tape to
memory in blocks. And then they move to the program area from memory. For example, assume
that blocking factor is 10. Then this means that when a read method
wants the first record all first ten records move form tape to memory. This place which
stores the records in the memory called buffer. And
then first record moves to the program area from buffer instead of tape. And if we are
making sequential readings then this means that we don not need to deal with tape because
all of these ten records are in the memory. Physical I/O
means block moves fro tape to memory. Logical I/O
means records moves from the buffer to the program.
Example 2
For a reel these values are given:
Bpi = 1600 bytes/inch, IBG = 0.5”, Blocking factor = 30 records / block
Record size = 80 chars, Tape length = 2400 ft, 1 ft = 12 inch
How many records can be stored on this reel?
Solution;
Block size = 30 * 80 = 2400 bytes / block
2400 / 1600 = 1.5 ”/ block
To find the total size of a block we add IBG to this value.
1.5 + 0.5 = 2 ” / block
(2400 * 12) / 2 = 14400 blocks
14400*30 = 34 560 000 bytes = 24 floppy disks.
Example 3 ;
There is an inventory file, which has 36000 records, and record size is 400 bytes.
Determine this tape size if
a) No blocking Factor: bpi=800, IBG = 0.5 Tape Length = 2400 ft
b) Blocking Factor (BF) = 3 (Other values are same)
Solution:
a) Size of a record = 400 / 800 = 0.5 ”
½” + ½” (Gap) = 1” (Cost of one record)
File size in terms of its length = 36000 * 1 = 36000” = 3000 ft
b) (BF = 3) 3 * 400 = 1200 bytes / block
1200 / 800 = 1.5 ” / block + 0.5 ” (IBG) = 2 ” (Total block size)
12000 * 2 = 24000 ” (file size) / 12 = 2000 ” (file size)
Tape I/O Timing:
Start/stop time =10ms = 10 * 10-3 = 0.01 s
Reading/writing time = 200 ” / s
Example 4:
There is a file, which has 12000 records. And record size 400 bytes. Tape density is 800
bpi.
Read /write time is 200 ” / s. Start/stop time is 0.01 s. Find the total time to read
this file?
a) With no blocking?
b) With BF = 3?
Solution ;
a) With no blocking factor
Total start/stop time = 12000 * 0.01 = 120 s.
Tape processing speed = 800 bytes / inches * 200 ” / s = 16 * 104 bytes / s.
Total file size in bytes = 12 * 103 * 400 = 48 * 105 bytes
Processing Time = 48 * 105 bytes / 16 * 104 bytes / s. = 30 s
Total time = 120 + 30 = 150 s
b) BF=3
Data read time is same = 30 s.
Start / stop time = 120 / 3 = 40 s.
Total Time = 70 s.
Concepts About the Disk Medium:
Notes:
# of tracks / cylinder = # of magnetizable surfaces / # of read/ write head per
arm
500 tracks / surfaces = 500 cylinders if we have one read / write head per arm.
500 tracks / surfaces = 250 cylinders if we have two read / write head per arm.
QUESTIONS & ANSWERS
Example
1
Consider a magnetic tape
with the following properties:
800
bytes/inch recording density
0.5 inches IBG
1600 feet tape length
10 msec. of start/stop time
200 inches/sec read/write speed
a) Does a file with 36000
records of 200 bytes each fit on a single tape unit if no blocking is used?
b) What is the minimum blocking factor to put the file into one tape?
c) Assume that blocking factor
is 5 than calculate the total time to read the whole file?
Solution:
a) total size of the file = 36000 * 200 = 7 200 000
bytes
for
records 7 200 000 / 800 = 9 000 inches needed
36
000 * 0.5 = 18 000 inches needed for IBG
18
000 + 9 000 = 27000 inches needed totally
Because
one feet equals 12 inch
Length
of a single tape 1600 * 12 = 19 200 inches
So
this file can’t be fit in a single tape.
b)
A tape has 19 200 inches length
We
need 9000 inches for records from previous solution.
So
19200 – 9000 = 10 200 inches can be used for IBG.
Each
IBG is 0.5 inch so 20 400 IBG can be used.
36000
record / 20400 = 1.764 bf needed so
2
is the smallest integer number greater than 1.7. So we need bf equals to 2.
c) Number of IBG 36000 / 5 = 7200
Time
needed to start and stop 7200 * 10 msec = 72 sec
Time
need to read the records 9000 inch / 200 inch/sec = 45 sec
Total
time = 72 + 45 sec
Example
2
Assume
that we have 400 byte records and we have a tape with following properties calculate how
many records can be stored
a)
Without blocking
b)
With blocking factor 3
1600 bpi tape
density
2400 feet tape length
0.5 inch IBG
Solution:
a) Without
blocking, assume there are x records so
One
record uses 400/1600 = 0.25 inch on the tape
Totally
each record needs 0.25 + 0.5 = 0.75 inch
Tape
length = 2400 feet = 2400 * 12 = 28800 inch
28800
inch / 0.75 record/inch = 38.400 records can be stored
b) With
blocking factor 3
Each
block is 400 bytes * 3 = 1200 bytes
Each
block allocates 1200 / 1600 = 0.75 inch
0.75
+ 0.5 = 1.25 inch for each block
28800
/ 1.25 inch = 23040 blocks
23040
* 3 = 69120 records
Example 3
Assume that we have a file consists of 48000 records. The properties of the tape is given below:
Record size:10 bytes
Bpi:1600
Start/stop time: 10 s
Reading time: 200 s/inch
Gap: 0.5”
If the blocking factor used is 10;
a) What is the number of physical and logical I/O’s ?
b) What
is the total time needed to read this tape ?
a) Number of physical I/O is the number of blocks because computer read them block by block so it makes
48 000 / 10 = 4 800
Number of logical I/O is the number of records so it makes 48 000.
b)
There are 4 800
blocks and the total start/stop time is 4 800 * 10 = 48 000 s
Total processing time
Total length 48 000 / 1 600 = 30 inches
30 inches * 200 s/inch =6 000s
Total time is 48 000 + 6 000 = 54 000s