48
Introduction to Computer Science CSCI 109 Andrew Goodney Fall 2017 Lecture 1: Introduction Jan 9, 2017 China – Tianhe-2

Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Introduction to Computer ScienceCSCI109

AndrewGoodneyFall2017

Lecture1:IntroductionJan9,2017

China– Tianhe-2

Page 2: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Purpose of this Course

u Introducecomputerscienceasadiscipline,abodyofknowledge,andadomainofscience/engineeringv Thefocusisonideasandconceptsv Significantamountsofreadingbutnoprogramming(seeCSCI103L)

u Whatiscomputing,acomputer,science(andengineering)?u Howdocomputerswork?

v Computers,architectures,datastructuresandalgorithms,programming,operatingsystems,networks,abstractmachinesandtheory,artificialintelligence,robotics,humancomputerinteraction,…

u Whatiscomprisedwithinthedomainofcomputing?v Comprehendingitscontentandstructurev Appreciatingitspast,presentandfuture

u Provideabasisuponwhichyoucanbuildthroughouttheremainderofyourcomputingeducation

2

Page 3: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Purpose of this Course

3

Page 4: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Course Outline

4

Page 5: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìSurvey:https://usc.qualtrics.com/jfe/form/SV_b3pwARaMqE18rINPassword:CS109Fall2017

5

1.Howmanycollegelevelcomputerclasseshaveyoucompleted?a.0 b.1 c.2 d.3 e.4ormore

2.Howmanyyearsofcomputerprogramminghaveyoudone?a.0 b.1 c.2 d.3 e.4ormore

3.Howmanyprogramminglanguagesdoyouknow?a.0 b.1 c.2 d.3 e.4ormore

4.AreyoutakingCS103concurrentlywiththisclass?a.Yes b.No

5.YourreasonfortakingCS109isa. Requiredforyourcurrentmajororminor.b. Notrequiredforyourcurrentmajororminorbutisrequiredforamajororminoryouwanttoadd(ormoveto).

c. NotrequiredforyourcurrentmajororminornorforamajororminoryouareconsideringbutyouareinterestedinlearningaboutComputerScience.

Page 6: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìLogistics

6

Page 7: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Instructor and TAsu Instructor:AndrewGoodneyu Office:PHE434u OfficeHour: Seesyllabus

7

u ContactInfo:[email protected]

TeachingAssistants(TAs)

Michail [email protected]

Office: SALComputerLabOfficeHour:TBD

[email protected]

Office: SALComputerLabOfficeHour:M15:30-17:30

ChungMingCheung(Jacky)[email protected]

Office:SALComputerLabOfficeHour:T16:00-17:00

Page 8: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Important Info

u Classv Location:SAL101 Days&Time:M12:00-13:50

uTherearenodiscussionorquizsectionsv Classisnow2units(usedtobe3)

u Co-requisite:CSCI103Lv Thereisnoprerequisite

u RequiredTextbookv ComputingforOrdinaryMortals,St.Amant,R.OxfordUniversityPress,2013

u Syllabusisonhttp://bytes.usc.edu/cs109/u Slideswillbepostedon“bytes”aftereachlectureuOtherreadingmaterialwillbemadeavailablethere

8

Page 9: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Homework (30%)

u Fourhomeworks (7.5%each)u Collaborationiswelcomeonthehomework

v Butcopyingisnotpermittedu Youareallowedatotaloftwolatedaysonthehomeworkv Onehomeworkmaybe2dayslate,ortwomaybe1daylate,withnopenalty

v Oncelatedaysareused,onedaylatereducesthescoreby25%,twodayslatereducesthescoreby50%,nocreditisgivenforthreeormoredayslate

v Allhomeworks mustbesubmittedtoearnapassinggradeu Allhomeworksubmissionsmustbetyped

9

Page 10: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Quizzes (5%), Midterm (30%),Final (35%)

u ~8in-classquizzes(1%each)uNocollaborationispermittedonthequizzesu Bestfivescoreswillberetainedsoquizzesareworth5%ofyourgrade

u 1midterm:worth30%ofyouroverallgrade

u 1finalexam(cumulative):worth35%ofyouroverallgrade

10

Page 11: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Quiz policy

