6 September How Computers Work. Follow Ups VeriSign: 2001: A Space.

21
6 September How Computers Work

Transcript of 6 September How Computers Work. Follow Ups VeriSign: 2001: A Space.

Page 1: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

6 September

How Computers Work

Page 2: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Follow Ups VeriSign:

https://lv0.net/Form/TechnoServe/YouCanHelp

2001: A Space Odyssey Produced in 1968 as science fiction

Intel founded Sony introduces Trinitron technology Keyboard, mouse & windows demonstrated First “artificial intelligence” program Apollo Guidance Computer Tentacle Arm

Page 3: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Computer in the Arts About the work

When was the work written or produced? What’s the genre?

The role of computers A character or a tool? Central to the plot or peripheral?

How computers are portrayed Intelligent or simplistic? Threatening, helpful or neutral?

Page 4: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Current Event: Hurricane Images Google Earth: gives people a view of the world "I am trying to get a current overlay for the area

around 2203 Curcor Court in Gulfport, Miss." grass-roots effort

identified scores of post-hurricane images from NOAA determined landmarks to integrate into Google Earth posted them

By Saturday, Google, NASA, CMU formalized Power of the Internet: everyone can contribute This is a great use of Google Earth

Are there bad ones? NY Times, Sept 5http://www.nytimes.com/2005/09/05/technology/05google.html?th&emc=th

Page 5: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

To Understand …

How your web page works How does a computer work? How do web pages work?

How you share your web page What is a network? What is the Internet?

Page 6: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

How Does a Computer Work?

It is actually a very simple machine It executes exactly what it is told to

do Forrest Gump

“Run, Forrest, run” Forrest

Computers execute algorithms

Page 7: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

What is an algorithm?

A detailed sequence of actions to perform to accomplish some task

Named after an Iranian mathematician, Al-Khawarizmi 813 – 833 C.E. Mathematician: algebra,

trigonometry, geometry Astronomy and geography as well

Page 8: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Examples of Algorithms

Mapquest directions Assembly instructions User’s manual Software program

Other examples?

Page 9: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

A simple algorithm Using a calculator, how do you find

the average of three numbers? Assume no average function Assume that the calculator is already

on Solution

Enter the first number; enter +Enter the second number; enter +Enter the third number; enter / 3 =

Page 10: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

A bigger example Using a calculator, how do you find

the average of 100 numbers? No longer want to list one by one

Introduces loops Solution

For each number,Enter the number; enter +

Enter / 100 =

Page 11: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

A more complex algorithm

Take the absolute value of a number

Introduces decision making Solution

If the number is less than 0The answer is –number

ElseThe answer is number

Page 12: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Exercise

Break into 3 groups Devise an algorithm to order a

group of people from shortest to tallest

We will then execute it on another group

Page 13: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Homework Assignment A triangle is a 3-sided figure. The sum of

any 2 sides must be longer than the third side.

Write an algorithm to check if three numbers could constitute the sides of a triangle. It produces a result of “yes” or “no”.

(This is also a dry run to make sure that blackboard is working properly.)

Page 14: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Simplified Model of a Computer

processor

instructions data

the information that it works

on

defines an

algorithm

retrieves the instruction directs data movement

Page 15: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Data A computer doesn’t work on actual

numbers, but locations (called variables ) Does action to whatever value is in that

location Variables that have values that never change

are constants

Demonstration How would you swap two numbers? Why do computers work like this?

Page 16: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Data Types

All data is stored as a series of zeroes and ones

Computer doesn’t know if it is numeric or text or what format it is

Computer assumes that the instructions know the format of the data

Page 17: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Programming Languages Ways to describe algorithms Lots of ways to describe, but a machine

has only one way to execute A program translates the language the

person writes into something the computer understands Compilers translate once, interpreters

translate every time Later in the semester we’ll look at what

the computer understands

Page 18: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Web Pages Web pages are defined in a

language called HTML (HyperText Markup Language)

Hypertext: text that has different paths that can be taken

Markup Language: the text that is to be presented and instructions (markups) on how to present it

Page 19: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Hypertext Proposed by Vannevar Bush in 1945 We do not think or learn linearly

We need to understand many concepts and how they come together

People have different knowledge and learning skills

We want to go off and further explore ideas In literature, we may want to explore

alternative outcomes

Page 20: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Markup Language

Source does not appear the way that it will eventually look Contrast: WYSIWYG -- What You See

Is What You Get Advantage: easy to edit Disadvantage: hard to visualize

Page 21: 6 September How Computers Work. Follow Ups VeriSign:   2001: A Space.

Editting HTML files Two options

Edit HTML Use a WYSIWYG

Why learn HTML? Tool to understand computers

Why use HTML? Control Simple changes