410 likes | 420 Views
Explore how main memory stores and accesses data, using semiconductor chips and unique addresses. Learn about address representation, decoding, and addressing multiple memory cells. Find out the memory's capacity, access time, and transfer rate for efficient data handling.
E N D
Chapter 3 Data Storage
Media Storage • Main memory (Electronic Memory): • Stores data currently being used • Is made of semiconductor chips. • Secondary Memory • 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 • In reality, most electronic memories have 8-bit cells. n-bit cells Can hold m*n bits m 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 onetop down. • An instruction may tellthe 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 Main memory CPU Add. bus Data bus Control bus
Address Bus Address Of the cell To activated Address Of the cell To activated Main memory CPU Address bus
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 Unique cell Has a unique Address. Address Of the cell To activated Main memory CPU Decoder Address bus
A Simple Address Decoder Q0 00 C0 2 ad-lines A1 Q1 01 C1 4 address cells A0 Q2 10 C2 Q3 11 C3 Decoder is a device between the Main Memory and the address lines.
Decoder with N Address Lines Main Memory 0000…0000 a0 a1 0000…0001 0000…0010 N add. lines 2N add cell 1111…1111 AN-1
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 2 Address Lines (multiplexed addresses) 00 00 01 10 00 01 10 11
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 • 28 • 82 • 216
Example 1 • Suppose computer’s MainMemory is linked to a decoder with 8 address lines. • Can 1000 memory cells be used? • If no what is the maximum number of addresses that can generated?
Answer • Suppose computer’s MainMemory is linked to a decoder with 8 address lines. • Can 1000 memory cells be used? • If no what is the maximum number of addresses that can generated? • Answer: • NO • With 8 address lines, the maximum number of addresses is 28=256
Example 2 • Suppose that a computer’s MainMemory 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 MainMemory 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: • 32KB, 256MB and 20GB are used to describe the memory capacity.
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 CPUwants 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 RandomAccess
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 • 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. Coil of wire Iron former
CPU Add. bus Data bus Control bus Read and Write Mechanism (2) 1 01010 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.
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