Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
In this chapter you will learn about:
§ Secondary storage devices and their need
§ Classification of commonly used secondary storage
devices
§ Difference between sequential and direct access
storage devices
§ Basic principles of operation, types, and uses of
popular secondary storage devices such as magnetic
tape, magnetic disk, and optical disk
(Continued on next slide)
Ref Page 117 Chapter 8: Secondary Storage Devices Slide 2/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Learning Objectives
(Continued from previous slide..)
§ Commonly used mass storage devices
§ Introduction to other related concepts such as RAID,
Jukebox, storage hierarchy, etc.
Ref Page 117 Chapter 8: Secondary Storage Devices Slide 3/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Limitations of Primary Storage
§ Limited capacity because the cost per bit of storage
is high
§ Volatile - data stored in it is lost when the electric
power is turned off or interrupted
Ref Page 117 Chapter 8: Secondary Storage Devices Slide 4/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Secondary Storage
§ Used in a computer system to overcome the limitations
of primary storage
§ Has virtually unlimited capacity because the cost per bit
of storage is very low
§ Has an operating speed far slower than that of the
primary storage
§ Used to store large volumes of data on a permanent
basis
§ Also known as auxiliary memory
Ref Page 117 Chapter 8: Secondary Storage Devices Slide 5/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Classification of Commonly Used Secondary
Storage Devices
Secondary Storage
Devices
Sequential Access Direct Access Devices
Device
Magnetic Tape
Magnetic Optical Disks Memory Storage
Disks Devices
Flash Memory
Floppy Hard CD-ROM Card
WORM CD-RW DVD Drive
Disk Disks
(CD-R)
Zip Disk Disk Pack Winchester Disk
Ref Page 118 Chapter 8: Secondary Storage Devices Slide 6/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Sequential-access Storage Devices
§ Arrival at the desired storage location may be preceded
by sequencing through other locations
§ Data can only be retrieved in the same sequence in which
it is stored
§ Access time varies according to the storage location of
the information being accessed
§ Suitable for sequential processing applications where
most, if not all, of the data records need to be processed
one after another
§ Magnetic tape is a typical example of such a storage
device
Ref Page 118 Chapter 8: Secondary Storage Devices Slide 7/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Direct-access Storage Devices
§ Devices where any storage location may be selected
and accessed at random
§ Permits access to individual information in a more
direct or immediate manner
§ Approximately equal access time is required for
accessing information from any storage location
§ Suitable for direct processing applications such as on-
line ticket booking systems, on-line banking systems
§ Magnetic, optical, and magneto-optical disks are
typical examples of such a storage device
Ref Page 118 Chapter 8: Secondary Storage Devices Slide 8/98
Computer
Computer Fundamentals:
Fundamentals: Pradeep
Pradeep K.
K. Sinha
Sinha &
& Priti
Priti Sinha
Sinha
Magnetic Tape Basics
§ Commonly used sequential-access secondary storage
device
§ Physically, the tape medium is a plastic ribbon, which
is usually ½ inch or ¼ inch wide and 50 to 2400 feet
long
§ Plastic ribbon is coated with a magnetizable recording
material such as iron-oxide or chromium dioxide
§ Data are recorded on the tape in the form of tiny
invisible magnetized and non-magnetized spots
(representing 1s and 0s) on its coated surface
§ Tape ribbon is stored in reels or a small cartridge or
cassette
Ref Page 119 Chapter 8: Secondary Storage Devices Slide 9/98
Secondary Storage Devices: Magnetic Tape
A sequence of bits (1’s and 0’s) is stored on magnetic tape.
For storage, the tape is wound on a reel.
To access the data, the tape is unwound from one reel to another.
reel 1
reel 2
tape
read/write head
As the tape passes the head, bits of data are read from or written onto the
tape.
Tracks:
8 tracks for data
½ inch
1 track for error checking (purity track)
Typically, data on tape is stored in 9 separate bit streams, or tracks.
Each track is a sequence of bits
Recording density = # bits per inch (bpi), typically 800 or 1600 bpi, 30,000
bpi on some recent devices.
A closer look:
1 bit
8 bits = 1 byte
…..1 0 00 1….
0 1 11 0
1 1 11 0
0 0 01 1
1 1 10 1 ½ inch
0 0 10 0
0 1 01 0
…..1 1 10 1….
…..0 0 1 0
parity bit
0 if # of 1’s in byte is even
Parity bit=
1 if # of 1’s in byte is odd
Error Checking: If the parity bit rule does not hold when the byte is read,
then the tape has been corrupted.
Tape organization:
2400’
BOT marker
Data blocks Inter block gap EOT mark
Header block
BOT= beginning of tape marker
Header block: describes data blocks
Inter block gap: For acceleration and deceleration of tape
Blocking factor: # records per block
Data blocks and records
- Each data block is a sequence of contiguous records
- A record is the unit of data that a user’s program deals with.
- For efficiency, the tape drive reads an entire block of records at once.
- Unlike a disk, a tape starts and stops
- When stopped, the read/write head is over an interblock gap (i.g)
- To read a block, the tape uses the i.g to accelerate. Then it reads all
records in the data block. Then it uses the next i.g to decelerate.
Tape capacity:
Given the following tape:
Recording density = 1600 bpi
Tape length = 2400’
Inter block gap = ½”
512 bytes per record
Blocking factor =25
How many records can we write on the tape (ignoring BOT and EOT
markers and the header block0
bytes/block = 512 bytes/rec * 25 rec/block
= 12,800 bytes/block
Block length = #bytes per block / # bytes per inch
= 12,800/1600 inches = 8 inches
Block + gap = 8” + 1/2” = 8.5”
Tape length =2400 ft * 12 in/ft = 28,800 in
#blocks = (tape length)/ (block + gap)
#block = 28,800/8.5 = 3388 blocks
#records = #blocks * # rec per block
# records = 3388 * 25 = 84,700 records
Buffering:
- A user wants to read or write one record at a time
- but, a secondary storage device (disk or tape) reads and writes an
entire block all at once.
- Question : how do we resolve this mismatch
- Solution: Buffers
Buffers:
Data transferred by
Data transferred records
by blocks
Secondary Buffer Program
Storage
Temporary storage in MM for
one block of data
- Buffers are managed by the computer’s operating system (O.S)
- The O.S uses buffers to mediate between secondary storage and user
programs, i.e. to translate between blocks and records et vice versa.
- The whole process is invisible to the user, who thinks he is reading or
writing one record at a time to secondary storage (SS)
- When a user’s program asks for a record, the O.S automatically reads
an entire block of data from S.S to a buffer in M.M
- The O.S then passes the first record to the user’s program
- When the user’s program asks fro the next record, the O.S gives it the
2sd record in the buffer, without accessing S.S
Note: The buffer is 10,000 times faster than S.S because it is in the MM
This process continues with the 3rd, 4th, 5th … records in the buffer being
passed to the user’s program with each read request.
- Eventually, all the records in the buffer may be passed to the user’s
program.
- If the program then asks for another record, the O.S will read
another block of data from SS into the buffer (overwriting the old
buffer contents)
- The O.S then passes the first record in the buffer to the user’s
program, etc.
- This way, the O.S hides the details of reading and writing from the
user, it means that the O.S manages the data blocks for the user.