19
Student Notes Theory Introduction All computer systems need to store data. This is done: Temporarily while a program is running. This is stored in main memory . Long-term to preserve programs and data while not in use. This is called backing storage. So you can see how a computer system uses two types of memory: Main memory holds all of the essential memory that tells your computer how to be a computer. Backing storage holds the information that you store on backup storage devices. Note: Memory is another term used for storage. Uses of Main and Backing Storage Main memory is a temporary area for holding data, instructions, and information. Main Memory is also known as main store or primary storage. The main store (main memory) is needed: To store the program currently being executed To hold data produced as the program is run To hold other data such as the contents of the screen. The backing store is needed: For long-term storage of data and programs For data and programs where there is not enough room in the main store. 1/ 19 K. Aquilina Storage Storage Further Reading Merlin Pg 253 Glossary Pg 134

Storage Notes

Embed Size (px)

DESCRIPTION

Storage Notes

Citation preview

Page 1: Storage Notes

Student Notes Theory

Introduction

All computer systems need to store data. This is done: Temporarily while a program is running. This is stored in main memory.

Long-term to preserve programs and data while not in use. This is called backing storage.

So you can see how a computer system uses two types of memory: Main memory holds all of the essential memory that tells your computer how to be a computer. Backing storage holds the information that you store on backup storage devices.

Note: Memory is another term used for storage.

Uses of Main and Backing Storage

Main memory is a temporary area for holding data, instructions, and information. Main Memory is also known as main store or primary storage. The main store (main memory) is needed:

To store the program currently being executed

To hold data produced as the program is run

To hold other data such as the contents of the screen.

The backing store is needed:

For long-term storage of data and programs

For data and programs where there is not enough room in the main store.

Block Diagram of the Computer System showing the Main & Backing Storage

1/ 14 K. Aquilina

StorageStorageFurther Reading

Merlin Pg 253Glossary Pg

134

The Central Processing Unit (CPU) is the unit responsible for the processing of data. The CPU is made up of 3 parts: the Control Unit (CU), the Arithmetic and Logic Unit (ALU) and Main Memory

CPU = CU + ALU + Main Memory

Page 2: Storage Notes

Student Notes Theory

Main memory holds programs and data that the user is currently working with. For example: A word-processed document that is being edited will be loaded into Main memory. An email program that is currently transmitting a message will be loaded into main memory. When you switch on the computer system, a program found in main memory will boot (start

up) the computer system.

Have you ever heard the terms RAM and ROM?These are the two main types of main memory

Random Access Memory (RAM):RAM stands for Random Access Memory. RAM memory is rather like a whiteboard on which you can scribble down notes, read them, and rub them out when you are finished with them. In the computer, RAM is the working memory. Data can be read (retrieved) from or written (stored) into RAM. RAM chips will remember what you tell them and can even change to remember new information. But, when the computer is turned off, RAM forgets everything you told it. This is why it is so important to save your work on a computer - if the computer gets turned off, RAM will lose all of your work!

RAM is used to store programs and data that are being used by the computer. When the computer is turned on the RAM is empty. Data and programs can be put into RAM from either an input device or from backing store. The data in RAM is lost when the computer is turned off so it is known as volatile memory. To keep data the user must save it to backing store before the computer is turned off.

o The process of transferring data/programs from backing store into RAM so they can be used is known as loading.

o The process of transferring data/programs from RAM to backing store so that they will be retained when a computer is turned off is known as saving.

Read Only Memory (ROM):Another kind of memory used inside computers is called Read Only Memory (ROM). ROM is good at remembering, but cannot change it's mind. It holds information that is built into it. ROM is like reading a library book - lots of information is there, but you can't change it (because you never write in a library book). RAM, on the other hand, is more like a personal diary - you can write information into the diary. But if you change your mind, you can erase and write in new information.

ROM chips are loaded with data and programs during manufacture and can only be read by computer. However, the contents of the chips are not lost when the power is switched off (non-volatile). If ROM was volatile it would lose its data and it would not be possible to write it back. ROM is used to form a computer's permanent store of vital information, or of programs that must be readily available but protected from accidental or deliberate change by the user.

2/ 14 K. Aquilina

Main MemoryMain Memory

Page 3: Storage Notes

Student Notes Theory

Frequently used programs essential to the normal running of the computer are stored in ROM. These usually include a small program called the bootstrap loader, which runs when the computer is switched on to get it started.

