Computer Storage Section 1 What is Computer Storage? Computer storage refers to all units of computer equipment that can be used to store data and instructions either permanently or temporarily. Different types of Computer Storage. A typical computer system has different types of storage and these can be divided into two groups; Internal Storage and External Storage. Figure 1.1 Computer Storage ! Computer storage is sometimes referred to as computer memory. However, the term memory generally refers to internal storage while the term storage usually Internal Storage External Storage refers to external storage devices. Brain Teaser Can you mention some units of computer equipment that are able to store data either permanently or temporarily? HINT: mp3 files, word processing files and photos are considered as data. On which media do you store this data. 1 Internal Storage Section 1.1 What is Internal Storage? Every computer has some kind of Internal Storage, which consists of the CPU Registers, Cache and Main Memory (RAM and ROM), see figure 1.2. These are usually referred to as memory units. Figure 1.2 Internal Storage CPU Registers Cache Main Memory RAM ROM Internal Storage stores data and instructions that are being processed by the Central Processing Unit (CPU). All these storage units can be randomly accessed. Random Access memory location Random Access means that all memory locations in a particular memory unit (example RAM or Cache) can be accessed directly in the same amount of time. Therefore, the access time will be the same for any read or write operation. So we can say that if the Central Processing Unit is accessing data from location 1 in RAM it will take the same amount of time as if the data was accessed from location 100 in RAM. 2 Internal Storage Section 1.1 What is Access Time? The access time (performance) of an internal memory unit is the time taken for the CPU to write or to read data from that particular internal storage unit. Figure 1.3 Note that the main memory, cache and er m eg ab yt e (a s es cc Main Memory e) tim levels have the fastest access time, therefore they are more expensive and their capacity is smaller. Cache ce an In this storage hierarchy the topmost registers rm fo ! CPU r Pe CPU registers have different access time. Co st p ! RAM & ROM Backing Storage Capacity Did You Know? The access time of internal memory units is measured in nanoseconds (ns). Nanosecond = A billionth of a second. 3 Internal Storage Section 1.1 Figure 1.4 CPU Cache Main Memory This diagram shows that data and instructions are exchanged between the CPU, Cache and Main Memory. In fact, each time the CPU needs data and instructions to process, it first checks the Cache and if the required information is not there it then fetches it from the Main Memory. Why do we need three types of Internal Memory? CPU Registers - These are tiny storage units which are placed right inside the processor core, and they are the fastest type of internal storage (lowest access time). Registers are able to hold few bits of data that the CPU is currently working with. Typically, registers can hold 16 or 32 bits. Cache Memory is the second fastest type of memory. It is capable of delivering data at or near the speed of the CPU. The purpose of Cache is to allow the computer to operate faster, by storing the most recently used data so that the CPU would not have to wait while each item is fetched from the slower Main Memory. However, the capacity of cache memory is usually very small because it is expensive, examples of typical cache sizes are 2Mb, 1Mb, and 512K. Main Memory consists of both RAM and ROM (figure 1.2), and it contains data and instructions that need to be accessed by the CPU. The Main Memory Unit is also called the Central Memory, Immediate Access Memory or Primary Memory. The CPU can only process data that is in main memory. Therefore, every program you execute and every file you process must first be copied from a backing storage device into main memory. The amount of main memory on a computer is crucial because it determines how many programs can be executed at one time and how much data can be readily available to a program. The purpose of main memory is : • To store the program that is being executed. • To hold data processed by the running program. Brain Teaser A student decided to install a cache that is faster than the CPU, because he believes that this will speed up his computer. Do you agree with this student, Yes or No? Answer: no 4 RAM Section 1.2 What is RAM (Random Access Memory)? RAM is used to temporarily store all the information being processed by the CPU. The RAM is a read-write memory thus information can be read and written to it. When you first turn your computer on, the RAM is empty since it is volatile. Volatile means that everything stored in RAM will be lost each time the computer is switched off. RAM will contain no data and instructions until you load a program. These data and instructions are originally permanently stored in the external storage devices, like CD ROM, hard disk or floppy disk. When you load the program, part of it is copied from the external device it is located on to the RAM, which is directly connected to the CPU. This is necessary because the CPU can only fetch data and instructions from RAM. The RAM is useful because it can feed data and instructions to the central processor at extremely high speeds. However, programs cannot be permanently stored on the RAM because • RAM, unlike hard drives, is not big enough to store all the programs a computer system contains. • RAM is expensive. • RAM is volatile. Application of RAM outside the CPU In a printer some RAM is needed to store the next set of data to be printed. Did You Know? ! Increasing RAM might increase the performance of your computer. ! Nowadays we normally find home computers with 256MB, 512MB, or 1G RAM. ! Two different types of RAM are SRAM (Static RAM) and DRAM (Dynamic RAM). Static RAM provides faster access to data and is more expensive than DRAM. 5 ROM Section 1.3 What is ROM (Read Only Memory)? The ROM is a Read-Only Memory. This means that the CPU can only read its contents, so it cannot change or alter it in any way. ROM is used to store those programs essential for the normal running of a computer system such as the Bootstrap Loader. The Bootstrap Loader is a small program that is executed after switching on the computer. Its function is to load Windows and run it, thereafter the user can start using the computer system. ROM is nonvolatile which means that all data and instructions stored on ROM will not be lost once the computer is switched off. Note that any data and instructions stored on ROM are permanently fixed during the manufacture of the ROM integrated circuit. ROMs are very cheap and reliable, but unfortunately, they are read-only. Application of ROM outside the Computer. In a modern washing machine, the processor needs ROM to permanently store the control program and RAM to temporary store data created by the program. Different types of ROM? PROM (Programming Random-Access Memory) is a memory IC which is manufactured blank so that the user is then able to store the desired programs on it. The disadvantage of PROM is that it can only be programmed once. EPROM stands for Erasable and Programmable ROM. Like PROM, EPROM is also manufactured blank so that the user can write programs on it, but it also has the additional feature of being erasable. To erase an EPROM, UV light is used. Thus the advantage of EPROM is that this kind of ROM can be re-programmed. The EEPROM is similar to the EPROM, except that you don't have to erase the entire chip to change some information. Also, another advantage is that you do not need any special equipment, like UV light, to erase the chip. Pen drives and flash memories are example of EEPROM (see page 20) Brain Teaser Can ROM, like RAM, be directly accessed by the Central Processing Unit. Yes or No? Answer: no 6 Answer: yes External Storage Section 1.4 What is External Storage? External Storage Devices store data and instructions that are not currently being processed by the central processing unit. It is important to note that External Storage Devices are also referred to as Backing Storage Devices and Secondary Storage Devices. They are an essential part of a computer system due to the two major constraints of the main memory unit. • Volatile - Whatever stored in RAM is lost when the computer is switched off. Thus we need a place to store our programs and data so that they will not be lost when the computer is switched off. • Limited Size - Even on computers with large internal memories, the amount of storage needed on a typical computer system is far greater than the storage available in memory. Since internal storage is expensive, we need a relatively cheaper form of backing storage which can be used to store vast quantities of information. The main advantage of every secondary storage device is that it is non-volatile thus everything stored on a secondary storage device is not lost once the computer is switched off. The main disadvantage, is that the central processing unit is not able to directly access the data and instructions stored on secondary storage devices so a copy of the program must first be transferred into main memory. Most secondary storage systems consist of the drive and the medium. The medium is the material on which data and instructions are stored. The drive/device is the mechanical part of the system that is able to place data on the me- dium and to fetch it from the medium. Since, most backing storage devices operate mechanically it takes much longer to access data which is on backing storage devices than data which is in main memory. Brain Teaser 1. In the adjacent diagram which internal storage unit is not listed? 2. How many backing storage devices are listed? Answer: Cache , 3 7 External Storage Section 1.4 The need for Backups It is very important to keep a backup of all the data and programs stored on your hard disk, in case it gets lost or damaged. Backups will be saved on some form of backing storage. Main Differences between Internal and External Storage. • Internal Storage stores data and instructions that are being processed by the Central Processing Unit. • External Storage Devices (Backing Storage) store data and instructions that are not being used by the Central Processing Unit. • The Central Processing Unit can only directly access the data stored on Internal Storages. • Internal Storage is much faster than External Storage (figure 1.3). • Internal Storage is much more expensive (cost per megabyte) than External Storage (figure 1.3). • Internal Storage is much more expensive than External Storage. For this reason, Internal Storage Units are manufactured with small storage capacity because otherwise the computer will become too expensive. 8 Types of Backing Storage Section 1.5 Classification of Backing Storage Devices. Secondary storage devices can be split into two major types, Magnetic and Optical Storage Devices. Lately, however, there is a newer type of secondary storage which is totally different and is like permanent RAM. These are known as Electronic Storage Devices. Note that each type of storage device uses different principles for reading and writing the 0s and 1s stored on the medium. Figure 1.5 Backing Storage Magnetic Storage Devices Electronic Storage Devices Optical Storage Devices Magnetic Storage Devices - All magnetic storage devices store the logic 0s and 1s as magnetic spots, where logic 1 and logic 0 are represented by a particular polarity (North or South). Warning Since magnetic storage devices store data in the form of magnetic spots, it is important not to leave any magnets near the storage medium because this might alter the data stored on the medium. Optical Storage Devices - Note that all optical storage devices make use of different techniques in order to store data, but data is read using the same principle. A laser beam is shone over the surface of the medium and the amount of light reflected will be detected by the photo detector, which then converts this information into logic 1s and logic 0s. Electronic Storage Devices - Electronic Storage Devices store the logic 0 and logic 1 as electrical charge. 9 Data Access Methods Section 1.6 Data Access Methods One of the characteristics of a backing storage device is the method used to access the information stored on it. There are two main ways in which data can be accessed: Direct Access and Serial Access. Serial or Sequential Access storage location Any type of backing storage device that allows sequential access requires to start reading data items from the first storage location. This means that if data item 25 has to be accessed by the computer, all previous data items (from 1 to 24) have to be searched. Serial access is not effective in terms of time when only one particular item is required because all previous items have still to be searched. Direct Access storage location Any type of backing storage device that allows direct access is able to directly access any storage location on the medium. However, the amount of time the device takes to access a data item is dependent to some extent on the mechanical process involved. Random Access There are also some type of backing storage which are very similar to Main Memory, where any storage location can be accessed directly and at the same amount of time. 10 Hard Disk Section 1.7 A hard disk drive is the main storage device within a computer. It is where the operating system, application programs and data are kept. Nowadays, there is at least one hard disk within every desktop computer but it is possible to add more. Hard disks are capable of storing large amounts of information thus the storage capacity of a hard disk is measured in Gigabytes (GB). spindle A hard disk consists of a stack of permanently fixed (non exchangeable) rigid circular disks called platters. Each platter is made of aluminum or glass and coated on both sides with magnetic material e.g. ferrous oxide. The illustration on the left shows four platters forming a disk pack. These platters are connected to an axes (spindle) and they all rotate together around this same axes. Platter—note that each platter has two surfaces. Data on a hard disk is stored magnetically, as magnetized spots arranged in tracks and sectors (see section 1.8). Each magnetized spot represents one bit of information (binary 1 or 0). 11 Hard Disk Section 1.7 Spindle Surface O In order to perform the reading and writing operations Arm for Head 1 we need the read/write heads. There is one read/ write head for every side of each platter (see the diagram on the left). While the platters rotate, these heads move in or out (from the centre to the edge) over the surface to write or read data on the various Head O Head 2 Arm for Head 3 tracks. Therefore, all data found on a hard disk can be directly accessed. Whether it is a read or write operation, the read/write head hovers on a cushion of air, only nanometres above the disk surface. While performing a write operation the platter is exposed to a magnetic field, where it becomes instantly and permanently magnetized. magnetic field. Note that it can be re-magnetised in the opposite direction by exposure to a different When performing a reading operation the head will detect the magnetic field around the specific location on the platters, and then convert this pattern into binary digit. Did You Know? The first disk drive was the IBM 350 Disk File, and it was introduced in September 13th 1956 with the 350 RAMAC computer. It had 50, 24” platters which held 4.4 MB of data. These platters are marked with the red arrow in the adjacent picture. Its cost was $50,000. Before the 350 RAMAC, magnetic computer storage had consisted of core memory, tape, and drums. 12 Hard Disk Formatting Section 1.8 How is data organized on a Hard Disk? Data and instructions stored on a hard disk need to be organized in some way. This is why platters are virtually divided into several tracks, where each track is further divided into sectors. These tracks and sectors are formed during hard disk formatting. This process prepares the disk to hold data and instructions. In fact, all backing storage devices must be formatted before any data can be stored on them. A sector is the smallest unit of data that can be read or written from a disk. Typically, sectors are 512 bytes in size, but other sizes including 1024 and 2048 are common. These sectors have a fixed size, that is all sectors on the same disk are of the same size. However, these sizes may vary from one disk to another. A cluster is the smallest unit of data that can be allocated to a file. consists of a number of sectors. It It is important to realize that the larger the sectors, the more disk space will be wasted. This occurs, because if for example a sector is 32K and we need to store a 5K file, 27K of disk space will be wasted. A track is a concentric ring of sectors on a platter. A read/write head can read all the data from a certain track by moving the read/write head to any position on that track and then rotate the stack of platters. A cylinder is made up of a group of tracks, where each track is found on a different platter and all tracks need to be on top of each other. When data is stored on the same cylinder it will reduce the access time since there will be no need to move the read/write in and out. 13 Filing System Section 1.9 Why do we need a Filing System? When formatting a storage device, a file allocation table is created which stores the location of all files on disk. The Operating System needs this file allocation table in order to know which sectors are storing which files, so that it would be able to load your files when you need to access them later on. Usually files are too large to fit in one sector, therefore a file is typically stored into a number of sectors. Many filing systems make use of clusters. This means that files are organized into clusters and not into sectors. File Allocation Table Example Consider a file that is stored in locations 0003, 1003 and 2003. The file allocation table will store something like this. File File X Location 0003 1003 2003 Pointer to next location 1003 2003 null File X only directly points to the first sector allocated to it, that is 0003. Then that sector will point to the next sector, and so on until the null signal is met which means that the file ends there and no more sectors are allocated to it. There are different allocation tables, including FAT, NTFS FAT (File Allocation Table) is one type of allocation table that allocates 12, 16 or 32 bits for each address. This system is the only allocation table that can be used by MsDos, Windows 95, 98 and ME. Although nowadays Windows still support the FAT system, the NTFS is taking over. FAT is nowadays mostly used for floppy disks and pen drives. NTFS (New Technology File System) is a more recent filing system, which supports several features that FAT does not, such as high security, larger disks and Unicode file naming. Systems that use NTFS include Windows NT 4.0, 2000, Server 2003 and XP. These systems, however, support FAT as well. Did You Know? Q. When a hard disk is formatted all data is lost, but is the data really erased from the hard disk? A. The answer is no. What happens is that the file allocation table is deleted so the Operating System would not know where the files are stored on the hard disk. 14 Floppy Disk Section 2.0 IBM introduced the first floppy disk in 1971, but it was a bit different from the one we use today. In fact, before the 3½” floppy disks were introduced, there were the 8” and 5¼” floppy disks. The older ones were flexible, bendable, and fairly big. Nowadays, the 3½” floppy disk is fairly small and the medium is contained in different coloured plastic cases. 5 1 Different types (3½”, 5¼” and 8” ) of floppy disks. Components of a Floppy Disk A 3½” floppy disk basically consists of 5 different components. 2 1. Protective Case - the purpose of this plastic case is to protect the magnetic disk from dust, water, etc and from being scratched. 3 2 2. Felt Ring - its purpose is to protect the magnetic medium from dust. 3. Magnetic Disk with metal hub in the middle. This is the medium on which data is stored. 1 4. Shutter 5. Label found on the front of the protective case. 4 Floppy disks have a safety feature, in order to protect data from being accidentally erased. This is possible because of the write protect switch. Note that 5¼” floppy disks had a write protect notch, which used to be covered by a sticky paper tab in order to prevent the computer from writing data to the disk. Nowadays, 3½” floppy disks, have a built-in slideable plastic tab to implement write-protection. 15 Floppy Disk Section 2.0 The floppy disk is a magnetic secondary storage device, which uses direct access to retrieve and write data. Despite the size difference, floppy disks are still very similar to hard disks and have many of the same components. Like the hard disk, floppy disks also have read/write heads. These heads are used both to read information stored on the disk and to write information into the disk. There are two read/write heads on a floppy disk - one on either side of the disk. This means that a floppy disk is double sided and is capable of storing information on both sides. The read/write head in the floppy disk drive touches the disk surface and therefore to reduce the wearing way of the magnetiseable coating, the disk only rotates during reading/writing operations. Although, floppy disks store and retrieve data in the same way hard disks do, their access time is much higher. Formatting a floppy disk Like hard disks, floppy disks need to be formatted in order to be able to store data and instructions. Most floppy disks you buy today are already formatted by the manufacturer (see adjacent picture). Floppy Disks are formatted using the same principles explained in pages 10 to 11. The 3½”, HD format, floppy disks uses 512 bytes per sector, 18 sectors per track, 80 tracks per side and two sides, for a total of 1,474,560 bytes (1.44Mb) per disk. It is important to know that if the write protect notch is set on it would not be possible to format the floppy disk. Did You Know? Floppy Disk Chronology • In 1971, IBM introduced the first floppy disk. This was the 8" floppy disk. • In 1976, the 5¼” floppy disk was developed by Alan Shugart for Wang Laboratories. • In 1981, Sony introduced the first 3½” floppy disk. 16 Floppy Disk Section 2.0 Protect the Data stored on Floppy Disks • • • • • • Protect your floppy disk from high or low temperatures. Keep your floppy disk away from devices that produce magnetic fields. Put your floppy disk in a hard plastic cover to protect it from dust and water. Do not bend your floppy disk because you might break the protective case. Do not touch the magnetic disk because this might corrupt the data stored on your floppy disk. Do not put heavy objects on your floppy disk. Finally, if a floppy disk starts showing problems, copy the data to a new disk and throw away the old disk. Did You Know? For more than two decades, the floppy disk has been the most usable portable storage device. Nowadays, floppy disks are being replaced by CD-ROMs, DVDs and pen drives. In fact, certain computer manufacturers like Apple have removed the floppy drive from their machine. In 1998, the iMac were produced without floppy drives. 17 CDs & DVDs Section 2.1 Another way of storing data is by using optics. This is the method used by CDs (Compact Disks) and DVDs (Digital Versatile Disk). CDs and DVDs have become very popular because they can store much more data than floppy disks. In fact, they have replaced floppy disks due to their high speeds and large storage capacity. 1 CD can store the equivalent of about 400 floppy disks. CDs and DVDs are flat, plastic discs whose undersides are coated with a thin layer of light-reflecting aluminum. Data is encoded on them in a spiral form, therefore CDs and DVDs have only one track (see the diagram on the right). In order to read the data stored on CDs and DVDs we need a specific devices, these are the CD-ROM drive and DVD drive or DVD player. However, nowadays we find drives that are able to read both CDs and DVDs. These drives can move the reading mechanism (the laser beam) to any area of the disk surface for direct access. Note that the disk only rotates during a reading operation. Data is encoded in a spiral form Different types of CDs and DVDs 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 between 700Mb to 800Mb 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 referred to as WORM (Write Once Read Many). Data is stored as a sequence of surface variations called lands (flat surface) and pits (bumps or holes). These lands and pits cannot be seen by the naked eye. The laser beam is shone onto the surface of the disk and light is reflected back. The amount of light reflected varies according whether it hits a land or a pit, this is how logic1 and logic 0 are represented. CD-R (Compact Disk - Recordable) - A CD-R disk is blank when bought. The user can write data to it just once. After data has been written to the disk it cannot be changed. The user must have a CD Writer, which is a device that writes data on a blank CD. CD-RW (Compact Disk - Rewriteable) - CD-RW disks are like CD-R disk with the only difference that they can be written more than once. Here the user also needs to have a CD Write. Did You Know? The first data CD-ROM was developed in 1985, by Sony and Philips. 18 CDs & DVDs Section 2.1 DVD (Digital Versatile Disk - Read Only Memory) - DVDs are of the same diameter and thickness as CDs, and they are made using some of the same materials and manufacturing methods. However, DVDs are able to store more data than CD-ROMs. Like CD-ROMs, the data on a DVDs is encoded in the form of pits and lands. There are different types of DVDs, each vary in the amount of data they can store. The reason is that DVDs may have one or two sides written with data, and one or two layers of data per side. • • • • Single Sided, Single Layer DVD Single Sided, Dual Layer DVD Double Sided, Single Layer DVD Double Sided, Dual Layer DVD - have the largest capacity that of 17GB By looking at the DVD one can understand whether they are single or double sided. Double sided DVDs have both sides shiny, that is both sides of the DVD will look like the bottom side of a CD-ROM. DVD-R (Digital Versatile Disk—Recordable) - Like CD-R, DVD-R are bought blank and the user is able to write data on them. The user needs to have a DVD Writer, which is a device that writes data on blank DVDs. Protect the Data stored on CDs and DVDs • Always put your CD or DVD back in its case after using it. • If there is an emergency, and you have to leave your CD or DVD out, put it face down, so the aluminum is facing up. • Don’t stack CD’s or DVD’s on top of each other. • Clean your CD or DVD regularly, important to clean it outwards and not in a circular movement. • Whey you hand a CD or DVD, hold it on the sides, and do not touch the shiny bottom. • Keep CD’s and DVD’s away from hot places and from direct light. • Make sure not to scratch your CD or DVD. • If you are going to write on a CD or DVD, in order to label it, make sure you use a CD/DVD Pen and that you write on the surface. 19 Flash Memory Section 2.2 What is Flash Memory? Flash Memory is a form of EEPROM and this type of memory is commonly used in memory cards, USB flash drives, MP3 players, digital cameras and mobile phones. Since flash memory is a type of EEPROM it implies that it can be randomly accessed and that it is non-volatile. Memory Cards and Flash Drives are the latest technology of secondary storage devices. In fact, they are still quite Pen Drive Memory Card expensive. These electronic secondary storage devices are very reliable and consequently they are becoming more popular. Memory Card There are different types of memory cards such as Smart Media (SM) Card, Secure Digital (SD) Card, MultiMedia Card (MMC) and more. Each type of memory card is used for a specific purpose. In order to be able to read the data from a memory card we need a device know as Memory Card Reader. Pen Drive Unlike any magnetic or optical storage device, pen drives need no drive to read or write their data. Pen drives use the USB port to connect to the computer. USB ports are found on every modern computer thus pen drives are very portable. External Flash Memory Card Reader. This type of card reader is connected to the computer through USB. Did You Know? The flash drive was first invented in 1998 at IBM as a floppy drive replacement for the ThinkPad line of products. 20 Conclusion Section 2.3 While Peter was cleaning one of his DVDs, he wondered why computers need to have so many different types of storage devices. He decided to go and search the Internet to find an answer to his question and he found the following answer. Well, if computer systems did not have so many different types of storage, it would either be extremely slow, or extremely expensive. The fast memories that can be accessed by the CPU directly are extremely expensive, while cheaper storage devices are extremely slow. By using a combination of both, both the price and the performance of a computer system are optimized! Helpful Hints The following websites contain some useful and well explained information on the topics covered in this chapter. • • • • http://computer.howstuffworks.com http://en.wikipedia.org/wiki/Main_Page http://www.answers.com/ http://foldoc.org/ 21
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
advertisement