Thereareabsolutelynomakeupquizzes.Ifyouneedtobeawayfromclasstoseeadoctor,ortoplayonasportsteam,themissedquizzesneedtocomefromyourquotaofthetwo‘allowedmisses.’Pleaseplanonthis.Ifyoumissquizzesearlierinthesemesterbecauseyoudon’tcometoclassfornogoodreasonandthenarefacedwithasituationlaterinthesemesterwhereyouneedtoseethedoctor,pleasedonotrequestamedicalexemption.Youshouldmarshall thequotaof‘allowedmisses’carefully.Thequizzeswillbeadministeredinclassbutitisimpossibletopredictexactlywhenduringthelecturetheywilloccur.Ifyoucometoclassafterthequizforthatdayhasbeenadministered(orleavebeforeitisadministered),youarenotentitledtoamakeuportohavethequizre-administeredforyou.

11

Page 12: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

How is the final grade assigned?

u Eachhomework,quizandexamreceivesarawnumericscoreu Bestfivequizscoresareretainedu Weightedcombinationofrawnumericscoresproducestotalrawscore(outof100)

u Thetotalrawscoreisnormalized– i.e.eachtotalrawscoreisdividedbythehighesttotalrawscoreintheclass

u Gradeboundariesdrawntogroupsimilarnormalizedscoresinsamefinalgrade

12

Page 13: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìWhat is a Computer?

13

Page 14: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Computer or Not?

14

Page 15: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Standard Definitions (dictionary.com)

u Anelectronicdevicedesignedtoacceptdata,performprescribedmathematicalandlogicaloperationsathighspeed,anddisplaytheresultsoftheseoperations

u Aprogrammablemachinethatperformshigh-speedprocessingofnumbers,aswellasoftext,graphics,symbols,andsoundv Allcomputerscontainacentralprocessingunit thatinterpretsandexecutesinstructions;

inputdevices,suchasakeyboardandamouse,throughwhich dataandcommandsenterthecomputer;memorythatenablesthecomputertostoreprogramsanddata;andoutputdevices,suchasprintersanddisplayscreens,thatshowtheresultsafterthecomputerhasprocesseddata

u Anelectronicdevicethatstoresandmanipulatesinformationv Unlikeacalculator,itisabletostoreaprogram andretrieveinformationfromitsmemory

u Amachinethatcanbeprogrammedtomanipulatesymbols

u Apersonwhocomputes;computist.v 1640s:“onewhocalculates”

15Aninformationtransformer

Page 16: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Types of Information

u Bits:0/1,T/F,True/False,Yes/Nov Andstringsofbits,suchas010110

u Numbers:5,101,-3,3.14159,i,πv Andnumericexpressions,suchas(3+2)

u Statementsinlogic:"x At(x,USC)Ù Person(x)Þ Smart(x)u Letters,words,sentences,paragraphs,articles,booksu Audio,imageandvideofilesu URLs(suchashttp://www/google.com)andwebpagesu Databasesu …

16

Page 17: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Binary

u Moderncomputersusebinaryarithmeticu Examples:

v 2410 =16+8=24 +23

=1 *24+1 *23+0 *22+0 *21+0 *20

= 110002v 9010 =64+16+8+2

=1 *26+0 *25+1 *24+1 *23+0 *22+1 *21+0 *20

=10110102v 101112 =1 *24+0 *23+1 *22+1 *21+1 *20

=16+4+2+1=2310

17

Page 18: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Information Transformation

u Convertonebodyofinformationtoanotherv Thatis,compute

u Example:Booleanalgebrav Informationexpressedinbits:0/1(orF/T)v Operationstransforminputbitstoyieldoutputbits

u AND,OR,NOT,…

18

AND 0 10 0 01 0 1

OR 0 10 0 11 1 1

NOT 0 11 0

XOR 0 10 0 11 1 0

AND(0,1)è 0 OR(0,1)è 1

AND(1,1)è 1 0OR(0,0)è

Page 19: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Information Transformation

19

AND 0 10 0 01 0 1

OR 0 10 0 11 1 1

NOT 0 11 0

Whatisthetruthtableforf(x,y)=AND(OR(x,y),NOT(AND(x,y)))?x y OR(x,y) AND(x,y) NOT(AND(x,y)) AND(OR(x,y),NOT(AND(x,y)))0 0 0 0 1 00 1 1 0 1 11 0 1 0 1 11 1 1 1 0 0

