TOPIC 5.2: PRIMARY AND SECONDARY STORAGE
Introduction.
Secondary storage devices hold files that are not currently being used. For a
file to be used it must first be copied to main memory first. After any
modifications files must be saved to secondary storage. It is advisable to save
your data files at the regular intervals as you work on them as data can be lost
unexpectedly because of various reasons like interruption in power supply,
memory management problems, freezing keyboard, etc.
As secondary storage media can be damaged and files on them become corrupted,
it is suggested to make back-up copies of valuable files on a regular basis.
Lots of people skip the last but very important step in the backup procedure -
check that the backup copy of files is not damaged.
The Difference Between Primary and
Secondary Storage.
-
Primary storage is
volatile: when the power is off, all contents of RAM are lost. That
is why data from RAM is saved as files on secondary storage which is
non-volatile and almost permanent (It wears out eventually or
becomes out of dated technology)
-
Size. Secondary storage is virtually infinite: when you
run out of space on one disk, you use another. On the contrary there is a
limited amount of RAM that can be accessed by the CPU. Some programs will not
run on a particular computer system because there is not enough RAM available.
- Access time. It takes few nanoseconds for the CPU to access RAM but
it takes several milliseconds to access secondary storage. The reasons for RAM
being faster are:
- RAM chips are located on the motherboard so the distance the electrical
signals have to travel from the CPU to RAM or in the opposite direction is
much shorter compared to the distance between the CPU and secondary storage
devices. The shorter the distance, the faster the processing.
- Also working with the secondary storage involves mechanical operations
like spinning
- Cost. Secondary storage is cheaper than RAM in terms of cost per unit of
data.
Storage Hierarchy.
The various levels of memory from registers to cache, to primary, to
secondary storage have decreasing cost and speed and increasing capacity.
| Type of Memory |
Access Speed |
Capacity |
Cost |
| Registers (inside the CPU) |
Highest |
Lowest |
Highest |
| Cache |
|
|
|
| Primary storage |
|
|
|
| Secondary storage |
Lowest |
Highest |
Lowest |
Types of Access
Secondary storage devices provide direct access to data or
sequential access.
Direct access, also called random access, means that the
system maintains a list of data locations and the required piece of data can be
found quickly. The most common
direct access storage is the disk.
The most popular types of disks today are
floppy disks,
hard disks and
optical disks.
Sequential access means the computer system must search the
storage device from the beginning until it finds the required piece of data. The
example would be a
magnetic tape where data is stored sequentially and can be processed only
sequentially.
Primary and Secondary Storage
Why do computers need memory?
Memory is the computer's working storage: it serves as its work table or
desk.
- Storing instructions
- The fastest CPUs depend on getting instructions fast
- Storing information
- The only direct way to make changes
(putting in new information, calculating answers, moving words...)
- Working space
- This is like the desktop of an office worker. It is necessary for
spreading out books and papers while working on them.
Primary Storage = MEMORY
- Fastest way to get information to the CPU
- On a simple microcomputer: about 233,000,000 characters, or about 60,000
pages of typing, to the CPU each second (for a 233 mHz Pentium-based
computer)
- Volatile
- = "evaporates quickly:" Primary storage can disappear quickly: loss of
electricity, making mistakes, or just changing
Two kinds of memory are most common:
- RAM: Random Access Memory
- "Ordinary" memory used in all modern computers
- Easy to read and write
- Random Access: all parts equally close
- Takes no longer to read one part than another part
- ROM: Read Only Memory
- Information stored at the factory; it can't be changed
- Used for:
- Startup instructions on almost all computers
- Built-in programs on laptops, palmtops, and dedicated word
processors
- Game cartridges for Nintendo, Sega, etc.
- Disadvantage: when you want to change it, you have to throw away the
old chips or cartridges
- Can also be accessed "at random"
Secondary, or "Auxiliary" Storage
It's not so swift, but longer-lasting:
- Floppy disk to memory on a PC: about 50,000 characters per second
- Hard disk to memory PC: about 33,300,000 characters per second
- Lasts as long as you need it
...except for mistakes! - so it's important to make regular "backup" copies
Why do computers need secondary storage?
- So they can "rest" (turn power off) without permanent loss
- So they can "think of something else"
- It's like the bookshelves or filing cabinets in an office: they're
needed to store information in an orderly way while you work on something
else, or while you go away for the weekend.
Common types of storage:
-Diskettes: can be removed from the computer
-
5.25 inch "floppy" disk (no longer common)
- - Hard disk or Hard drive (same thing)
- Available in several sizes (1 Gb, 2 Gb, 4 Gb etc.)
- Permanently enclosed in their drive mechanism
-
- CD-ROM
- Older standard stores up to 650 Mb
- DVD stores up to 17 Gb
- Most can only be read - needs special device (CD-R) to write - more
expensive.
SECONDARY STORAGE DEVICES
- Secondary storage devices are used as a more permanent form of data
storage, in contrast with primary storage (main memory) which loses its
contents when power is switched off.
- Storage media include:
1.
Magnetic disk (hard disks and floppy disks);
2.
Magnetic tape;
3. CD-ROM;
4. WORM
disks;
5.
Magneto-optical disks.
HARD DISKS
- There are two types of hard disk: exchangeable and fixed.
- As the names suggest, exchangeable disks can be removed from the drive and
another disk inserted, whereas fixed disks, like those in a microcomputer,
cannot be removed except for repair or replacement.
- Exchangeable disks are gradually being superseded by fixed disks which are
faster and more reliable.
- A hard disk unit consists of several platters each of which is attached to
a central spindle and has two recording surfaces.
- There is a read-write head for each surface, with all the read-write heads
being mounted on a single unit and moving in and out together.
- Each surface has a number of concentric tracks, with each track
being divided into a number of sectors.
- A sector (typically 256 bytes) is the smallest unit that can be read or
written in a single operation.
- All the tracks that are accessible from a single position of the
read-write heads form a cylinder; data is recorded cylinder to minimise
movement of the read-write heads, thereby minimising access time.
- A hard disk typically has a storage capacity of between 512 Kb and several
gigabytes.
FLOPPY DISKS
- Floppy disks consist of a thin piece of mylar plastic coated with
ferric oxide, enclosed in a protective jacket.
- The disk is read through an opening in the jacket, protected in the
standard 3 1/2" disk by a metal sleeve until the disk is inserted in the drive
and accessed.
- The disk has a small hole in the corner, which when open causes the disk
to be write-protected so that the data on the disk cannot be
accidentally overwritten.
- Floppy disks, like hard disks are divided into tracks and sectors.
- A high-density disk can store 1.44 Mb of data.
- Before being used, a disk has to be formatted, a process which checks the
disk for unusable areas, marks out tracks and sectors and creates the disk
directory.
CD ROM
- CD ROM (Compact Disk Read Only Memory) is one of the three main
forms of optical disk, the other two being WORM disks and magneto-optical
disks.
- A CD is created using a mastering facility (just as audio CDs are created
in a recording studio) and copies of master are duplicated or 'pressed' at a
factory.
- They are used for many different applications including:
- software distribution (e.g. word
for windows, windows 95);
- games;
- reference material such as
encyclopedias, telephone directories, past copies of newspapers, art catalogues,
dictionaries;
- advertising, such as the free
CDs commonly distributed with computer magazines.
- The capacity of a CD ROM is around 650Mb, about 500 times as much as a
high-density floppy disk.
- Their high capacity allows storage of photographic images, sound and
video, making them ideal for multimedia applications.
- When the master disk is created, a laser beam burns tiny holes in the
surface of the disk, which has a single spiral track divided into sectors.
- To read data from the disk, a laser beam is reflected off the surface of
the disk, detecting the presence or absence of pits which represent binary
digits.
WORM DISKS
- Write Once, Read Many optical laser disks (WORM disks) look
similar to CD ROM disks, but they are often gold rather than silver in colour.
- An end user company can use these disks to write their own material,
typically for archiving or storing say, graphic or photographic images which
will not be changed.
- These disks are also widely used for pirated software; whereas silver CDs
are pressed in factories, gold CDs are usually written one at a time on PCs in
garages and back bedrooms.
- However, because there is a lot of competition among pirates, these CDs
sometimes carry viruses which can cause havoc on a hard drive.
MAGNETO-OPTICAL DISKS
- Magneto-optical disks integrate magnetic and laser technology to
enable read and write magnetic storage.
- A 5 1/2" disk can store up to 1000Mb.
- These disks may in the future replace current magnetic disks, but at
present the technology is still developing and the disks are too expensive,
slow and unreliable to be in widespread use.
RESOURCE:
P M Heatcote & K R Bond, [A Level Computing], Letts Educational Ltd., 1997.