Only the computer manufacturer can provide these programs in ROM and once done, they cannot be changed. Consequently, you cannot put any of your own data or programs in ROM.

Main distinctions between ROM and RAM

Other applications of ROM and RAM outside the CPU

In a printer some RAM is needed to store the next set of data to be printed. Some ROM is

needed to store programs to direct the printer how to print the data and to keep record of

the different printing fonts.

In a modern washing machine, the processor needs ROM to permanently store the control

program and RAM to store temporary data created by the program.

Questions:

1. In what type of memory are often used instructions and programs permanently stored inside the computer?

2. Who provides the programs stored in ROM?3. Can programs in ROM be changed?

3/ 14 K. Aquilina

Page 4: Storage Notes

Student Notes Theory

If data needs to be kept whilst a computer is turned off then it must be stored on backing store. Any programs or data that are not currently being used by a computer will be kept on backing store. When programs or data are used they are copied (loaded) into main memory (RAM) for faster access.

The purpose of storage in a computer is to hold data and get that data to the CPU as quickly as possible when it is needed. Computers use disks for storage: most commonly, hard disks that are located inside the computer (non-removable), and floppy or compact disks that are used externally (removable).

Storage Media And Storage Drives

Information stored on backing store is placed on a storage medium. The most common storage media which are used for backing storage are:

Magnetic Disks Magnetic Tapes Optical Disks

The data is read from or written to the storage medium by a piece of hardware known as a drive or a storage device. That is, a storage device records and retrieves items to and from a storage medium.

It takes much longer to access data which is on backing store than data which is in main memory, typically 100 to 1000 times as long. This is because most backing storage devices operate mechanically. Computer systems have much more backing store than main memory for two reasons:

1. Main Memory only needs to store programs and data that are currently being used whereas the backing store needs to hold all of the programs and data that can be used on the computer.

2. Backing store is much cheaper per Mb than Main Memory.

Reading is the process of transferring data, instructions, and information from a storage medium into memory. Writing is the process of transferring these items from memory to a storage medium.The speed of a storage device is defined by its access time, which is the amount of time it takes to locate an item on a medium.

Common types of storage devices include Floppy disk drive Hard disk drive Compact disk drive

Tape drive Zip drive

Characteristics of Backing store

Data is usually accessed using read/write heads. These transfer the data while the medium rotates in the drive

Access to backing store is slower that to main memory They are non-volatile. The data is stored on the medium

until it is deleted.Magnetic Media

4/ 14 K. Aquilina

Backing StorageBacking Storage

Capacity is the number of bytes (i.e., characters) a storage medium can hold.

Page 5: Storage Notes

Student Notes Theory

Magnetic tape

Magnetic tape is a narrow plastic ribbon coated with an easily magnetisable material on which data can be recorded. It is used in sound recording, audiovisual systems (videotape), and computing. Magnetic tape was first used to record computer data and programs in 1951. It was very popular as a storage medium for external memory in the 1950s and 1960s. Since then magnetic disks have largely replaced it as a working medium, although tape is still used to make backup copies of important data. Information is recorded on the tape in binary form, with two different strengths of signal representing 1 and 0. It is common for 20000 bits of information to be recorded on each centimeter of tape. Magnetic tape has serial access - an item can only be accessed by working through all the items before it. The device that reads the tape is the Tape Drive or Tape Unit.

Magnetic tape comes in two different forms:

Reels Large reels of tape which must be loaded into a reel-to-reel tape drive. This type of tape is usually used by mainframe computers.

Cartridges The tape is supplied in a small cartridge rather like a music tape. This type of tape is used on PCs (microcomputers) and the device used to read/write the tapes is called a tape streamer. Capacities of cartridges vary from 10Gb to 200Gb.

Advantages Disadvantages:

Speed - very fast A record on magnetic tape cannot be updated in place. Records to be updated have to be read, updated and then written to a second tape

Capacity - high volume of 10 million characters

Tape must be stored in a suitable environment where humidity, temperature and dust are tightly controlled; otherwise read errors occur.

Cost - it is cheap and convenient. Tape has a limited shelf life (about 2 years) for reliable results and is therefore not suitable for long-term storage of history files.

Magnetic Discs

Hard Disks

The hard disk is a magnetic disk, usually fixed in the drive (internal) although nowadays there also exist external hard disks. Access to data is far faster than access to floppy disks. Hard disks store far more data than floppy disks. They are more reliable then floppy disks - there is better protection against dirt. Hard disks are used to store the operating system, application software and users' files.

