introduction to computers and programming

12
Introduction to Computers and Programming 1. History of computers 2. What is a computer system? 3. What is a software? 4. What is programming? 5. Different languages 6. Compiled vs. interpreted 1

Upload: jason-forbes

Post on 14-Mar-2016

31 views

Category:

Documents


0 download

DESCRIPTION

Introduction to Computers and Programming. History of computers What is a computer system? What is a software? What is programming? Different languages Compiled vs. interpreted. History of Computers. - PowerPoint PPT Presentation

TRANSCRIPT

Page 2: Introduction to Computers and Programming

History of Computers Don’t mistake computers with calculators or adding

machines, who came with the Mayans, Egyptians, etc..

Computers are programmable. The first calculators were not programmable, hence not considered computers.

Although many calculators today are programmable, we still distinguish them from computers. A better distinction between them might be the generality of their function – a computer is more a more general computing machine than a calculator.

However, where to draw the line is difficult. For our purposes, we will continue to use the (archaic) description that calculators are not programmable. 2

History 1/4

Page 3: Introduction to Computers and Programming

1854 (~150 years ago)

Pioneer of modern computer!

3

Babbage’s difference engine

Device to subtract adjacent values in a column of numbers. Created for engineers in charge of creating tables of logarithms and trigonometric functions.

History 2/4

Page 4: Introduction to Computers and Programming

1943 (~70 years ago).. came Colossus

Primarily used for breaking the German codes during World War 2.

It would crack Enigma Codes (codes that were cracked by exhaustively shifting text by arbitrary amounts). For example:

‘Zsszbj zs 9599’ would be ‘Attack at 0600’

4

History 3/4

Page 5: Introduction to Computers and Programming

Finally, the von Neumann Architecture… The Von Neumann computer architecture is mostly

what we use today. The architecture separates a computer in 3 major parts: The Central Processing Unit (CPU) The computer memory The Input/Output (I/O) devices

5

CPU + memoryScreen=output

Speakers=output Mouse=input

Keyboard=input

?

?

Knob=inputHistory 4/4

Page 6: Introduction to Computers and Programming

Software and programming? Microsoft Word, Excel, Guitar Hero, the address book in

your cell phone, the electronic that starts a car, the avionics in an airplane… are all software that were written by people.

Programming is the act of writing logical instructions that will be executed by the computer.

It is as difficult as learning to speak a foreign language, since the programmer is constrained to the vocabulary (specific keywords) and grammar (exact syntax) of programming.

6

Page 7: Introduction to Computers and Programming

A computer system today Keeping the von Neumann architecture, today’s

computing systems combine both hardware and software.

Hardware: the physical non-media components of the computer which are used by software

Software: the set of instructions used to manipulate the hardware

Media: physical items or devices used to store data or software outside of the computer

7

Page 8: Introduction to Computers and Programming

Parts of a computer Examples of Hardware

CPU, RAM, motherboard, controllers, video card, DVDROM drive, hard drive

Examples of Software Operating system (Windows, OS X, Linux) Applications (Word, Firefox, MATLAB) Drivers (usually considered part of the OS) Compilers / Interpreters

Examples of Media CDROM, DVDROM, SD Cards, USB drives [splitting hairs?] 8

Page 9: Introduction to Computers and Programming

Categories of software Software contains the instructions the CPU uses

to run programs. There are several categories, including: Operating systems (OS) – manager of the computer

system as a whole

Software applications – commercial programs that have been written to solve specific problems

Compilers / Interpreters - to ‘translate’ programs written by people into something understandable by the machine

9

Page 10: Introduction to Computers and Programming

Generations of Languages used to write software1) Machine language – also called binary language. Sequenceof 0’s and 1’s.

2) Assembly language – each line of code produces a single machine instruction (add, subtract…), see bottom of page 11.

3) High-level language – slightly closer to spoken languages.

10

add b,cadd a,b

a= a + b + c;

This line does the same as the two above.

Page 11: Introduction to Computers and Programming

Finally… MATLAB Is an interpreted language – does not require

compilation, but instead has an interpreter running behind the scenes

Has an interactive environment – “In the MATLAB environment, you can develop and execute

programs that contain MATLAB commands. You can execute a MATLAB command, observe the results, and then execute another MATLAB command that interacts with the information in memory, observe its results and so on.”

11

Page 12: Introduction to Computers and Programming

Internet vs. WWW?The Internet is a set of computers which communicate

using a set of communication protocols, or agreements, to achieve the desired goals.

Examples of Internet protocols (application layer): HTTP (World Wide Web) FTP (File Transfer Protocol) POP3 (Post Office Protocol) SMTP (Simple Mail Transport Protocol) DNS (Domain Name Service)

The WWW is just one of many means of using the Internet 12