Chpter : Introduction Slides to ccompny the textbook, First Edition, by, John Wiley nd Sons Publishers, 7. http://www.ddvhid.com Copyright 7 Instructors of courses requiring Vhid's textbook (published by John Wiley nd Sons) hve permission to modify nd use these slides for customry course-relted ctivities, subject to keeping Digitl this copyright Design notice in plce nd unmodified. These slides my be posted s unnimted pdf versions on publicly-ccessible course websites.. PowerPoint source (or pdf with nimtions) my not be posted to publicly-ccessible websites, but my be posted for students on internl protected sites or distributed directly to students by other electronic mens. Copyright 7 Instructors my mke printouts of the slides vilble to students for resonble photocopying chrge, without incurring roylties. Any other use requires explicit permission. Instructors my obtin PowerPoint Frnk source Vhid or obtin specil use permissions from Wiley see http://www.ddvhid.com for informtion.
Why Study?. Look under the hood of computers Solid understnding --> confidence, insight, even better progrmmer when wre of hrdwre resource issues Electronic devices becoming digitl Enbled by shrinking nd more cpble chips Enbles: Better devices: Better sound recorders, cmers, crs, cell phones, medicl devices,... New devices: Video gmes, PDAs,... Known s embedded systems Thousnds of new devices every yer Designers needed: Potentil creer direction Stellites Portble music plyers Cell phones DVD plyers Video recorders Musicl instruments Cmers TVs??? Copyright 7 995 997 999 3 5 7 Yers shown bove indicte when digitl version begn to dominte (Not the first yer tht digitl version ppered) Note: Slides with nimtion re denoted with smll red "" ner the nimted items
Anlog signl Wht Does Digitl Men? Inifinite possible vlues Ex: voltge on wire creted by microphone Digitl signl Finite possible vlues Ex: button pressed on keypd. Sound wves move the membrne, 3 microphone which moves the mgnet, which cretes current in the nerby wire vlue Copyright 7 nlog signl Possible vlues:.,.,.9,... infinite possibilities time vlue 3 digitl signl time Possible vlues:,,, 3, or. Tht s it. 3
Digitl Signls with Only Two Vlues: Binry Binry digitl signl -- only two possible vlues Typiclly represented s nd One binry digit is bit We ll only consider binry digitl signls Binry is populr becuse Trnsistors, the bsic digitl electric component, operte using two voltges (more in Chpt. ) Storing/trnsmitting one of two vlues is esier thn three or more (e.g., loud beep or quiet beep, reflection or no reflection) vlue time Copyright 7
Exmple of Digitiztion Benefit Anlog signl (e.g., udio) my lose qulity Voltge levels not sved/copied/trnsmitted perfectly Digitized version enbles ner-perfect sve/cpy/trn. Smple voltge t prticulr rte, sve smple using bit encoding Voltge levels still not kept perfectly But we cn distinguish s from s Let bit encoding be: V: V: 3 V: Copyright 7 Digitized signl not perfect re-cretion, but higher smpling rte nd more bits per encoding brings closer. Volts Volts Volts 3 3 originl signl time d digitized signl time d lengthy trnsmission (e.g, cell phone) lengthy trnsmission (e.g, cell phone) 3 received signl time How fix -- higher, lower,? time Cn fix -- esily distinguish s nd s, restore time 5
Digitized Audio: Compression Benefit Digitized udio cn be compressed e.g., MP3s A CD cn hold bout songs uncompressed, but bout compressed Compression lso done on digitized pictures (jpeg), movies (mpeg), nd more Digitiztion hs mny other benefits too Copyright 7 Exmple compression scheme: --> --> X --> X 6
How Do We Encode Dt s Binry for Our Digitl nlog phenomen electric signl AD digitl dt digitl dt sensors nd other inputs Digitl System DA electric signl ctutors nd other outputs digitl dt digitl dt Copyright 7 System? Some inputs inherently binry Button: not pressed (), pressed () Some inputs inherently digitl Just need encoding in binry e.g., multi-button input: encode red=, blue=,... Some inputs nlog Need nlog-to-digitl conversion As done in erlier slide -- smple nd encode with bits r ed r ed r ed button blue blue blue ir g r een g r een g r een temperture sensor blck blck blck 33 degrees 7
How to Encode Text: ASCII, Unicode ASCII: 7- (or 8-) bit encoding of ech letter, number, or symbol Unicode: Incresingly populr 6-bit bit encoding Encodes chrcters from vrious world lnguges S ymbol R S T L N E. <tb> En c oding S ymbol r s t l n e 9! <sp c e> En c oding Question: Wht does this ASCII bit sequence represent? R E S T Copyright 7 Note: smll red () in slide indictes nimtion 8
How to Encode Numbers: Binry Numbers Ech position represents quntity; symbol in position mens how mny of tht quntity Bse ten (deciml) Ten symbols:,,,..., 8, nd 9 More thn 9 -- next position So ech position power of Nothing specil bout bse -- used becuse we hve fingers Bse two (binry) Two symbols: nd More thn -- next position So ech position power of Copyright 7 5 3 3 3 Q: How much? + = + = 5 9
How to Encode Numbers: Binry Numbers Working with binry numbers In bse ten, helps to know powers of one, ten, hundred, thousnd, ten thousnd,... In bse two, helps to know powers of one, two, four, eight, sixteen, thirty two, sixty four, one hundred twenty eight (Note: unlike bse ten, we don t hve common nmes, like thousnd, for ech position in bse ten -- so we use the bse ten nme) Q: count up by powers of two 9 8 7 6 5 5 56 8 6 3 3 6 8 5 56 8 6 3 6 8 Copyright 7
Converting from Deciml to Binry Numbers: Subtrction Method (Esy for Humns) Gol Get the binry weights to dd up to the deciml quntity Work from left to right (Right to left my fill in s tht shouldn t hve been there try it). Desired deciml number: 3 6 8 =3 3 6 8 3 6 8 too much =6 3 6 8 too much =8 ok, keep going =8+= 3 6 8 DONE Copyright 7 nswer 3 6 8
Converting from Deciml to Binry Numbers: Subtrction Method (Esy for Humns) Subtrction method To mke the job esier (especilly for big numbers), we cn just subtrct selected binry weight from the (remining) quntity Then, we hve new remining quntity, nd we strt gin (from the present binry position) Stop when remining quntity is Remining quntity: 3 6 8 3 is too much 3 6 8 6 is too much 3 6 8 8 = 3 6 8 -= 3 6 8 DONE Copyright 7 nswer 3 6 8
Converting from Deciml to Binry Numbers: Subtrction Method Exmple Q: Convert the number 3 from deciml to binry A: Remining quntity Binry Number 3 3 6 8 3-6 7 3 6 8 7-3 3 6 8 8 is more thn 7, cn t use - 3 6 8 Copyright 7-3 6 Done! 3 in deciml is in binry. 8 3
Converting from Deciml to Binry Numbers: Division Method (Good for Computers) Divide deciml number by nd insert reminder into new binry number. Continue dividing quotient by until the quotient is. Exmple: Convert deciml number to binry Deciml Number 6 divide by - insert reminder Binry Number Copyright 7 Continue dividing since quotient (6) is greter thn 3 6 divide by -6 insert reminder Continue dividing since quotient (3) is greter thn
Converting from Deciml to Binry Numbers: Division Method (Good for Computers) Exmple: Convert deciml number to binry (continued) Deciml Number 3 divide by - insert reminder Binry Number Continue dividing since quotient () is greter thn divide by 8 - insert reminder Since quotient is, we cn conclude tht is in binry Copyright 7 5
Bse Sixteen: Another Bse Sometimes Used by ers h e x 8 A F 6 6 3 6 6 6 8 A F bin r y h e x bin r y Nice becuse ech position represents four bse two positions Used s compct mens to write binry numbers Known s hexdeciml, or just hex 8 9 A 3 B 5 C D Q: Write in hex 6 7 E F F Copyright 7 6
Implementing Digitl Systems: Progrmming Microprocessors Vs. Designing Digitl Circuits Desired motion-t-night detector Progrmmed microprocessor Custom designed digitl circuit.3 Microprocessors common choice to implement digitl system Esy to progrm Chep (s low s $) Avilble now Copyright 7 I I I I 3 I I 5 I 6 I 7 P P P P3 P P5 P6 P7 Microprocessor void min() { while () { P = I &&!I; // F = nd!b, } } b F 6: 7:57:6 9:9: time 7
: When Microprocessors Aren t Good With microprocessors so esy, chep, nd vilble, why design digitl circuit? Microprocessor my be too slow Or too big, power hungry, or costly Smple digitl cmer tsk execution times (in seconds) on microprocessor versus digitl circuit: Tsk Microprocessor Custom Digitl Circuit Red 5. Compress 8.5 Store.8 Copyright 7 Enough ( ) ( b ) ( c ) Imge Sensor Memory Imge Sensor Memory Imge Sensor Memory Microprocessor (Red, Compress, nd Store) Red circuit Red circuit Q: How long for ech implementtion option? Compress circuit Store circuit Compress circuit Microprocessor (Store) 5+8+ = sec.+.5+.8 =. sec.+.5+ =.6 sec Good compromise 8
Digitl systems surround us Inside computers Chpter Summry Inside huge vriety of other electronic devices (embedded systems) Digitl systems use s nd s Encoding nlog signls to digitl cn provide mny benefits e.g., udio -- higher-qulity storge/trnsmission, compression, etc. Encoding integers s s nd s: Binry numbers Microprocessors (themselves digitl) cn implement mny digitl systems esily nd inexpensively But often not good enough -- need custom digitl circuits Copyright 7 9