Chapter 3 Data Storage Media Storage Main memory (Electronic Memory): Secondary Memory • Stores data currently being used • Is made of semiconductor chips. • magnetic (floppy discs, hard disc ) • Optical (CD-ROM, DVD) Main Memory Large collection of circuits, each capable of storing a single bit Arranged in small cells, typically of 8 bits each (a.k.a.: byte) Arrangement of Memory Cells Each cell has a unique address Longer strings stored by using consecutive cells value = 01101101 RAM (random access memory) Memory cells n-bit cells m cells Can hold m*n bits In reality, most electronic memories have 8-bit cells. Accessing Data in the Main Memory Instructions and data are stored in the main memory in a serial order. CPU executes instructions one by one top down. An instruction may tell the CPU • • to jump to particular cell and execute the instruction held in it, or fetch the data stored is that cell. How is this done? System Bus Main memory and CPU are linked using a set of wire: • Three wires: • • • • address lines, data lines and control lines. Known as • • • address bus, data bus and control bus. System bus To read data from each cell To issue read or write signal To identify each memory cell CPU Main memory Add. bus Data bus Control bus Address Bus Address Of the cell To activated CPU Main memory Address bus Address Of the cell To activated Binary Address Representation Each cell has a unique address. I.e. using 4 digit binary representation we have: 0000 cell 0 0001 cell 1 0010 cell 2 0100 cell 3 How many bits are needed to represent an address? Address Decoder Address Of the cell To activated Unique cell Has a unique Address. CPU Main memory Decoder Address bus A Simple Address Decoder 2 ad-lines A1 A0 Q0 00 C0 Q1 01 C1 Q2 10 C2 Q3 11 C3 Decoder is a device between the Main Memory and the address lines. 4 address cells Decoder with N Address Lines Main Memory a0 a1 0000…0000 0000…0001 0000…0010 N add. lines 2N 1111…1111 AN-1 add cell Multiplexer Cells form rows and columns. Each cell can be identified by a row address and column address. Each cells address uses only N/2 address lines. This can be done using a multiplixed addresses. Decoder with 4 Address Lines (non-multiplexed addresses) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Decoder with 2 Address Lines (multiplexed addresses) 00 01 10 11 00 01 10 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 00 Two-Input Multiplexer A multiplexer is an electronic device that allows multiple logical signals to be transmitted simultaneously across a single physical channel (address line). Choose the correct answer A computer’s main memory is linked to a decoder with 8 address lines. The maximum number of address that can be generated is (a)28 (b) 82 (c)216 Example 1 Suppose computer’s Main Memory is linked to a decoder with 8 address lines. 1. Can 1000 memory cells be used? 2. If no what is the maximum number of addresses that can generated? Answer Suppose computer’s Main Memory is linked to a decoder with 8 address lines. 1. Can 1000 memory cells be used? 2. If no what is the maximum number of addresses that can generated? Answer: 1. 2. NO With 8 address lines, the maximum number of addresses is 28=256 Example 2 Suppose that a computer’s Main Memory has 1013 cells. How many address lines are needed in order for all the cells to be useable? Explain your answer. Answer Suppose that a computer’s Main Memory has 1013 cells. How many address lines are needed in order for all the cells to be useable? Explain your answer. Answer: • • • • • With N address lines a computer can have a maximum 2N usable cells. 29 = 512, 210 = 1024. 9 address lines would not generate enough addresses for 1013 cells to be used. 10 address lines would. Having more than 10 address lines would lead to too many addresses wasted. So the desired number of address lines is 10. N = ⌈log2(1050)⌉ can be used to find the number of address lines. If multiplexed addresses is used, then 5 address lines would be sufficient for 1013 cells to be useable. Address Space The address space of a computer is the maximum number of cells a computer can hold. The address space is determined by the number of address lines used in a computer. If each cell in a memory is 8-bit, then the memory is called byte addressable: 1 byte long has a unique address Features of the Main Memory Memory Capacity. Access of information Access time Transfer rate Memory Capacity Most computer’s memory have 8-bit (1-byte) cells. In this case we have: Address lines No of cells Capacity N 2^N 2^N * 1 32KB, 256MB and 20GB are used to describe the memory capacity. Capacity Units 1kB = 210 = 1024 Byte. 1MB =1024 KB = 220 Bytes= 1, 048,576 B. 1GB =1024 MB = 230 kB=1, 073,741,824 Bytes. Access Time Access time is taken between the moment when the CPU wants the read/write from/into a cell and the moment when the cell is activated. It is the moment that the CPU takes to activate a cell. 60ns (10-9 sec) Transfer Rate Is the amount of information per second exchanged between the CPU and main memory. Main memory • electronic signals • Implies fast transfer rate in the scale about 100MB/sec Random Access If the CPU wants to activate particular cell. • It does not search for the target cell from top • • to bottom. It does put the address of the target cell in the address line, then the cell will be activated. This type of accessing information is called Random Access The need for other type of memories. Main memory • Fast as all the exchange between CPU and • Main memory is done electronically. However, it is volatile. • Information lost when the machine is turned off. • The need for non-volatile memory: • Hold information when the machine is off. • i.e. Magnetic disk, optical disk, magnetic tape A Magnetic Disk Storage System • Each track contains same number of sectors • Location of tracks and sectors not permanent (formatting) • Examples: hard disks, floppy disks, ... Magnetic Disk Terminology Platter: • • rigid metal or glass platter Coated with magnetic material. rotating at constant angular velocity Arm: • With movable magnetic read/write heads Track: • • A complete ring of data The disk surface is divided into tracks Sectors: • Each track is subdivided into sectors Cylinder (see slides 71-72): • A vertical collection of tracks at the same radial position Read/write Head Coil of wire Iron former A coil of wire wound onto an iron former. gap. If a spot on the magnetic memory passes under the gap then an electrical current is induced in the coil. And the read/write head will know that there is a 1 stored on that spot. Otherwise it is 0. By passing an electric current on the wire we can magnetise and demagnetise spots. Read and Write Mechanism (2) 1 CPU 01010 Add. bus Data bus Control bus 01010 1 1 Maximum data transfer rate It is the rate at which data passes under the read/write head (bytes/sec). • Number of bytes / track * Number of rev / sec Multiple Platters (2) • Disk platters speed (3600 to 10 000 rpm (rev/min). •floppy (360rpm). •The read data we need to specify cylinder, head, and sector numbers. Each cylinder represents a track number. Cylinders Magnetic Tape (1) Serial access Slow Very cheap High capacity Backup Optical Storage CD-ROM Originally for audio 650 Mbytes giving over 70 minutes audio Polycarbonate coated with highly reflective coat, usually aluminium Data stored as pits Read by reflecting laser Constant packing density (data/surface= constant) • • More data in outer edges Less data towards the centre of the disc Constant linear velocity • The drive must adjust the disc speed (495 to 212 rev/m) edges • • Faster when reading data closer to the centre Slower when reading data in outer edges Optical Storage – CD-ROM Is a disc with highly reflective surface. Tiny areas flat and depressed: • Flat (land) strong reflection. • Depressed (pits) low reflection. Laser landstrong reflectionphoto-sensor generates electrical voltagestore 1s. • Laser: (light Amplification stimulated emission of radiation). Lightpitslow reflection no electrical voltage stores 0s. Summary Main memory • RAM • Low storage capacity • Fast (electrical signals) • Volatile. Magnetic memory • Floppy disk • Hard disk • Magnetic tape Optical memory • CD_ROM disk • DVD