CS100: Introduction to Computer Science
Total Page:16
File Type:pdf, Size:1020Kb
In-class Exercise: CS100: Introduction to n What is a flip-flop? n What are the properties of flip-flops? Computer Science n Draw a simple flip-flop circuit? Lecture 3: Data Storage -- Mass storage & representing information Review: bits, their storage and main memory Mass Storage or Secondary Storage n Bits n Magnetic disks n Boolean operations n CDs n Gates n DVDs n Flip-flops (store a single bit) n Magnetic tapes n Main memory (RAM) n Flash drives q Cell, Byte, Address Mass Storage or Secondary Storage Mass Storage Systems n On-line versus off-line n Magnetic Systems q Online - connected and readily available to the q Hard Disk machine q Floppy Disk q Offline - human intervention required q Tape n Typically larger than main memory n Optical Systems n Typically less volatile than main memory q CD n Typically slower than main memory q DVD n Flash Drives 1 Figure 1.9 A magnetic disk storage Magnetic Disks system n Floppy disk q Low capacity n 3.5 inch diskettes 1.44MB q A single plastic disk n Hard Disk system q High capacity systems q Multiple disks mounted on a spindle, multiple read/write heads move in unison n Cylinder: a set of tracks n Platter : a flat circular disk q Heads do not tough the surface of disks Measuring the Performance of Hard Disk Capacity of Hard Disk Systems Systems n (1) seek time n 5MB (1956 by IBM) q The time to move heads from one track to another n 20MB (1980s) n (2) rotation delay n 1 GB (1990s) q Half the time required for the disk to make a complete rotation n 20 GB – 768 GB (3/4) (2006) n (3) access time q the lowest-capacity - the highest-capacity desktop q Seek time + rotation delay q On 4 platters n (4) transfer rate n 1 TB (2007) q The rate at which data can be transferred to or q 5 platters from the disk Figure 1.10 Magnetic tape storage Magnetic Tapes n High capacity q Many GBs n A big disadvantage q Very time-consuming, much longer data access times n Good for archival storage q High capacity q Reliability q Cost efficiency 2 Figure 1.11 CD storage- Optical Systems Compact Disks n A spiral approach: q one long track that spirals around a CD from inside out. n Capacity in the ranges of 600 - 700 MB n Good for long continuous strings of data q music DVDs (Digital Versatile Disks) or (Digital Flash Drives Video Disks) n Same size as CDs (5 inches in diameter) n Flash memory technology n Encoded in in a different format at a much q Bits are stored by sending electronic signals higher density directly to the storage medium where they cause electrons to be trapped in tiny chambers of silicon n Multiple layers dioxide. n High capacity of several GBs n Capacity of up to a few GB n Good for lengthy multimedia presentations, n Portable, small size, easy to connect to a movies with high video and sound quality computer Flash Drives Questions: n Storing and retrieving data faster than optical n 1. When recording data on a multiple-disk storage system, should we fill a complete disk surface and magnetic systems before starting on another surface, or should we first fill an entire cylinder before starting on another n Digital cameras, cellular telephones, hand- cylinder? held PDAs n Vulnerable, repeated erasing slowly damages n Why should the data in a reservation system that is constantly being updated be stored o a magnetic the chambers disk instead of a CD or DVD? q Not suitable for general main memory applications q Not good for long term applications n What advantage do flash drives have over the other mass storage systems? 3 Files Files n File: A unit of data stored in mass storage n Logical records system q Correspond to natural divisions with data q A complete text documents n Physical Records q A photograph q Correspond to the size of a sector q A program q A music recording n Buffer: A memory area used for the q A collection of data about the students in a temporary storage of data (usually as a step college in transferring the data) Figure 1.12 Logical records versus Representing Information as bit Patterns physical records on a disk n Representing text n Representing numeric values n Representing Images n Representing sounds Representing Text Figure 1.13 The message “Hello.” in ASCII n Each character (letter, punctuation, etc.) is assigned a unique bit pattern. q ASCII: Uses patterns of 7-bits to represent most symbols used in written English text Find the meaning of the following text which is q Unicode: Uses patterns of 16-bits to represent encoded in ASCII: the major symbols used in languages world side 01000011 01101111 01101101 01110000 q ISO standard: Uses patterns of 32-bits to represent most symbols used in languages world 01110101 01110100 01100101 01110010 wide 4 Representing Numeric Values Hexadecimal Notation n Binary notation: Uses bits to represent a n Hexadecimal notation: A shorthand notation number in base two for long bit patterns q Divides a pattern into groups of four bits each n Hexadecimal notation: Uses bits to represent q Represents each group by a single symbol a number in base 16 n Example: 10100011 becomes A3 Figure 1.6 The hexadecimal Representing Numeric Values coding system n Binary notation: Uses bits to represent a number in base two n Hexadecimal notation: Uses bits to represent a number in base 16 n Limitations of computer representations of numeric values q Overflow – happens when a value is too big to be represented q Truncation – happens when a value is between two representable values Question: Representing Images n 1. What is the largest numeric value that n Bit map techniques could be represented with three bytes if each n Pixel: short for “picture element” digit were encoded using one ASCII pattern q 1 bit for 1 pixel n A black and white image is encoded as a long string of bits per byte? representing rows of pixels in the image. n The bit is 1 if the corresponding pixel is black, 0 otherwise. n What if binary notation were used? n What if hexadecimal notation were used? q 8 bit for 1 pixel n For white and black photos, allows a variety of shades of n Covert binary representations to its grayness to be represented. equivalent base ten form q 3 bytes for 1 pixel n For color images. RGB encoding, 1 byte for the intensity of q 0101 each color q Other approach: Luminance and chrominance q 10011 5 Representing Images Representing Sound n Bit map techniques n Sampling techniques n Vector techniques q Sample the amplitude of the sound waves at regular intervals and record the series of values q Scalable obtains. q Word processing systems use vector techniques to provide flexibility in character size. q 8000 samples per second n used in long-distance telephone communication q PostScript q Also popular in Computer-aided design systems q 44,100 samples per second for high quality recordings (each sample represented in 16 or 32 bits) a million bits for a second of music Figure 1.14 The sound wave represented by Representing Sound the sequence 0, 1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0 n Sampling techniques n MIDI q Used in music synthesizers in electronic keyboards q Contains individual instructions for playing each individual note of each individual instrument. q Encoding directions for producing music on a synthesizer rather than encoding the sound itself. Homework Assignment1: Next Lecture: (Due in-class next Monday) n Page 71, 1b, 2b, 3b n The binary system, storing integers and n Page 72, 5, 6, 9,11, 12, 19 fractions n Reading assignments: Chapter 1.5, 1.6,1.7 6.