I-class Exercise: CS100: Itroductio to Computer Sciece What is a flip-flop? What are the properties of flip-flops? Draw a simple flip-flop circuit? Lecture 3: Data Storage -- Mass storage & represetig iformatio Review: bits, their storage ad mai memory Mass Storage or Secodary Storage Bits Boolea operatios Gates Flip-flops (store a sigle bit) Mai memory (RAM) Cell, Byte, Address Magetic disks CDs DVDs Magetic tapes Flash drives Mass Storage or Secodary Storage Mass Storage Systems O-lie versus off-lie Olie - coected ad readily available to the machie Offlie - huma itervetio reuired Typically larger tha mai memory Typically less volatile tha mai memory Typically slower tha mai memory Magetic Systems Hard Disk Floppy Disk Tape Optical Systems CD DVD Flash Drives 1
Figure 1.9 A magetic disk storage system Magetic Disks Floppy disk Low capacity 3.5 ich diskettes 1.44MB A sigle plastic disk Hard Disk system High capacity systems Multiple disks mouted o a spidle, multiple read/write heads move i uiso Cylider: a set of tracks Platter : a flat circular disk Heads do ot tough the surface of disks Measurig the Performace of Hard Disk Systems (1) seek time The time to move heads from oe track to aother (2) rotatio delay Half the time reuired for the disk to make a complete rotatio (3) access time Seek time + rotatio delay (4) trasfer rate The rate at which data ca be trasferred to or from the disk Capacity of Hard Disk Systems 5MB (1956 by IBM) 20MB (1980s) 1 GB (1990s) 20 GB 768 GB (3/4) (2006) the lowest-capacity - the highest-capacity desktop O 4 platters 1 TB (2007) 5 platters Figure 1.10 Magetic tape storage Magetic Tapes High capacity May GBs A big disadvatage Very time-cosumig, much loger data access times Good for archival storage High capacity Reliability Cost efficiecy 2
Figure 1.11 CD storage- Optical Systems Compact Disks A spiral approach: oe log track that spirals aroud a CD from iside out. Capacity i the rages of 600-700 MB Good for log cotiuous strigs of data music DVDs (Digital Versatile Disks) or (Digital Video Disks) Same size as CDs (5 iches i diameter) Ecoded i i a differet format at a much higher desity Multiple layers High capacity of several GBs Good for legthy multimedia presetatios, movies with high video ad soud uality Flash Drives Flash memory techology Bits are stored by sedig electroic sigals directly to the storage medium where they cause electros to be trapped i tiy chambers of silico dioxide. Capacity of up to a few GB Portable, small size, easy to coect to a computer Flash Drives Storig ad retrievig data faster tha optical ad magetic systems Digital cameras, cellular telephoes, hadheld PDAs Vulerable, repeated erasig slowly damages the chambers Not suitable for geeral mai memory applicatios Not good for log term applicatios Questios: 1. Whe recordig data o a multiple-disk storage system, should we fill a complete disk surface before startig o aother surface, or should we first fill a etire cylider before startig o aother cylider? Why should the data i a reservatio system that is costatly beig updated be stored o a magetic disk istead of a CD or DVD? What advatage do flash drives have over the other mass storage systems? 3
Files Files File: A uit of data stored i mass storage system A complete text documets A photograph A program A music recordig A collectio of data about the studets i a college Logical records Correspod to atural divisios with data Physical Records Correspod to the size of a sector Buffer: A memory area used for the temporary storage of data (usually as a step i trasferrig the data) Figure 1.12 Logical records versus physical records o a disk Represetig Iformatio as bit Patters Represetig text Represetig umeric values Represetig Images Represetig souds Represetig Text Each character (letter, puctuatio, etc.) is assiged a uiue bit patter. Figure 1.13 The message Hello. i ASCII ASCII: Uses patters of 7-bits to represet most symbols used i writte Eglish text Uicode: Uses patters of 16-bits to represet the major symbols used i laguages world side ISO stadard: Uses patters of 32-bits to represet most symbols used i laguages world wide Fid the meaig of the followig text which is ecoded i ASCII: 01000011 01101111 01101101 01110000 01110101 01110100 01100101 01110010 4
Represetig Numeric Values Biary otatio: Uses bits to represet a umber i base two Hexadecimal otatio: Uses bits to represet a umber i base 16 Hexadecimal Notatio Hexadecimal otatio: A shorthad otatio for log bit patters Divides a patter ito groups of four bits each Represets each group by a sigle symbol Example: 10100011 becomes A3 Figure 1.6 The hexadecimal codig system Represetig Numeric Values Biary otatio: Uses bits to represet a umber i base two Hexadecimal otatio: Uses bits to represet a umber i base 16 Limitatios of computer represetatios of umeric values Overflow happes whe a value is too big to be represeted Trucatio happes whe a value is betwee two represetable values Questio: Represetig Images 1. What is the largest umeric value that could be represeted with three bytes if each digit were ecoded usig oe ASCII patter per byte? What if biary otatio were used? What if hexadecimal otatio were used? Covert biary represetatios to its euivalet base te form 0101 10011 Bit map techiues Pixel: short for picture elemet 1 bit for 1 pixel A black ad white image is ecoded as a log strig of bits represetig rows of pixels i the image. The bit is 1 if the correspodig pixel is black, 0 otherwise. 8 bit for 1 pixel For white ad black photos, allows a variety of shades of grayess to be represeted. 3 bytes for 1 pixel For color images. RGB ecodig, 1 byte for the itesity of each color Other approach: Lumiace ad chromiace 5
Represetig Images Represetig Soud Bit map techiues Vector techiues Scalable Word processig systems use vector techiues to provide flexibility i character size. PostScript Also popular i Computer-aided desig systems Samplig techiues Sample the amplitude of the soud waves at regular itervals ad record the series of values obtais. 8000 samples per secod used i log-distace telephoe commuicatio 44,100 samples per secod for high uality recordigs (each sample represeted i 16 or 32 bits) a millio bits for a secod of music Figure 1.14 The soud wave represeted by the seuece 0, 1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0 Represetig Soud Samplig techiues MIDI Used i music sythesizers i electroic keyboards Cotais idividual istructios for playig each idividual ote of each idividual istrumet. Ecodig directios for producig music o a sythesizer rather tha ecodig the soud itself. Homework Assigmet1: (Due i-class ext Moday) Page 71, 1b, 2b, 3b Page 72, 5, 6, 9,11, 12, 19 Next Lecture: The biary system, storig itegers ad fractios Readig assigmets: Chapter 1.5, 1.6,1.7 6