f 0 10 0 11 1 0

Page 20: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

More on Information Transformation

u Otherexamplesv Mathematicalcalculations– (10+2)/2=6– andlogicalproofsv Solvingpuzzlesv Sortinglists:4,2,1,3,6,5v Computationalthinkingv Transformingdataintoinsights(bigdata oranalytics)v Transformingknowledgeintodecisionsaboutwhatactionstoperformv Literary,musicalandartisticcomposition

u Hardware enablesimplementingtransformationsu Software (programs)control(s)transformationsu Algorithms areabstractdescriptionsoftransformations

20

Page 21: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Computational Thinking

u “thoughtprocessesinvolvedinformulatingproblemsandtheirsolutionssothatthesolutionsarerepresentedinaformthatcanbeeffectivelycarriedoutbyaninformation-processingagent” (Cuny,Snyder,Wing)

v wayofsolvingproblems,designingsystems,andunderstandinghumanbehaviorthatdrawsonconceptsfundamentaltocomputerscienceu Toflourishintoday'sworld,computationalthinkinghastobeafundamentalpart

ofthewaypeoplethinkandunderstandtheworldv creatingandmakinguseofdifferentlevelsofabstraction,tounderstandand

solveproblemsmoreeffectivelyv thinkingalgorithmically andwiththeabilitytoapplymathematicalconcepts

suchasinduction todevelopmoreefficient,fair,andsecuresolutionsv understandingtheconsequencesofscale,notonlyforreasonsofefficiency

butalsoforeconomicandsocialreasons

21

Humansthinking(i.e.,transforminginformation)todeviseproceduresforexecutionbyinformationtransformers(humanand/ormachine)

Page 22: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Computer or Not?

22

Page 23: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Implications

u Definingcomputersintermsoftheirfunctionality…v Stripsawayancillaryattributespreviouslythoughtessential

u Machine,electronic,speed,explicitprogrammability,…

v Enablesappreciatingthefullscopeofcomputersandcomputing

u Facilitatesrecognitionof“natural”computersv Brain:Thoughtispreeminentlyinformationtransformationv Embryonicdevelopment:BasedoninstructionswritteninDNAv Evolution:CombinesandmodifiesinformationinDNAv Immunesystem:Includespatternrecognizers,memory,…

23

DavidBaltimore:“Howbiologybecameaninformationscience”RichardDawkins:“Thedifferencebetweenlifeandnon-lifeisa

matternotofsubstancebutofinformation”

Page 24: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìComputer HistoryLooms,thediscretemachineabstraction,andthefirstcomputerprograms

24

Page 25: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

A History of Human-Built Computers

u Althoughcomputerscan(andhavebeen)builtusingallkindsofhardware,moderncomputingreallytookoffwiththeinventionofelectroniccomputerswhichwereprecededbymechanicalcomputers

u AhistoryofcomputingandtheJacquardLoomuMechanicalComputers

v TheDifferenceandAnalyticalEnginesv TheHollerithMachine

u ElectronicComputersv FromEDSACtotheMacbook

25

Reading:St.Amant: Introduction,Ch.1andCh.2

Page 26: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Before Mechanical Computers

Electroniccomputerswereprecededbymechanicalcomputersandmechanicalcomputerswereprecededby…

…looms

26

Page 27: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

A Simple Mechanical Loom

u Pressingtreadlescausesharnessestoliftthreadsu Theshuttleslidesacrossthreadundertheliftedthreadsu Thenthethreadsareloweredu Pressingtreadlescausesharnessestoliftthreadsu Theshuttleslidesacrossthreadundertheliftedthreadsu Thenthethreadsareloweredu Pressingtreadlescausesharnessestoliftthreadsu Theshuttleslidesacrossthreadundertheliftedthreadsu Thenthethreadsareloweredu …u Whatkindofpatternsdoesthisproduce?

27

Page 28: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Discrete Machines: State

uHowdoestheloombehaveasafunctionoftime?u Atanygiventimeasetofthreadsisraisedandtherestarelowered

uWritingdownthesequenceofraised(andlowered)threadstellsusthestepsthemachinewentthroughtoproducethecloth/tapestry/whatever