5/ 14 K. Aquilina

Page 6: Storage Notes

Student Notes Theory

A hard disk is made of a rigid disk which is coated with a magnetisable material. The magnetic material used is of a much higher quality than that found on floppy disks. Hard disks spin much more quickly than floppy disks and the disk head is positioned very close to the disk (thousandths of a millimetre away). Because the disk head is positioned so close to the disk hard drives can easily be damaged by dust or vibration. Therefore the disk, the drive head and all the electronics needed to operate the drive are built together into a sealed unit. This picture shows a hard disk drive with the case removed.

Usually (as in the picture above) several physical disks are contained in one hard disk unit. Each disk is known as a platter. Typical hard disk capacities for a home PC now start at up to 180Gb.

Floppy Disks

When you look at a floppy disk, you'll see a plastic case that measures 3 1/2 by 5 inches. Inside that case is a very thin piece of plastic (see picture at right) that is coated with microscopic iron particles (magnetic). This disk is much like the tape inside a video or audio cassette. Never touch the inner disk - you could damage the data that is stored on it. On one side of the floppy disk is a place for a label. On the other side is a silver circle with two holes in it. When the disk is inserted into the disk drive, the drive hooks into those holes to spin the circle. This causes the disk inside to spin at about 300 rpm! At the same time, the silver metal cover on the end is pushed aside so that the read/write heads in the disk drive can read and write to the disk.

Floppy disks are the smallest type of storage, holding only 1.44MB.

Access to data is much slower than for hard disk. Like hard disks they are direct access. The data on the disk can be protected by sliding a small write-protect tab which prevents the contents of the disk from being changed.

Some hardware companies now produce storage devices (Zip disks) which are very similar to floppy disks but can store 100Mb or even 250Mb of data. These devices are also much faster than standard floppy disk drives.

Uses

You might wonder: If all the information is stored safely inside my computer, why would I need to store it outside? There are several reasons why portable storage is so important.

Floppies make it possible to backup important information in case it is lost by the computer. Do you remember RAM and ROM? RAM loses its memory each time the computer is turned off, but ROM keeps information stored even when the computer is not turned on. Well, sometimes computers have problems that can cause them to crash. No, that doesn't mean they jump off the desk and smash on the floor ;-). A crash is something that happens inside the computer's circuits and can make it forget things. Having important information backed up on disks will allow you to put it back into your computer's memory. Backup disks can save you lots of time and headaches!

6/ 14 K. Aquilina

Page 7: Storage Notes

Student Notes Theory

Disks also allow information to be transferred between different computers. Let's say that you are working on a project using a computer at the library, but you don't finish it by closing time. There's your project sitting in the computer. How do you get it home to finish it on your computer? You write the information to a disk, take it home and upload the information into your computer from the disk. What an easy way to transfer information!

How Hard disks and Floppy Disks Work - Magnetic

The process of reading and writing to a hard or floppy disk is done with electricity and magnetism. The surfaces of both types of disks can be easily magnetized. The electromagnetic head of the disk drive records information to the disk by creating a pattern of magnetized and non-magnetized areas on the disk's surface. Do you remember how the binary code uses on and off commands to represent information? On the disk, magnetized areas are on and non-magnetized areas are off, so that all information is stored in binary code. This is how the electronic head can both write to or read from the disk surface.

It is very important to always keep magnets away from floppy disks and away from your computer! The magnets can erase information from the disks!

Format of Magnetic Disks

All magnetic disks are similarly formatted, or divided into areas, called Tracks and SectorsThe formatting process sets up a method of assigning addresses to the different areas. It also sets up an area for keeping the list of addresses. Without formatting there would be no way to know what data went with what. It would be like a library where the pages were not in books, but were scattered around on the shelves and tables and floors. You'd have a hard time getting a book together. A formatting method allows you to efficiently use the space while still being able to find things.

Tracks - A track is a circular ring on one side of the disk. Each track has a number. The diagram shows

3 tracks.

Sectors - A disk sector is a wedge-shape piece of the disk. Each sector is numbered.

A typical magnetic disk has two surfaces or sides. Each surface holds data in circular tracks and each track is divided into equal sections called sectors. The track number and sector number are used as an address to find where data is on the disk. Data can be both written to and read from the disk. Magnetic disks are direct access i.e. any data item can be accessed without reading other data first.

What happens when a disk is formatted?

