lecture_01 - ECE190 Lecture01 January18,2011...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE190 Lecture01 January18,2011 Introduction Lecture Topics Courseoverview Abstraction Computersystemsorganizedasasystemicsetoftransformations Computability Representationusingbits Reading assignments TextbookChapter1,§2.1,2.2 Homework No   1 V.Kindratenko ECE190 Lecture01 January18,2011 Course overview Course title IntroductiontoComputingSystems Instructors Yih ­ChunHu(14:00 15:20) VolodymyrKindratenko(11:00 12:20and15:30 16:50) Teaching Assistants TAs o KeithCampbell o JoshuaCochrane o SamuelCornwell o GregoryRoss o KirtiDixit Labassistants o ChenQian o SahilHanda o StanleyIdesis o JohnPritz o DoheumPark o CarlosSiuChong Course objectives Tointroducebasicconceptsbehindcomputerorganizationandcomputerprogramming ToteachhowtoprograminC TopreparetotakeadvancedcoursesinECEandCS Course philosophy Oneofakindcourse Learningtoprogramacomputerrequiresunderstandingitsbasicoperatingprinciples Bottom ­upapproachtointroducecomputingconcepts o Complexsystemsarebuiltfromalargenumberofsimpleparts o Wewilllearnaboutthebuildingblocksandhowtheyareputtogethertoforma computer o Wewillalsolearnhowacomplexprogramistransformedfromahigh ­levellanguage intoaseriesofsimpleinstructionsandhowtheseinstructionsareexecutedatthe hardwarelevel Thisisnotatypicalwaytoteachprogramming,butthisistherightwaytoteachprogramming forcomputerengineeringstudents  2 V.Kindratenko ECE190 Lecture01 January18,2011 Course structure 3distinctiveparts o binarydatarepresentation,binaryarithmetic,digitallogic o computersystemorganizationusingLC ­3asanexample o Cprogramming 29lectures o Tuesday&Thursday,3lecturesections 14discussionsectionsonFridays o Organizedasprogrammingstudios o Willexposeyoutomanytoolsthatotherwiseyouwillnothaveachancetolearnand use o LocatedincomputerlabsDCL440,DCL520 Samelabswillbelikelyusedforexams 3homeworkassignments o DueonWednesdaysat5pm o Drop ­offbox 5programmingassignmentswithintermediatecheckpoints o DueonWednesdaysat5pm Latepolicy:Projectscanbeturnedupto48hourslatewithalatepenaltyof15 points(outof100total)per24hourperiod,proratedonhourlybasis o Electronicsubmission 3mid ­termexams o Aftereach4weeksoflectures o WillbescheduledonMon ­Tue ­Wedevening,usuallybetween7and10pm o LetusknowifyouhaveaconflictwithanyexamsASAP,nolaterthan2weeksbefore theexam 1finalexam Textbook/Course notes YaleN.PattandSanjayJ.Patel,IntroductiontoComputingSystems:frombitsandgatestoCandbeyond, 2ndedition Cousenoteswillnotbepostedon ­line Website http://courses.engr.illinois.edu/ece190/ checkregularlyforuptodateinfo homeworkandmachineproblemswillbepostedon ­line OfficehoursofinstructorsantTAswillbepostedon ­linesoon Onlinediscussionboard NotethatgradeswillbepostedonCompass  3 V.Kindratenko ECE190 Lecture01 January18,2011 Grading Homework:3% Projects:10% Exams: o Midterm1:20% o Midterm2:20% o Midterm3:20% o Final:20% Participationtrackedviai>clicker:4% Subjectiveevaluation:3% i>clicker Willbeusedinthelecturestoprovideafeedbackaboutthecourse Willalsobeusedtoconductquickquizzesandsurveys Lectureattendancewillbederivedfromitsuse Donotshareyouri>clickerwithothers,youwilllosetherighttouseit,andthuswilllosepoints o Moreover,penaltyformisusingi>clickerisonepointgradereductionofthefinalgrade Togetstarted,getani>clickerfromthebookstoreandregisteritat http://www.iclicker.com/registration/ o Useyournetid  Getting help 9discussionsectionsonFridays,5differenttimeslots Officehours,willbepostedon ­linesoon o BothTAsandProfswillhaveofficehours Feelfreetoemailyourteacherisyouhaveanyquestionsorconcernsaboutthecourse  o Ifinterested,emailmethisweek Policies Willbepostedon ­  o Makesureyouknowandfollowthecoursepolicies! Collaborationisencouraged,butdonotcrossthelinebetweencollaborationandcheating Cheating seepolicyon ­line o ifcaughtcheatingyouwillfailthecourse Nocellphonesintheclass! Expectations Weexpectstudentstoattendalllecturesandstudios Weexpectstudentstocompleteallassignments gradesarebasedonthese Weexpectstudentstoworkhardanddotheirbest  4 V.Kindratenko ECE190 Lecture01 January18,2011 Computer and computer system Whatdowemeanbycomputer? Ingeneral,anythingthatcancompute Inamorestrictsense,itisamechanismthatperformstwothings: o Directstheprocessingofinformation Figureoutwhatoperationontheinformationshouldbedonenext o Performstheprocessingofinformation Performactualcalculation Computerperformstheseoperationsinresponsetoacomputerprogram MoreprecisenameforthismechanismisCPUorprocessor o inthepast,processorwasconstructedoutofalargenumberofintegratedcircuit packages,eachmadeoffewtensoftransistors o today,itisjustasinglechip,madeofhundredsofmillionsoftransistors Inamoreloosesense,itisacollectionofparts,inadditiontotheprocessor,thatincombination formacomputersystem o Inputdevices:keyboard,mouse o Outputdevices:display,audio,printer o Storage:disk,CDROM Computerstakemanyforms o   Whystudythem? o  3 Concepts 1. Abstraction 2. Levelsoftransformation 3. Computability Abstraction Amentalshortcutforhidingunderstooddetails. Everydayexample o  Mathematicsexample o Definitionofadefiniteintegralasanareaunderafunctionf(x)onaninterval[a,b]  5 V.Kindratenko ECE190 Lecture01 January18,2011 f(x) n a b     Blackboxnotation a,b + a+b  Weuseabstractionasaproductivityenhancer Computer systems organized as a systemic set of transformations Conceptoftransformationsthatbringtheproblemdescribedinahumanlanguagetothetransistors thatactuallyexecuteit. Problemstatement o Typicallyexpressedinanatural,orhumanlanguage o Humanlanguagessufferfromambiguityissue Algorithm o Problemstatementistransformedintoanalgorithm o Analgorithmisastep ­by ­stepprocedurethatisguaranteedtoterminate,suchthateach stepispreciselydefinedandcanbecarriedoutbyacomputer o Basicalgorithmpropertiesare Definiteness:eachstepispreciselystated,ordefined Effectivecomputability:eachstepcanbecarriedoutbyacomputer  6 V.Kindratenko ECE190 Lecture01 January18,2011 Finiteness:theprocedureeventuallyterminates o Anyproblemcanbeusuallysolvedusinganumberofdifferentalgorithms. Program o Algorithmistransformedintoacomputerprogramusingoneofcomputerlanguages. o erespecificallyinventedto instructcomputersinasimplestraightforwardway o Thereareover1,000programminglanguages,inventedforspecificcomputers,problem domains,e.g.: Fortranforscientificcalculations COBOLforsolvingbusinessdata ­processingproblems Prologforexpertsystems o WewilllearnC,whichwasinitiallydesignedtomanipulatelow ­levelhardware structures o 2kindsoflanguages High ­levellanguagesarehardware ­independentlanguageswithahighdegree ofabstraction Low ­levellanguagesaretiedtoaspecificcomputer.Ingeneral,thereisone suchlanguageforeachcomputer,calledassemblylanguage. InstructionSetArchitecture(ISA) o Programwritteninaprogramminglanguageneedstobetranslatedintoaninstruction setofthecomputeronwhichthisprogramwillexecute o Aninstructionsetisalistofalltheinstructionsthataprocessorcanexecute o TheISAspecifies setofinstructions datatypesforoperandsonwhichtheinstructionsareexecuted addressingmodelforfiguringoutwheretheoperandsarelocated memoryarchitecture,I/Ointerface,etc. o ExamplesofISAs x86 hasmorethan100operationsdefined morethanadozendatatypes morethantwodozenaddressingmodels o Theprogramwritteninaprogramminglanguage,suchasC,istranslatedintothe specificISAisusuallydoneusingatranslatingprogramcalledcompiler o Theprogramwritteninalow ­levelcomputerspecificassemblylanguageistranslated intoISAusingatranslatingprogramcalledassembler. Microarchitecture(microprocessorarchitecture) o MicroarchitectureisthewayagivenISAisimplementedonaprocessor.AgivenISAmay beimplementedwithdifferentmicroarchitecturesdependingonthedesigngoals. o Examplex86ISA:  7 V.Kindratenko ECE190 Lecture01 January18,2011 Thesameinstructionsethasbeenimplementedbydifferentvendors,Inteland AMD Ithasbeenimplementedinanumberofprocessorsstartingfrom8086in1979  o Caranalogy Logiccircuit(gates) o Allelementsofthemicroarchitectureareimplementedoutofsimplelogiccircuits Devices o Eachbasiclogicelementisimplementedusingaparticulardevicetechnology,e.g., Complementarymetal oxide semiconductor(CMOS)technology o OfaparticularinterestareMOSFETs metal ­oxidefieldeffecttransistors o Devices(transistors)manipulateelectronswhichdotheworkforus.  Inthiscourse,wewillstudyallthesetransformations o startingfromhowtransistorsareputtogethertoformbasiclogicelements o howaparticularISAisassembledfromsuchlogicelements o andhowaprogramwritteninCiscompiledintothisISA Computability Computers as universal computational devices Computersareuniversalcomputationaldevices. Givenanexistingcomputer,onecanrunonitdifferentinstructionsequences,orprograms,to executenewkindsofcomputations Computerscientistsbelievethatanythingthatcanbecomputed,canbecomputedbya computer o Providedthatenoughtimeandmemoryaregiven Allcomputersarecapableofcomputingexactlythesamethings o Iftheyaregivenenoughmemoryandtime o Anythingafastcomputercando,aslowcomputercandoaswell,provideditisgiven enoughtime Turing machine TheideaofauniversalcomputationaldevicewasproposedbyAlanTuringin1936 Turingreasonedthatthemostbasicfeaturesofamechanicalcomputationare o Theabilitytoreadandwriteonastoragemedium Atapedividedintocells,eachcellstoringasymbolfromatapealphabet o Tomakesomesimplelogicaldecisions  8 V.Kindratenko ECE190 Lecture01 January18,2011 Inotherwords,Turingproposedamodeltocharacterizemechanicalcomputationasasequence ofinstructionssuchas o Writeasymbolonthetapecell o Movetothenextcellonthetape o Observethesymbolscannedfromthetapecellandchosethenextstepaccordingtothe symbolscanned o Stop performedbysomeTuringmachine.  Additionalmaterial ATuringmachineconsistsofthefollowingparts: o Tape:dividedintocells,eachcellcontainsasymbolfromsomefinitealphabet.The o extendabletotheleftandtotherightasmuchasneeded. Head:canreadandwritesymbolsonthetapeandmovethetapeleftandrightone (andonlyone)cellatatime.Atanytimetheheadispositionedoveraparticular cell,whichitissaidtoscan.Attime0theheadispositionedoverthestartcell. input startcell B B S1 S3 S0 S3 S0 B B tape head  o o Stateregister:storesthestateTuringmachineiscurrentlyin Actiontable:atableofinstructionssuchthatgiventhestatethemachineis currentlyin,Qi,andasymbolitisscanning,Sj,theheaderasesorwriteasymbolSj ormovestheheadleftorright,andthenassumesthesameoranewstate,Dk.We willwritethisactionasQiAj i1Aj1Dk Sate Inputsymbol NewSymbol NewState Headmove 0 0 1 0 R 0 1 0 0 R 0 B B 1 S ExampleactiontableforaTuringmachinethatcomputesthecomplementofagiven number.Alphabetsymbols={0,1,B},states={0,1 ­endstate}  o   AnabstractionthatshowstheactionoftheTuringmachine,butdoesnotspecifyhow theactionisperformed Thedataonwhichthemachineoperatesistheinputdata 9 V.Kindratenko ECE190 Lecture01 o January18,2011 Theresultsthatthemachineproducesistheoutputdata Addexample TADD a,b a+b  o Multiplyexample TMUL a,b a*b  Universal Turing machine TheproblemwithTuringmachinesisthatadifferentonemustbeconstructedforeverynew computationtobeperformed,foreveryinput ­outputrelation. TuringwasabletodemonstratethatthereisatableUwhichissuchthatifaTuringmachineis programmedinaccordancewithU,andifanytable,P,istranslatedandwrittenoutonthe machine'stape,thenthemachinewillbehaveasifitisprogrammedinaccordancewithP. SuchaTuringmachinewithtableUiscalledUniversalTuringmachine(UTM) WhenstartedonatapecontainingtheencodingofanotherTuringmachine,P,followedbythe inputtoP,aUTMproducesthesameresultasPwouldproducewhenstartedonthatinput. EssentiallyaUTMcansimulatethebehaviorofanyTuringmachine(includingitself.) notation: Descriptionof machineP U out in  TADD,TMUL U a*(b+c) a,b,c  OnewaytothinkofaUTMisasaprogrammablecomputer.WhenaUTMisgivenaprogram(a descriptionofanothermachine),itmakesitselfbehaveasifitwerethatmachinewhile processingtheinput.  10 V.Kindratenko ECE190 Lecture01 January18,2011 WhatcanbecomputedwithTuringmachines o Numbers:AnumberisTuring ­computableifthereexistsaTuringmachinewhichstarting fromablanktapecomputesanarbitrarilypreciseapproximationtothatnumber.Allof thealgebraicnumbers(rootsofpolynomialswithalgebraiccoefficients)andmany transcendentalmathematicalconstantsareTuring ­computable. o Functions:Numericfunctions,suchasthemachineforadditionmultiplication,proper subtraction,exponentiation,factorialandsoon. Whatcannotbecomputed o AcrucialobservationaboutTuringmachineisthatthereareonlycountablymany machines(asetiscountableifitisfinite,ormaybeplacedinone ­to ­one correspondencewiththeintegers.)Itfollowsimmediatelythatthereareuncountably manyrealnumbersthatarenotcomputable,sincetherealsarenotcountable.There aresimplynotenoughTuringmachinestocomputeallofthosenumbers. o Liketherealnumbers,thenumberoffunctionsonthenaturalnumbersisnot countable.Itfollowsthereforethatthereareuncountablymanysuchfunctionsthatare notcomputablebyanyTuringmachine. Representation using bits Realworldinformationcanberepresentedusingfundamentaldatatypes(integers,reals,characters). Thesefundamentaldatatypesareimplementedusingbinarydigits(bits)inthedigitalworld. Basic concepts Recallthateachbasiclogicelementisimplementedusingaparticulardevicetechnology Digitaldevicesoperatebyreactingtothepresenceorabsenceofvoltages,nottotheactual voltage o  voltagepresent o bits,orbinarydigits Switchingfromstate1tostate0doesnotnecessarilymeanthatthevoltagedropsallthewayto 0volt,itsimplemeansthatvoltagedropsbelowacertainthresholdvalue Example,transistor ­transistorlogic(TTL)baseddigitalcircuitsoperatebetween0and5V o 0isanyvoltagebelow0.8V o 1isanyvoltageabove2V o 0.8 ­2Vregionisambiguous,agooddesignmakesthetransitionfromonestatetothe otherasshortaspossible zero 0V one 0.8V 2.0V 5.0V   11 V.Kindratenko ECE190 Lecture01 January18,2011 o Thespeedwithwhichtransistorscanswitchfromonestatetoanotherisrelatedtothe speedwithwhichthedigitaldevicecanoperate Wewillusebinarydigits0and1torepresentnumbers,justlikeinthedecimaldigitssystem Wecancombinemultiplebitstorepresentarbitrarylargenumbers o Thisequalstousingmultiplewiresandmultipledigitaldevicestotransmitandreactto thepresenceorabsenceofvoltagesonthesewires Havingkbits,eachofwhichcanbeeither0or1,wecanrepresentexactly2kuniquenumbers, forexample o with2bitswecanhavethefollowingpermutations:00,01,10,11,or4uniquenumbers o with8bits,wecanhave28permutations,thusrepresentingasmanyas256different values Ifnbitscanrepresent2nvalues,howmanybitsareneededtorepresentmthings? o 2n=m;log22n=log2m;n=log2m o Example:m=42;log242=5.39;n=6 Notehoweverthat26=64 Binary representation of integer numbers  Decimalnumbersusebase10positionalnotation,e.g.,564meansthatthereare5hundreds,6 tenths,and4ones.Eachdig  o 564canbewritesas5*100+6*10+4,oralternatively,5*102+6*101+4*100 o Here10isthebaseofthenumericalsystemused o Alternatively,564canbewrittenas56410 Binarynumbersworkthesamewayusingjusttwodigits,0and1,usingbase2positional notation o 00110canbewrittenas0*24+0*23+1*22+1*21+0*20 o Notation001102meansthatthenumberiswritteninbinaryform o Bytheway,001102=610 o Withkbitswecanrepresent2kpositiveintegers,rangingfrom0to2k ­1  Finitecapacityofbinaryrepresentation Q1:with6digits,whatismyrangeofrepresentation? o Whywouldthisquestionevenmakesense? Odometerexample A1:0to999999 Q2:with6bits,whatismyrangeofrepresentation? A1:0to26 ­1  Notableconcepts:Datawidth,MSB,LSB,Wordsize  12 V.Kindratenko ECE190 Lecture01 January18,2011 Conversion between binary and decimal representations Binary to decimal conversion Recallthatabinaryintegernumberconsistingofkbitsiswrittenintheform ak ­1ak ­2 1a0whereaiiseither0or1 o Example:110001112 Computethedecimalnumberasfollows: o A10=ak ­1*2k ­1+ 1*21+a0*20 Example:convert01110012tothedecimalnotation: o Themagnitudeis0*26+1*25+1*24+1*23+0*22+0*21+1*20=3210+1610+810+110=57 Decimal to binary conversion Thetextbookdescribesamethodbasedoncomparingwithdescendingpowersof2and subtracting Asimplertechniqueisbasedonshortdivisionby2withremainder o Startbywritingthenumbertobeconverted o Divideitby2 o Writequotientofthedivisionunderneaththenumber o Writeremainderofthedivisionnexttothenumber o Repeatlast3stepsuntilthequotientbecomes0 o Writedownthesequenceofremainders,startingfromthebottom,thisisyouranswer Example:15610=?2 1560 780 391 191 91 40 20 11 00 o Theansweris15610=0100111002   13 V.Kindratenko ...
View Full Document

This note was uploaded on 01/22/2012 for the course ECE 191 taught by Professor Staff during the Spring '11 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online