Presentation is loading. Please wait.

Presentation is loading. Please wait.

Administrivia Has everyone been to the course web site? First assignment ready – pick it up on web Labs to begin Monday –Lab times: TWTH 7:30pm – 10:30pm.

Similar presentations


Presentation on theme: "Administrivia Has everyone been to the course web site? First assignment ready – pick it up on web Labs to begin Monday –Lab times: TWTH 7:30pm – 10:30pm."— Presentation transcript:

1 Administrivia Has everyone been to the course web site? First assignment ready – pick it up on web Labs to begin Monday –Lab times: TWTH 7:30pm – 10:30pm –Location: Friend 006/007 –Details Pick up lab on web, read it, do it; go to lab to get help or use the computers if you like. Questions??

2 What Does a Computer Do? Whatever I tell it to do I say: Add 2 and 3 show me the result –Computer says: 5 I say: Multiply that result by 7 and show me the result –Computer says: 35 I say: Show me the home page of the Princeton CS department –Computer says:

3 What’s Going On? Who’s doing the work? How do I tell it what to do?

4 The Ghost in the Machine Read an input and memorize it Read another input and memorize it Add the inputs and display result Read input and memorize it Multiply input with previous result and display the result Hardware does the work Programmer writes a program for the machine Program tells hardware what to do at each step But not in English: In a computer programming language …

5 What Programs Look Like read (a) read (b) c = a + b read (d) e = d * c print (e) ; Read first input and store it in variable a ; Read second input and store it in variable b ; Add the values of a and b and store the result in variable c ; Read third input and store it in variable d ; Multiply the values of c and d and store the result in variable e ; Display the value of variable e The computer takes each of these instructions and executes it

6 The Computer’s Job Computing outputs from inputs by performing operations Representing and translating information Storing, reading and writing data to/from memory Accepting inputs from and producing outputs to the external world (keyboards, displays, printers) Sequencing steps Maintaining state Networking Compiling and managing programs

7 Computer’s Job: Compute Outputs from Inputs CPU out = in1 + in2 2 3 5 in1 in2 out

8 Computer’s Job: Read/Write Variables From/To Memory CPU c = a + b a c b 2 5 3 2 3 Memory 5

9 Computer’s Job: Input and Output CPU Memory 2 read (a) 2 a c b 2 read (b) print (c) c = a + b

10 Computer’s Job: Input and Output CPU Memory 3 3 read (b) a c b 2 3 read (a) read (b) print (c) c = a + b

11 Computer’s Job: Input and Output CPU Memory a c b 2 5 3 c = a + b 2 3 5 read (a) read (b) print (c) c = a + b

12 Computer’s Job: Input and Output CPU Memory read (a) read (b) a c b 2 5 3 print (c) c = a + b 5 5 5

13 How does computer understand “a”, “b”, “4”, etc. –i.e. data values? How does computer understand “read (a)”; that it should add its inputs, when to read from memory, when to take next step etc. –i.e. control Computer’s Job: Representing and Translating Information Answer: Everything is represented as 1’s and 0’s –Computer only sees 1’s and 0’s –All data values, instructions etc are encoded as combinations of 1’s and 0’s

14 The World of 1’s and 0’s CPU c = a + b 010111001 0010 Memory 0011 0101 0010 0011 0101 00000 00001 00010 10011 11111

15 Computer’s Job: Sequencing Executing programs requires the computer to take several discrete steps, one after another A “clock” is an input to the CPU that orchestrates the sequencing –each time clock changes its value, CPU takes next step So there are lots of inputs to the CPU, of different types: –Data values (2, 3, etc) –Program instructions (read a; c=a+b; etc) –Clock

16 Computer’s Job: Maintaining State The computer also maintains “state” i.e. remembers information across steps of execution; e.g. –Holds results from previous step for use in next step –Values of a,b and c in memory –Internal state in CPU (later) Computer can be viewed as a “state machine.” It steps from one state to another based on the current inputs, including instructions, data and clock signal Except, it is a “programmable state machine.”The states and transitions it makes are not fixed in hardware or the same every it starts, but rather are controlled in part by program instructions which can be changed easily (in software)

17 Memory CPU Network Web Server At Princeton CS Network Card Graphics Card Sound Card http://www.cs.princeton.edu Network CPU When user enters URL, CPU needs to fetch the page. Network device sends request to web server www.cs.princeton.edu over the network (Internet) Computer’s Job: Networking CPU talks to a network device, asking it to request page corresp. to the URL

18 Memory CPU Network Web Server At Princeton CS Network Card Graphics Card Sound Card http://www.cs.princeton.edu Network Web Server At Princeton CS CPU Web server sends reply (page) back, which network device receives Network device forwards the page to CPU, which sends it to graphics device for rendering and then to display Computer’s Job: Networking

19 Computer’s Job: Compiling and Managing Programs Convert high-level, human-readable programming languages, data representations and sequencing methods to machine-readable data, control and sequencing in 1’s and 0’s –Compilers do this Manage hardware resources so that multiple programs can run at the same time (email, MS Word and MP3 Player), security is provided, etc. –Operating systems do this

20 Summary: The Computer’s Job Computing outputs from inputs by performing operations Representing and translating information Storing, reading and writing data to/from memory Accepting inputs from and producing outputs to the external world (keyboards, displays, printers) Sequencing steps Maintaining state Networking Compiling and managing programs

21 Rest of the Course Hardware: Building a computer –How arithmetic and logical operations are realized –How data are represented –How memory is realized –How sequencing is done and state machines are realized Software: Programming and Using a computer –Programs and Programming languages –Algorithms –Applications: Graphics and Sound Operating Systems, Networking and Distributed Computing –Operating Systems –Basic Networking –Applications: E-mail and the Internet –Peer-to-peer and music sharing Hard Problems and Limits of Computing Security, Privacy, Artificial Intelligence