u Thepatternofraised(andlowered)threadsiscalledthestate ofthemachine

28

Page 29: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Discrete Machines: State and Encoding

u Choosingastaterepresentationtakesskill.Thestateshouldbev Parsimonious:itshouldbea“small”descriptorofwhatthemachineis

doingatanygiventimev Adequate:itshouldbe“bigenough”tocaptureeverything“interesting”

aboutthemachine

u Thesearesometimescontradictory.Theyarealsoqualitativeanddependonwhatbehaviorofthemachinewewanttodescribe

uUsuallyyouneedavocabulary(encoding)todescribestate.Inthecaseofaloom,statecanbeexpressedasabinarypattern(1forraised,0forlowered)

29

Page 30: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Discrete Machines: Abstraction

u Theloomisadiscretemachinev Stateisbinarypattern– i.e.discretev Thenotionoftimeisdiscrete– i.e.timeismodeledasproceedinginstepsor

finitechunks

uMoreprecisely,theloomcanbeusefullymodeledasadiscretemachine

u Thisisanexampleofanabstraction – akeyconceptinComputerScience

30

Page 31: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Review of terms

uState:Theconditionofasystematapointintime

uEncoding:SymbolicexpressionusedtorepresentuDiscrete:Proceedinginfinitesteps,individuallyseparateanddistinct

uBinary:Numericalnotationthatusesbase2uAbstraction:Simplified(“higher-level”)description

31

Page 32: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Weaving Complex Patterns

u Howtoproducemorecomplexpatterns?u Earlysolutionwashuman– thedrawloom

v Masterweavercallsoutwhichthreadstoliftv Drawboy liftsthreadsv Masterweaverthreadstheshuttlev Masterweavercallsoutwhichthreadstoliftv Drawboy liftsthreadsv Masterweaverthreadstheshuttlev Masterweavercallsoutwhichthreadstoliftv Drawboy liftsthreadsv Masterweaverthreadstheshuttlev …

32

Page 33: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The Jacquard Loom (1801): Mechanism

uMechanism:v Threadsattachedtospring-loadedrodsv Springsmakeallthreadswanttoliftunlessstoppedsomehow

v Ametal‘card’withholesisinsertedintothepathofthethreads

v Aholeinthecorrespondingplaceallowsathreadtolift.Noholearreststhethreadmotionandstopsitfromlifting

u TheJacquardLoom(fromtheTeachingPaletteviaYouTube)

33

Page 34: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The Jacquard Loom: Programming

uWeavingbecomestheprocessofv Creatingcardswithholesinthem(punchedcards)

v Sequencingthecardsintherightorder

u Eachcardisaninstruction tothemachinetodopreciselyonething(i.e.,putitselfintooneparticularstate)

u Asequenceofcards(i.e.,asequenceofinstructions)causesthemachinetostepthroughasequenceofstates.Thecardsequenceisaprogram

u Theweaverasaprogrammer34

JosephMarieJacquard(aswovenbyhisloomviaaprogramof24,000instructions).ImagecourtesyofWikipedia.

Page 35: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The Jacquard Loom: Programming

u Adiscrete,‘automatic’machineu Sincewehavechosenabinaryencodingthemachinestateisabinarynumber

u Eachinstruction isalsoabinarynumbersinceeachinstructionis(literally)thestatetheprogrammerwantsthemachinetobeinwhenthatinstructionisexecuted

u Theprogram forthemachineisasequenceofinstructions.Eachprogramis(literally)asequenceofstatestheprogrammerwantsthemachinetostepthrough

u Theprogram isthusasequenceofbinarynumbers35

Page 36: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

A Loom Program

000000000010000010

001000100000101000

000010000

000101000001000100

010000010000000000

36

0130

6840

16

4068

1300

u Thismachine’sstateiscapturedina9-bitword

u Eachinstructionintheprogramisalsoa9-bitword

u Thestateandeachinstructionisthus9bitswide

u Thisprogramis9instructionslong

Page 37: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Loom Program Limitations

uDoesnotscale:v Largeinstructions:Toprograma‘big’machineyouneed‘big’words(largestateimplieslargeinstructionwidths)

v Nocounting:Norepeatsorloopstodothingsoveracertainnumberoftimes(No“do..while”or“repeat..until”)