1. All data is erased. Don't forget this!!

2. Surfaces are checked for physical and magnetic defects.

7/ 14 K. Aquilina

Double sided

Page 8: Storage Notes

Student Notes Theory

3. A root directory is created to list where things are on the disk.

Magnetic Disk Advantages Magnetic disk Disadvantages

How a disk drive works – Accessing Data

Data is recorded on (and read from) a disk using _________________ heads attached to an access arm. A drive motor rotates the disk about its central axis at around 360 RPM (rotations per minute). Two read/write heads, one for each side, move over the disk surface. The read/write head of the floppy are in physical contact with the magnetic disk surface. Because prolonged contact would wear out the disk and eventually the head, these systems lift the head from the surface of the disk and stop rotating the disk when it is not in use.

A block of data on a disk is addressed by its position- its head number, track number and sector number. The process of accessing data has 4 steps.

1. ______________.

2. ______________.

3. ______________.

4. ______________.

Step Measured as:1. seek move the head to proper track

seek time (ms)

2. rotaterotate disk under the head to the correct sector

rotational delay (ms)

3. settlehead lowers to disk;wait for vibrations from moving to stop (actually touches only on floppies)

settling time (ms)

4. data transfer copy data to main memory

data transfer rate (kbs)

where ms stands for millisecond = .001 second and kbs is kilobytes per second.

So if a block on side 1, track 20, sector 6 is to be read;1. The head assembly is stepped to track 20 (seek time) 2. The system waits until sector 6 rotates into position under the head (Latency time) 3. Head lowers to disk and waits for vibrations from moving to stop.4. Then as it rotates past reads it from head 1(transfer time).

Questions

1. Why are disk storage devices popular? 2. How is data stored on all disks? 3. How is the storage capacity of a disk determined?

8/ 14 K. Aquilina

Page 9: Storage Notes

Student Notes Theory

9/ 14 K. Aquilina

Page 10: Storage Notes

Student Notes Theory

Optical Media

An optical disk is a storage medium in which laser technology is used to record and read large volumes of digital data.

Compact Disks - Optical

Instead of electromagnetism, CDs use pits (microscopic indentations) and lands (flat surfaces) to store information much the same way floppies and hard disks use magnetic and non-magnetic storage. Inside the CD-Rom is a laser that reflects light off of the surface of the disk to an electric eye. The pattern of reflected light (pit) and no reflected light (land) creates a code that represents data. Optical disks store data by changing the reflective properties of a plastic disk. Binary computer data (0s and 1s) are represented by the way the disk reflects light when a low power laser is shone at it. A 0 stored on a disk reflects light differently to a 1 stored on a disk.

Compact Disk Read Only Memory (CD-ROM): Data is written to the disk using a powerful laser beam to burn patterns in the surface. Data is read back using a relatively low-power laser to detect the patterns in the surface. The disks are exchangeable and easy to transport. Access to data is faster than access to floppy disks but slower than hard disks. CD-ROMs typically hold about 650 megabytes of data, and are used in distributing large amounts of text and graphics, such as encyclopedias, catalogues, and technical manuals. Usually data is written on to the disk before it is sold. After that data can be read from the disk but not written to it.

Like floppy disks, optical disks can be moved from one computer to another. As with a hard disk the drive head in an optical drive can move directly to any file on the disk so optical disks are direct access.

There are five types of optical disks that are currently in use. They are:

CD-ROM (Compact Disk - Read Only Memory)

This is by far the most widely used type of optical disk. A CD-ROM disk can store up to 700Mb of data. The data is written onto the CD-ROM disk before it is sold and can not be changed by the user. Because of this CD-ROMs are often described as Write Once Read Many times (WORM) disks. CD-ROMs are used for applications such as distributing software, digital videos or multimedia products.

CD-R (Compact Disk - Recordable)

A CD-R disk can store up to 700Mb of data. A CD-R disk is blank when it is supplied. The user can write data to it just once. After data has been written to the disk it can not be changed. A special CD-R drive which contains a higher powered laser than a CD-ROM drive is required to write to the

10/ 14 K. Aquilina

Page 11: Storage Notes

Student Notes Theory

disk. CD-Rs are often used for making permanent backups of data and distributing software when only a small number of copies are required.

CD-RW (Compact Disk - Rewriteable)

A CD-RW disk can store up to 700Mb of data. CD-RW disks can be read from and written to just like a hard disk. CD-RWs can be used for any application that a hard disk can be used for but the time taken to access data is much longer than that for a hard disk.