22 Let’s Go Buy a Computer

23 So What’s in a Computer? Processor brains Memory scratch paper Disk long term memory I/O communication (senses) Software reconfigurability

24 What’s in a Computer? CPU Communications I/O Text Sound Software Power Disk RAM Ports

25 Let’s Go Buy a Computer

26 Computer Configuration Processor (Pentium IV, 2.8 GHz) RAM (512 MB of SDRAM (expandable)) Disk (80 GB) CD ROM/ CD RW/DVD/… 17" XGA TFT Display (1280 x 1024 res.) 3.5" 1.44MB Floppy Disk Drive S3 Savage IX 128-bit AGP 2x graphics –8MB memory, 3D Hardware acceleration, composite TV-Out support, … 16-bit Sound

27 Computer Configuration (contd) 2 Type-I or Type-II slots or 1 Type-III slot 2 USB Ports Built-in 56Kbps V.90 Data/fax modem Built-in 10/100 Ethernet Adapter and 802.11b/g wireless Also –universal AC adapter, –built-in Lithium-Ion battery, –Microsoft Windows XP, –Encarta World Encyclopedia online version…

28 Putting Together an Application Word (is a part of the Office application) Runs on Windows (an operating system) Which runs on a Dell PC (a computer) Which has a Pentium (a processor) Enhanced by connections to monitor, printer, network Uses random access memory (RAM) to work on document, disk (non-volatile) memory to store in Need a CD-ROM to install application (or install off the Internet over a broadband connection)

29 What’s Special About a Computer? Most complex object made by humans A rich communication mechanism for society Amazing how it works Reconfigurability Moore’s Law

30 More for Less --Moore’s Law 1985 when I was a student here –A desktop machine in the lab $150,000 (now < $1,000) 700 KHz chip (now ~3 GHz) 1 MB memory (now 128-512 MB) 80 MB disk (now 80 GB +) CD-ROM had just been invented (83) Minimal Internet connection Communication to Internet 9600 bps (now 10 Mbps)

31 Moore’s Law (contd) $150,000 (now < $1,000) –Factor of 150 700 Khz processor (now 2 GHz chip) –Factor of 3000 1 MB memory (now 256MB) –Factor of 256 80 MB disk (now 40/80 GB) –Factor of 1000 Communication 9600 bps (now 10 Mbps) –Factor of 1000

32 An interesting example: Walmart/Microtel PC AMD 1.5 GHz Sempron processor with 3DNow! Technology 128 MB DDR Memory, expandable to 2 GB 20 GB Ultra ATA-100 Hard Drive / 5400 RPM 52x CD-ROM drive Integrated 10/100 Ethernet Connection Integrated graphics up to 64 MB shared video memory Integrated 5.1 Channel AC'97 Audio Available drive bays: Two 5.25", one 3.5“ No operating system installed Speakers, but no display Price: $198

33 Moore’s Law (contd) year log (people per computer) Mainframe Minicomputer Workstation PCLaptop PDA ??? * This slide and the next lifted from a presentation by David Culler

34 Moore’s Law (contd) Itanium2 (241M ) nearly a thousand 8086’s would fit in a modern microprocessor Processing & Storage LNA mixer PLL baseband filters I  Q  Communication Sensing Actuation SOON:

35 The Rest of the Course

36 Rest of the Course Hardware: Building a computer –How arithmetic and logical operations are realized –How data are represented –How memory is realized –How sequencing is done and state machines are realized Software: Programming and Using a computer –Programs and Programming languages –Algorithms –Applications: Graphics and Sound Operating Systems, Networking and Distributed Computing –Operating Systems –Basic Networking –Applications: E-mail and the Internet –Peer-to-peer and music sharing Hard Problems and Limits of Computing Security, Privacy, Artificial Intelligence (?)

37 Hardware: Building a computer Start with simplest part – switch Build logic gates – AND/OR –Use to solve logic problems Build memory Build processing power –Arithmetic Unit Build simple programming language

38 How to represent data How to manipulate data How to manage information Algorithms –Simple algorithms for sorting and searching –Recursion Two special applications –Picture processing on the computer –Sound processing on the computer Programming and Using a Computer

39 Operating Systems Running programs –How do you programs run and communicate Resource Management –How do multiple applications share resources and run “at the same time” –How do you ensure that applications get their fair share Virtualization –How do you hide the details of different hardware from the upper levels of software

40 How do computers communicate –Protocols TCP/IP, HTTP, FTP, … The InterNet –What it is and where it came from –How it transports email and displays web pages Differing network connections –Client/server vs. peer-to-peer –How networks facilitate music sharing Networking and Distributed Applications

41 Hard Problems and the Limits of Computing Hard problems –Problems unlikely to be solved in our lifetime –Problems unlikely to be solved in millennia Undecidable problems –Problems that provably can never be solved

42 Security and Privacy Security –Preventing break-ins, eavesdropping, etc –Using the hardness of problems Privacy –Systems are not secure –How much information should be public Digital rights management –Old ideas of copyright law may not work –When is sharing legal? Safe communication –Should you send your credit card over the internet?

43 If we have time … How well can computers –Understand written text –Understand spoken text –Understand hand drawn pictures –Play chess? –Compose music –Listen to music??? –“Enjoy” music? Possibly a look inside a big program


Download ppt "Administrivia Has everyone been to the course web site? First assignment ready – pick it up on web Labs to begin Monday –Lab times: TWTH 7:30pm – 10:30pm."

Similar presentations


Ads by Google