Download presentation
Presentation is loading. Please wait.
1
8 February How Computers Work: Algorithms The Internet
2
News Michelle
3
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
4
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
5
Examples of Algorithms Mapquest directions Assembly instructions User’s manual Software program Other examples?
6
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 =
7
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 =
8
A more complex algorithm Take the average of only the positive numbers Introduces decision making Solution If the number is greater than 0 Add the number Else Subtract 1 from the count of numbers
9
For the Computer to Execute an Algorithm Instructions must be very explicit Instructions must be in a form that the computer can understand Operation operand Operation: what to do Operand: what to do it to Example: ADD 3,5 Let’s look at programming a robot
10
Chef Robot Actually, there is a Chinese food chef robot robot
11
The Internet What is it? The infrastructure that connects identified computers Links = the wires Routers = the boxes that connect them World Wide Web Computers that contain information to be shared Servers
12
How Do You Get to the Servers? Computers are connected through a network Network requires protocol to work A protocol is a set of rules The one that is used here is called IP (Internet Protocol)
13
How would you route a note? Count off If I hand one of you a note for a set number, what do you need to know? Which way to go – not exactly where it is Your number, the number you want to get to Algorithm? If number is greater, pass left smaller, pass right equal, read
14
How Networking Works Computers need the same thing Who identified by IP address Every machine that is connected to the network has one http://www.lawrencegoetz.com/programs/ipinfo/ Command prompt Routers know how to get there But IP addresses aren’t user friendly Give names instead Domain Name Server does the mapping
15
Anatomy of a URL Protocol: server-name/file-to-display Protocol: usually http Have you ever seen others? https? Server-name The computer’s name Usually begins with www Usually ends with 3 characters that define the kind of site However, there are no rules: as long as its registered, you can get there File-to-display Can be a whole path (just like Windows)
16
How to Build that File Text file that says what to display Web pages use HTML Hypertext Markup Language Two types of information Text Instructions on how to display Instructions are in the form of tags
17
Why Should You Learn About HTML? Mainly, to demystify But if you are building, you want to know even if you have a package to help you build Why? Sometimes you can’t figure out how to make it do what you want Sometimes you can’t figure out what is wrong Sometimes you just want to make some minor changes to an existing page If you understand how it works, YOU are in control and not the editor
18
General Structure: HTML Page
19
Tuesday: We’ll Build a Page Bring your laptop
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.