Скачать презентацию Memory and Storage What we ll cover for this Скачать презентацию Memory and Storage What we ll cover for this

85f126b3ad58ea5304f3eca63ed2ba07.ppt

  • Количество слайдов: 37

Memory and Storage What we’ll cover for this lecture topic: – Primary • Organization Memory and Storage What we’ll cover for this lecture topic: – Primary • Organization • Types • Attributes – Auxiliary (Secondary) • Types • Technology COMP 4—Power Tools for the Mind What’s in the box? 1 1

Computers basically have two-level storage: Primary storage: MEMORY (chips) Secondary/Auxiliary storage: STORAGE (disks…) Processor Computers basically have two-level storage: Primary storage: MEMORY (chips) Secondary/Auxiliary storage: STORAGE (disks…) Processor CU Inputs ALU Memory RAM Outputs ROM Storage COMP 4—Power Tools for the Mind What’s in the box? 2 2

Primary Memory – Functional unit for storing & retrieving all 5 kinds of information Primary Memory – Functional unit for storing & retrieving all 5 kinds of information -- used by the processor. – “electronic storage == no moving parts” ( fast!!!!) – For every transformation: – The processor must fetch a basic instruction, one at a time, and copy it to its own special storage registers before it can do any operation/transformation on data. – The processor also has to copy the data into its own special storage registers ( more about the actual process later). – The processor is also electronic … and very FAST !!! – We don’t want to slow down the processor. Therefore we use electronic storage (rather than electromechanical). COMP 4—Power Tools for the Mind What’s in the box? 3 3