v Nomodularity:Nologicalchunksforsub-patternsthatcanbereusedwithoutreplication(No“functions,methods,subroutines…”)

uNodecisionmakingonthefly:v Nobranchingtodecidetodoonethinginsteadofanotherbasedonacondition(No“if-then-else”.Nojumpsor“goto”)

37

Page 38: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

How Big/Fast is a Modern Computer?

u TypicalMacbook Prolaptophas~1billiontransistorsu Thestateofthemachineisabinarynumberwith~1billionbits(abinarywordofwidth~1billion)v NotpossibletoprogramaMacbook Probywritingasequenceofinstructionseach~1Billionbitswide

u AMacbook Proexecutes~5billioninstructionspersecondv Possible tohaveprogramsthatarebillionsofinstructionslongandyethavethemfinishoperatinginareasonabletime

38

Page 39: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìComputer HistoryMechanicalcomputers:Thedifferenceandanalyticalengines,theHollerithmachine

39

Page 40: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The Difference Engine (1822)

u CharlesBabbageuMechanicalcalculator tocomputemathematicaltables

v Loom:programtransformsthreadstopatternsonclothv Differenceengine:programtransformsnumbersintoothernumbers

u PolynomialfunctioncomputationusingdifferencesuOutputwasviaa‘printer’– adevicethatproducedprinter’splatessotheycouldbestampedontopaper

uNobranchingorlooping,limitedinwhatitcouldcompute

40

VideofromYouTube.

Page 41: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The Analytical Engine (1837)

u CharlesBabbageuWorld’sfirstgeneralpurpose mechanicalcalculator

v Memoryv Arithmeticunitv Branchingv Looping

u ProgrammedbypunchedcardslikealoomuOutputwasviaa‘printer’– adevicethatproducedprinter’splatessotheycouldbestampedontopaper

41

VideofromYouTube.

Page 42: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The Hollerith Tabulator (1890)

uHermannHollerithu Firstdevicetoreaddata intoamachine:anelectromechanicalsystembasedonpunchedcards

u BuilttotabulatetheresultsofUScensusuHollerithwentontoformtheTabulatingMachineCompany.MergedwithotherstoformtheComputingTabulatingRecordingCompany(CTR).Renamedin1924toInternationalBusinessMachines(IBM)

42

HermannHollerithandoneofhispunchedcards.ImagescourtesyofWikipedia.

Page 43: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Fundamental Concepts

uStateanddiscretemachinesuAbstractionandmodelsuEncodingdataandinstructionsuProgramminguTobegeneral,programsneedtoaccessamemory,andtobeabletocontroltheorderoftheinstructionstoexecutebasedontheresultsofcomputation

43

Page 44: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìComputer HistoryThefirstelectroniccomputers

44

Page 45: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The ENIAC (1943-46)

u ElectronicNumericalIntegratorAndComputer

u EckertandMauchly (UniversityofPennsylvania)

u Firstelectronic,generalpurposecomputer.Turing-complete,digital,reprogrammable(cumbersome)

u Vacuumtubeanddiode-based

45

Page 46: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

The EDVAC (1944-49)

u ElectronicDiscreteVariableAutomaticComputer(EckertandMauchly)

u Firststoredprogramcomputer,binary(ENIACwasdecimal).Operational1951.

u PopularizedbyvonNeumann(FirstDraftofaReportontheEDVAC)– firstreportonamoderncomputerarchitecture

46

Page 47: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

Computer History Summary

47

u Althoughcomputerscan(andhavebeen)builtusingallkindsofhardware,moderncomputingreallytookoffwiththeinventionofelectroniccomputerswhichwereprecededbymechanicalcomputers

u AhistoryofcomputingandtheJacquardLoomuMechanicalComputers

v TheDifferenceandAnalyticalEnginesv TheHollerithMachine

u ElectronicComputersv FromEDSACtotheMacbook

Page 48: Introduction to Computer Science - USC Bitsbits.usc.edu/files/cs109/CSCI109-Lecture1-Introduction... · 2017-08-21 · Introduction to Computer Science CSCI 109 Andrew Goodney Fall

ìNext time: Computer ArchitectureHowarecomputersbuilt?

48