Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns 1.5 The Binary System 1.6 Storing Integers 1.7 Storing Fractions 1.8 Data Compression 1.9 Communication Errors 1 Computer == 0 and 1 ? Hmm…every movie says so…. Chapter 2 2 Why I can’t see any 0 and 1 when opening up a computer?? Chapter 2 3 What’s really in the computer With the help of an oscilloscope (示波器) Chapter 2 4 HIGH Bits LOW Bit Binary Digit The basic unit of information in a computer A symbol whose meaning depends on the application at hand. Numeric value (1 or 0) Boolean value (true or false) Voltage (high or low) For TTL, high=5V, low=0V 5 More bits? kilobit (kbit) 103 210 megabit (Mbit) 106 220 gigabit (Gbit) 109 230 terabit (Tbit) 1012 240 petabit (Pbit) 1015 250 exabit (Ebit) 1018 260 zettabit (Zbit) 1021 270 6 Bit Patterns All data stored in a computer are represented by patterns of bits: Numbers Text characters Images Sound Anything else… 7 Now you know what’s a ‘bit’, and then? How to ‘compute’ bits? How to ‘implement’ it ? How to ‘store’ bit in a computer? Chapter 2 8 How to do computation on Bits? Chapter 2 9 Boolean Operations Boolean operation any operation that manipulates one or more true/false values (e.g. 0=true, 1=false) Can be used to operate on bits Specific operations AND OR XOR NOT 10 AND, OR, XOR 11 Implement the Boolean operation on a computer Chapter 2 12 Gates Gates devices that produce the outputs of Boolean operations when given the operations’ input values Often implemented as electronic circuits Provide the building blocks from which computers are constructed 13 AND, OR, XOR, NOT Gates Chapter 2 14 INPUT OUTPUT A B A NAND B NAND 001 011 101 NOR 110 XNOR 15 Implement a gate You can implement it with transistors But today gates are normally packaged in Integrated Circuit (IC) forms Chapter 2 16 17 How many gates in this picture? NOT=? NAND=? NOR=? Chapter 2 18 Classification of IC Complexity Number of gates Small-Scale Integration (SSI) < 12 Medium-Scale Integration (MSI) 12-99 Large-Scale Integration (LSI) 100-999 Very Large-Scale Integration (VLSI) 10,000-99,999 Ultra Large-Scale Integration (ULSI) > 100,000 Chapter 2 19 How to ‘store’ the bit? Chapter 2 20 Store the bit What do we mean by ‘storing’ the data? Bits in the computer at the i th second = Bits in the computer at the (i + 1) th second For example If the current state of the bit is ‘1’, it should be still ‘1’ at the next second 21 Using Flip-flop to store the bit Chapter 2 22 Flip-flops? NOT THIS!! 23 Flip-Flops Flip-Flop a circuit built from gates that can store one bit of data Two input lines One input line sets its stored value to 1 Another input line sets its stored value to 0 When both input lines are 0, the most recently stored value is preserved 24 Flip-Flops Illustrated X Y Z X Z 0 0 -- 0 1 0 Flip-Flop 1 0 1 Y 1 1 * 25 A Simple Flip-Flop Circuit X Y 26 Setting to 1 – Step a. 27 Setting to 1 – Step b. 28 Setting to 1 – Step c. 29 Try This Show how the output can be turned to 0 30 Another Flip-Flop Circuit X Y Try this: When X=0, Y=1 What would be the output? 31 Flip-Flops A kind of storage Holds its value until the power is turned off 32 Types of Memory Volatile memory A.k.a. dynamic memory Holds its value until the power is turned off Non-volatile memory Holds its value even after the power is off 33 Capacitors Two metallic plates positioned in parallel Principle Tiny space between two plates Voltage thru, charge the plats Voltage off, charge remains on the plats Connect two plates, charge off the plates Many of these capacitors with their circuits on a wafer (chip) Even more volatile than flip-flops Must be replenished periodically 34 Flash Memory Originally made from EEPROM (Electrically Erasable ProgrammableRe ad-Only Memory) Trapping electrons in silicon dioxide SiO2 chambers/cell Chamber very small 90 angstroms 1 angstrom is 1/10,000,000,000 of a meter Non-volatile 35 History of Flash Memory PROM->EPROM->EEPROM->Flash memory Chapter 2 36 Comparison EPROM (Erasable Programmable Read- Only Memory) Use UV to erase the cell/bit Erase the whole chip at a time EEPROM(Electrically Erasable Program mable Read-Only Memory) Use electric field Erase one bit at a time Flash memory Erase one chunk/block of bits at a time Chapter 2 37 Types of Memory Volatile memory A.k.a. dynamic memory Holds its value until the power is turned off Examples, flip-flops, capacitors Non-volatile memory Holds its value even after the power is off Examples, flash memory, magnetic storage, compact disk, etc 38 Hexadecimal Notation Why? Things are in bit streams Stream = a long string of bits. Long bit streams E.g., 1000 = 11111010002 Hexadecimal (16進位) notation A shorthand notation for streams of bits. More compact. 1000=3E816 39 The Hexadecimal System 1000 = 11111010002 =3E816 40 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns 1.5 The Binary System 1.6 Storing Integers 1.7 Storing Fractions 1.8 Data Compression 1.9 Communications Errors 41 Storage Hierarchy Speed Cost Capacity Cache Main Memory e.g. Hard Disk On-line Storage Near-line Storage e.g. Optical Disk e.g. Magnetic Off-line Storage Tape low low large 42 CPU Cache One type of memory On the CPU Have fast access time stores copies of the data from frequently used main memory locations. As long as most memory accesses are in the cached memory the average latency of memory accesses will be closer to the cache latency Chapter 2 43 Main Memory: Basic Cell Manageable memory unit Typically 8 bits Byte A string of 8 bits. High-order end The left end Low-order end The right end Least significant bit The last bit at the low-order end 44 A Byte-Size Memory Cell 45 Main Memory: Addresses Address A “name” to uniquely identify one cell Consecutive numbers Usually starting at zero I.e., having an order “previous cell” and “next cell” have reasonable meanings Random Access Memory Memory where any cell can be accessed independently 46 Memory Cells 47 Not Quite the Metric System K “Kilo-” normally means 1,000 Kilobyte = 210 = 1024 M “Mega-” normally means 1,000,000 Megabyte = 220 = 1,048,576 G “Giga-” normally means 1,000,000,000 Gigaabyte = 230 = 1,073,741,824 48 Mass Storage Systems Non-Volatile Data remains when computer is off Usually much bigger than main memory Traditionally usually rotating disks Hard disk, floppy disk, CD-ROM Much slower than main memory (mechanical vs. electrical) Data access must wait for seek time (head positioning) Data access must wait for rotational latency 49 Disk arm read/write head 50 Hard Disk sector track 51 固態硬碟(Solid-State Disk or SSD) No mechanical part Based on Flash memory technology Pros Quiet, low power, immune to vibration Cons More expensive (smaller capacity) Shorter life time (less number of read- write) Can’t recover data from a damaged disk Chapter 2 52 Compact Disk 53 Multi-layered CD pits 54 55 How about CD-R (writable CD) Don’t have bumps on the surface A organic dye layer covers the CD 2 lasers write laser heats up the dye layer enough to make it opaque. read laser senses the difference between clear dye and opaque dye the same way it senses bumps -- it picks up on the difference in reflectivity. Chapter 2 56 CD-RW Use a special dye material Can change its transparency depending on the temperature Chapter 2 57 Magnetic Tape 58 Files File The unit of data stored on a mass storage system. Logical record and Field Natural groups of data within a file Physical record A block of data conforming to the physical characteristics of the storage device. E.g. disk sector 59 Logical vs. Physical Records phone num address name 60 Two more logical records might be stored in the same physical record One logical record might be split into two physical record 61 Buffers Storage area used to hold data on a temporary basis Usually during the process of being transferred from one device to another Example: Printers with memory Holding portions of a document that have transferred to the printer but not yet printed Why we need buffer? 62 Why using buffer? Device sharing E.g. 3 computers sharing the same printer Connect devices of different speeds E.g. Computer -> buffer -> printer 63 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns 1.5 The Binary System 1.6 Storing Integers 1.7 Storing Fractions 1.8 Data Compression 1.9 Communications Errors 64 Bit Patterns All data stored in a computer are represented by patterns of bits: Text characters: “I love computer” Numbers: 123456 Images: JPEG, GIF, etc Sound: 65 How we interpret “0110101”? We use ‘coding’ to define the meaning of binary bits Human Language is one kind of coding e.g “gut” = gastrointestinal tract (English) = good (German) Many different coding schemes ASCII EBCDIC ISO/IEC ….
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages126 Page
-
File Size-