Digression: a basic machine language statement: – OP CODE: part of machine code (a Digression: a basic machine language statement: – OP CODE: part of machine code (a bunch of bits) that tells the CPU which operation to perform (add, multiply, compare, . . . ) – OPERAND: also part of the machine code (another bunch of bits) that tells the CPU at which memory address the data is stored that is should operate on. You will see a lot on about this soon when we study the architecture of the CPU and how it operates on data (e. g. transforms data). COMP 4—Power Tools for the Mind What’s in the box? 4 4

– MEMORY: Holds INSTRUCTIONS & DATA that we are interested in processing NOW. Arrangement – MEMORY: Holds INSTRUCTIONS & DATA that we are interested in processing NOW. Arrangement (similar to P. O. boxes): # 0000 – Each is called a memory cell or a memory location. – Each cell is identified by a unique binary address. – Each cell contains a certain number of bits (usually eight). – Similar to what in a spreadsheet? – Why is uniqueness important? COMP 4—Power Tools for the Mind 1111 0000 # 0000 0001 0110 0101 # 0000 0010 0101 0011 # 0000 0011 1001 # 0000 0100 1100. . . What’s in the box? 5 5

Memory addressing – Just as Excel uses a cell reference in a formula to Memory addressing – Just as Excel uses a cell reference in a formula to locate a cell and to read the data stored in that cell, a program uses a memory address. – So a memory cell address is similar to a spreadsheet’s absolute cell reference (e. g. $B$24). – The cell contents can change, but the cell address or reference to the cell is always the same. – A program can write to and read from a memory cell through their address. memory CPU LOAD #0000 0011 A # 0000 0011 Register A ADD A 1 1 0101 ____ _ _ 0 0 1 0 STORE A #0000 0011 0 1 0 0 1 COMP 4—Power Tools for the Mind What’s in the box? 6 6

– What happens to data when we write or read? – What happens when – What happens to data when we write or read? – What happens when you type (write) something into a spreadsheet cell that already contained some data? – Writing destroys what was stored there. – What happens if an Excel formula reads a data value from another cell: – Reading does not destroy what is stored there. It just “hand-over” a copy. – “ 32 -bit memory-addressing” means that the computer uses memory addresses that are 32 bits long: 32 2 4 GB (billion) – the “address bus” are the wires that carry bits between the different CPU and the memory addressable – a 32 -bit bus carries 32 bits at a time memory cells. COMP 4—Power Tools for the Mind What’s in the box? 7 7

– UNLIKE a spreadsheet cell, a single memory cell can hold much less: 8 – UNLIKE a spreadsheet cell, a single memory cell can hold much less: 8 bits – Cannot address bits individually (grouped by 8) One memory cell: #0000 0001 0100 0001 COMP 4—Power Tools for the Mind What’s in the box? 8 8

Interesting digression # 0000 0001 0100 0001 • How many memory cells are required Interesting digression # 0000 0001 0100 0001 • How many memory cells are required to hold one ASCII character? • How many cells required to hold a bit pattern that can represent a single pixel with a “ 24 -bit color”? • How many cells required to hold an standard precision integer (which requires 32 bits)? • How many cells required to hold an high precision real number (which requires 64 bits)? • And……. what is the term for 8 bits (which happens to fit perfectly into one memory cell)? COMP 4—Power Tools for the Mind What’s in the box? 9 9

– So, each memory cell (location) can hold 8 bits, or one byte. – – So, each memory cell (location) can hold 8 bits, or one byte. – Those 8 bits, in turn, could represent, at a given time: • Part of an integer or real number Integers: typically 32 bits; Real: either 32 or 64 bits • The bit pattern for one alphanumeric character (one character byte) • • Part of a bit pattern for a sound sample. The bit pattern for one pixel with “ 8 -bit color. ” 1/3 rd of a bit pattern for one pixel with “ 24 -bit color. ” A part of an instruction. COMP 4—Power Tools for the Mind What’s in the box? 10 10

What did we say keeps track of what kind of information a bit pattern What did we say keeps track of what kind of information a bit pattern (in memory) is representing at a given moment? the program (e. g. software) Logical structure of 1 memory cell: 8 bits Physical structure of 1 memory cell: 8 capacitors • Total primary memory and auxiliary storage in one’s computer is measured in bytes. – – Kilobyte (KB or K): Megabyte (MB): Gigabyte (GB): Terabyte (TB): COMP 4—Power Tools for the Mind ~ 1 thousand ~ 1 million ~ 1 billion ~ 1 trillion 210 220 230 240 What’s in the box? 11 11

Types of primary memory – RAM: Random Access Memory • RAM is fast. – Types of primary memory – RAM: Random Access Memory • RAM is fast. – Virtually no speed penalty for accessing bits, no matter which cell they’re in: “Random access” • RAM is writable (by the user). (launch; load; edit…) • RAM is volatile. • Stores what’s being used now: Mostly determined by whom? Often called “user memory” - • Typically 256 or 512 MB (and up) for personal computers. • Advice: Buy as much as you can afford. • Affects overall speed of system (page faults, caching) COMP 4—Power Tools for the Mind What’s in the box? 12 12

– ROM (read-only memory) • • Contents pre-written and permanent: non-volatile. Typically small: <1 – ROM (read-only memory) • • Contents pre-written and permanent: non-volatile. Typically small: <1 MB Stores bootstrap program. Stores BIOS (very basic parts of the operating system that rarely change are hardwired in ROM) • Often called: Firmware. Why do you suppose? Just for culture: • Other flavors of nonvolatile primary memory: PROM; EEPROM • Flash Drives • CMOS (battery-powered; see text for more info) “Virtual Memory” use disk space to simulate RAM • Textbook has a good explanation of this process so I won’t cover it much here. Just understand the basic idea behind it. COMP 4—Power Tools for the Mind What’s in the box? 13 13

Processor CU Inputs ALU Memory RAM Outputs ROM Storage COMP 4—Power Tools for the Processor CU Inputs ALU Memory RAM Outputs ROM Storage COMP 4—Power Tools for the Mind What’s in the box? 14 14

Auxiliary Storage – Want more memory than is affordable in electronic memory. • Cheaper: Auxiliary Storage – Want more memory than is affordable in electronic memory. • Cheaper: shares one set of electronics for R and W (the head). –But much slower: at least by 10, 000 times. –Physically moves medium past R/W mechanism. – Need non-volatile storage that is recordable. Primary memory: like your closet • Access is frequent and fast; but less is taken at a time (4 - 8 bytes). Secondary storage: like your attic • Access is less frequent and much slower; but a whole block of data is taken at a time. (256 - 1024 bytes) COMP 4—Power Tools for the Mind What’s in the box? 15 15

MAGNETIC Storage • Most common form of storage. • Magnetized spots on a surface, MAGNETIC Storage • Most common form of storage. • Magnetized spots on a surface, which may be – on a tape, which itself moves past a R/W head (like audio tape) • Device: tape drive or unit • Medium: tape (reel or cartridge) – on a disk, whose R/W head moves over it as it spins. • A disk may be floppy or rigid • A disk may be fixed permanently in the drive or removable. • Device: disk drive • Medium: disk COMP 4—Power Tools for the Mind What’s in the box? 16 16

How a magnetic recording works A moving electrical charge (current) creates a magnetic field. How a magnetic recording works A moving electrical charge (current) creates a magnetic field. . . depending on the direction that the current flows “INDUCTION” COMP 4—Power Tools for the Mind The resulting magnetic field can be in one of two different orientations (polarities): North-South (clockwise) South-North (counter-clockwise) What’s in the box? 17 17

So: we can send a current through a wire (the R/W mechanism) to magnetize So: we can send a current through a wire (the R/W mechanism) to magnetize a spot on an iron surface nearby. The spot (with magnetic field around it) will have one of two orientations. This way the head records (writes) physical representations of 0 s and 1 s on the iron surface. COMP 4—Power Tools for the Mind What’s in the box? 18 18

A moving magnetic field creates an electric field. . . So: if there’s a A moving magnetic field creates an electric field. . . So: if there’s a wire coil nearby, the current is sent through it in one of two different directions The READ head interprets the direction of the incoming current as a 0 or a 1. COMP 4—Power Tools for the Mind What’s in the box? 19 19

Magnetic tape • Ribbon coated with iron oxide Tape head • Reel-to-reel (old mainframes) Magnetic tape • Ribbon coated with iron oxide Tape head • Reel-to-reel (old mainframes) • Cassettes, cartridges • Sequential Access storage device: – to reach data written at the end need to go through all other data – transport COMP 4—Power Tools for the Mind TAPE – short-term backup 0 1 1 1 0 0 0 • Generally used for: What’s in the box? 21 21

Magnetic disks • Surface divided into wedges: Sec 6 Track 1 Track 2 Sec Magnetic disks • Surface divided into wedges: Sec 6 Track 1 Track 2 Sec 5 sectors. • Bits are stored within a sector along concentric circles called Sec 4 tracks. (Floppy disk: ~80 tracks) • All disk drives are “DASDs”: Direct Access Storage Devices Track 0 Sec 1 Sec 3 Sec 2 – File is accessed directly by giving the address of each block on the disk that contains the file. – Similar to random access except it has speed penalties. Why do you think that’s so? – DIGRESSION: Speed…. SEEK time, SPIN rate COMP 4—Power Tools for the Mind What’s in the box? 22 22

 • Floppy disks (diskette) and drives Transportable storage. Good to back-up a few • Floppy disks (diskette) and drives Transportable storage. Good to back-up a few files. Digression: Would you recommend backing up data from an entire hard drive on standard floppy disks? Why or why not? What could you backup? – Flexible plastic mylar …; removable media – Slow spin rates (360 to 400 rpm) – Slow seek time (~300 ms) • R/W heads touch disk surface – Cheap, abundant, portable COMP 4—Power Tools for the Mind What’s in the box? 23 23

– Have gotten smaller, cheaper, higher density • outdated: 8” (20 KB); • old: – Have gotten smaller, cheaper, higher density • outdated: 8” (20 KB); • old: 5. 25” (140 KB – 1. 2 MB); • low density 3. 5”: 720 KB • high density 3. 5”: 1. 44 MB most popular • Super. Disk 3. 5”: 120, 144, and 200 MB – Write protect window… what for? – Any special care for disks? – Do floppy disks ever fail? COMP 4—Power Tools for the Mind What’s in the box? 24 24

 • Hard disks/disk drives (fixed) – Rigid aluminum or glass; various sizes; >1 • Hard disks/disk drives (fixed) – Rigid aluminum or glass; various sizes; >1 platter – Much faster spin rates (currently up to 10, 000 rpm) – Much faster access speeds (seek time = 5 – 15 ms) – Much faster transfer rates (15 MB/sec and up) – Fixed means: media NOT removable from the hardware – Internal and external – Capacities: • for older PC systems: 20 MB. . . 80 MB. . . 200 MB • Today: 20 -500 GB and up COMP 4—Power Tools for the Mind What’s in the box? 25 25

COMP 4—Power Tools for the Mind What’s in the box? 26 26 COMP 4—Power Tools for the Mind What’s in the box? 26 26

Digression: What’s a head crash? – Very fast spin rates. • R/W head floats Digression: What’s a head crash? – Very fast spin rates. • R/W head floats above hard disk surface on tiny cushion of air……. . COMP 4—Power Tools for the Mind What’s in the box? 27 27

COMP 4—Power Tools for the Mind What’s in the box? 28 28 COMP 4—Power Tools for the Mind What’s in the box? 28 28

Digression: What’s a head crash? – Very fast spin rates. • R/W head floats Digression: What’s a head crash? – Very fast spin rates. • R/W head floats above hard disk surface on tiny cushion of air. – High data density: smaller recorded bits. – Challenge: decrease head’s “flying height” to increase signal’s amplitude (so it’s detectable) – R/W head can crash into contaminant on disk surface, then onto disk! So: disks permanently sealed in case, fixed in drive: “Winchester” technology COMP 4—Power Tools for the Mind What’s in the box? 29 29

 • Removable disk storage – Great for backups – Very transportable – Internal • Removable disk storage – Great for backups – Very transportable – Internal & external • many flavors • watch for compatibility issues. – A few choices (actual numbers just for culture--- try to get a sense of how much more they store than a standard removable floppy disk). Examples: ZIP: 250 MB Zip Drive - w/5 disks ~$ 75 JAZ: 2 GB Iomega JAZ External ~$300 Syquest: 1. 5 GB ~$300 (been around longer) Flash Drives COMP 4—Power Tools for the Mind What’s in the box? 30 30

QUOTABLE OPTICAL Storage • Use lasers to record (write), and also to read. – QUOTABLE OPTICAL Storage • Use lasers to record (write), and also to read. – Record: high-powered laser burns pits into reflective coating. – Read: weaker laser reads pits; differences in reflectance of pits & lands interpreted as 0 and 1. (See textbook figures) • For PCs: ~650 MB per CD-ROM (275, 000 pgs of text) • Similar to audio CDs, but more error-correction. • Internal & external drives. COMP 4—Power Tools for the Mind What’s in the box? 31 31

READ ONLY: Many flavors … CD-ROM [standard; early generations] • • Rigid platter; various READ ONLY: Many flavors … CD-ROM [standard; early generations] • • Rigid platter; various sizes, densities. Single SPIRAL track (starts near center outward) Usually 650 MB, about 4 ¾” Standard transfer rate was 150 Kb/sec but soon there came: 2 x 4 x … 24 x … 40 x … ? • Biggest Source of ERROR: dust • Disk cost: depends on what’s on it! • Read only; who writes? manufacturer • Good for? Games, Software, Reference materials, Library materials, for being AOLnoyed, … COMP 4—Power Tools for the Mind What’s in the box? 32 32

RECORDABLES: Recordable by: USER (various technologies) readable by most standard, same-sized drives and players. RECORDABLES: Recordable by: USER (various technologies) readable by most standard, same-sized drives and players. WRITE ONCE: CD-R Good for? (used where data won’t change) • Multimedia presentations; archives; greatest hits; photos; video clips… • Hold 650 MB of data, or ~74 min. of audio • Can copy files to it (like removable magnetic media) but a little more complicated (software comes with drive) Unalterable once written COMP 4—Power Tools for the Mind What’s in the box? 33 33

WRITE MANY: CD-RW • Recordable/writable many times (when used with appropriate software) • RW WRITE MANY: CD-RW • Recordable/writable many times (when used with appropriate software) • RW Drives generally can record on both CD-R or CD-RW disks. • Getting very popular • Often used for backups • somewhat more expensive 700 -MB CDs that can be read by most CD-ROM drives • compatibility issues COMP 4—Power Tools for the Mind What’s in the box? 34 34

Newer optical disc technology: DVD – “Digital video (versatile) disc” – Similar to DVD-video Newer optical disc technology: DVD – “Digital video (versatile) disc” – Similar to DVD-video that you hook up to your TV…. – READ ONLY: – DVD-ROM: instead, holds computer data & is hooked to your computer. . – RECORDABLE VERSIONS: – DVD-R (write once) and…. . COMP 4—Power Tools for the Mind What’s in the box? 35 35

– DVD-RAM, DVD-RW, DVD+RW (write many) • A “standards” problem: different formats--which drives can – DVD-RAM, DVD-RW, DVD+RW (write many) • A “standards” problem: different formats--which drives can read and write to which formats…. confusing for customers. – …. “There are several types of DVD drives, and at least four versions of media, none of which is completely compatible with the other…. ” from keynote addressed delivered at Intel Developer Forum week of 9 Sept 2002. • New drives can read and write to both DVD+RW and DVD-RW. • Generally “downward” compatible. • Becoming popular for backups as prices come down. – About 8 X the storage capacity of a CD COMP 4—Power Tools for the Mind What’s in the box? 36 36

So what? – DVD: Can store a whopping 2. 6 to 8. 75 GB! So what? – DVD: Can store a whopping 2. 6 to 8. 75 GB! • For huge graphics files, video, etc For desktop or notebooks: – Getting popular: DVD+-RW/CD-RW combo drive • Again, be aware of writability and compatibility issues. http: //www. computershopper. com http: //www. cnet. com … (lots!) http: //www. adaptec. com COMP 4—Power Tools for the Mind What’s in the box? 37 37