DVD-ROM (Digital Versatile Disk - Read Only Memory)

DVD is the new standard for optical disks. By using a shorter wavelength laser, storing data on both sides of the disk and having more than one layer of data on each side of a disk DVD disks are able to store much more data than CD disks. The DVD standard includes disk capacities up to 18Gb. Current DVD disks store far less than this. DVD-ROM disks can be read from but can not be written to. Because of their high capacity, DVD-ROM disks are used to store high quality video such as complete movies. Often extra data such as information about the making of the film or the actors and actresses who star in it are also stored on the disk. Unlike movies recorded on video tape, DVD-ROM movies can be interactive. The user can make selections on the screen and change what they see.

DVD-RAM (Digital Versatile Disk - Random Access Memory)

DVD-RAM disks have all of the benefits of DVD-ROM disks and can be written to as well. These very high capacity disks are ideal for producing backups. In the next five years they may replace video tapes for recording television programmes.

11/ 14 K. Aquilina

Page 12: Storage Notes

Student Notes Theory

The disk filing system

To retrieve files stored on magnetic disks, an operating system maintains a list of the sectors assigned to each file. This list is stored in a table called a File Allocation Table (FAT). The FAT is a file on each disk i.e. it is also kept on the backing store. The FAT is created when a disk is formatted. This table is sometimes called a memory map because it describes the way storage is organised in a computer. For example, sections of memory may be allocated to the screen display, programs or applications.

In short, a memory map describes how the information held on disk is organised, and is kept on disk.

Hierarchical directory structure

A hierarchichal directory structure is used to organise the files that exist on a hard disk. Such a structure lets the user organise in a meaningful way all the files. Much as a real tree has all its branches and roots come together in one spot, so too does a file system directory structure.

Root Directory

12/ 14 K. Aquilina

File File File sub-directory sub-directory

File File File Sub-directory

File File

Page 13: Storage Notes

Student Notes Theory

What is Storage access?

How data files are stored in secondary storage varies with the types of media and devices you are using. Data files may be stored on or in sequential-access storage, direct-access storage, or random-access storage

Serial (Sequential) Access

Punched cards, paper tape, and magnetic tape are examples of sequential-access storage media. When operating in a sequential environment, a particular record can be read only by first reading all the records that come before it in the file. For example, when you store a file on tape, the 125th record cannot be read until the 124 records in front of it are read. The records are read in sequence. You cannot read just any record at random. This is also true when reading punched cards or paper tape.

When a serial access medium is being used, the head that reads data from the storage medium has limited freedom of movement. Because of this it can take a very long time to locate a record/file on a tape and so tapes are only used for specific applications such as backup and batch processing. For these applications the speed of locating data is not important and the other advantages of magnetic tapes outweigh the slow access speed.

Suitability of use: Payrolls

Direct (Random) Access

Direct-access storage allows you to access the 125th record without first having to read the 124 records in front of it. Data can be obtained quickly from anywhere on the media. However, the amount of time it takes to access a record is dependent to some extent on the mechanical process involved.

When direct access is used the head that reads data from the storage medium can move directly to any point on the storage medium. If a particular record or file must be loaded or saved then the head can move directly to the record/file's position on the storage medium and read the data. Records and files can therefore be located very quickly.

Magnetic disks such as hard disks and floppy disks and optical disks such as CD-ROMs use the direct access method. Direct Access is required if transaction processing is taking place.

Suitability of use: Airline booking

Questions1. Punched cards, paper tape, and magnetic tape use what storage access method? 2. What kind of storage allows you to access the 125th record without having to read the 124

records in front of it?

Access time (typical, faster or slower)

Access time is the time between the computer’s request for data from secondary storage and the completion of the data transfer. It is basically the time taken for a hard disk (or cd-rom) to seek data and is measured in milliseconds (1/1000th of a second). If you have a hard disk with an access time of 10ms, a file of 10Mb will take less time to be found than another hard disk with an access time of 12ms.

13/ 14 K. Aquilina

Storage Access Methods Storage Access Methods Further Reading

Merlin pg 253Glossary pg 267

Page 14: Storage Notes

Student Notes Theory

Typical access time (time to seek data) is between 9ms and 12ms. The lower the access time, the more costly a device is. Access time for most disk drives is, in fact under 25 milliseconds.

14/ 14 K. Aquilina