How Computers Work Part 1 18 September 2006
Sometimes They Don’t Having a Bad Day Mouse Won’t Work
What does a Computer Do Well? Intelligence amplifier amplifies our ability to perform mental activities “power tools” for the mind Can process much more information Does repetitive tasks quickly and correctly Check things more quickly Removes people from boring tasks Manipulates forms and data
What Wasn’t Possible Before? We can do things in virtual environmentsvirtual environments Chemists can see things at microscopic levelsmicroscopic levels Micron: millionth of a meter Model weatherweather Hurricane predictions Model historic eventshistoric events
Marvelous Manipulator Manipulates form, not content Everything is a symbol Computers do not understand meaning When it appears to understand or apply judgment… Reflecting human knowledge that is encapsulated Programming: capturing our knowledge “expert systems” Examples from movies or books?
What a Computer Does One input, one output Displaying a movie One input, multiple outputs Different reports from the same data Multiple inputs, one output Computing a statistic Other examples? IN PROCESS OUT
Thinking about Tools Write down a favorite tool or device Write down what it is intended to do Write down an alternative use Switch with a neighbor Write down another alternative Switch back
Computers: The Most Adaptable of Tools Why? We can PROGRAM the computer Instructions are called software Embedded computers Programmed by the manufacturer General purpose computers Programmed by the consumer
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
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
Examples of Algorithms Mapquest directions Assembly instructions User’s manual Software program Other examples?
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 =
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 =
A more complex algorithm Take the absolute value of a number Introduces decision making Solution If the number is less than 0 The answer is –number Else The answer is number
Simplified Model of a Computer processor instructionsdata the information that it works on defines an algorithm retrieves the instruction directs data movement Control Unit Arithmetic Logic Unit MEMORY Performs the operations