Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computers and Programming

Similar presentations


Presentation on theme: "Introduction to Computers and Programming"— Presentation transcript:

1 Introduction to Computers and Programming

2 What are humankind’s greatest inventions?

3 What are humankind’s greatest inventions?
The wheel? Fire? Light bulb? Disneyland? Microscope? Television?

4 The invention of the computer
1945 – Eckert & Mauchly built ENIAC (Electronic Numerical Integrator & Calculator) at Penn 1951 – E&M built UNIVAC I for Remington-Rand Which became Sperry Which merged with Burroughs Which became Unisys 1953 – IBM entered the market How fast is a computer? Processor alone: Intel Pentium 4 : 6 instructions / clock cycle 3.4 Ghz = 3.4 billion clock cycles / second Electronic Numerical Integrator and Computer The ENIAC contained 17,468 vacuum tubes, along with 70,000 resistors, 10,000 capacitors, 1,500 relays, 6,000 manual switches and 5 million soldered joints. It covered 1800 square feet (167 square meters) of floor space, weighed 30 tons, consumed 160 kilowatts of electrical power. It was told that when the ENIAC turned on, lights of the city of Philadelphia dimmed. however, this was first reported incorrectly by the Philadelphia Bulletin in 1946 and since then has become an urban myth. The ENIAC issued 5000 instructions per second. The story of a bug: Admiral Grace Hopper (an early computing pioneer better known for inventing {COBOL}) liked to tell a story in which a technician solved a persistent {glitch} in the Harvard Mark II machine by pulling an actual insect out from between the contacts of one of its relays. For many years the logbook associated with the incident and the actual bug in question (a moth) sat in a display case at the Naval Surface Warfare Center. It was moved to the Smithsonian in mid-1991 for their History of American Technology Museum section.

5 The invention of the computer
PCs Altair Imsai Apple, Atari, Commodore (in West Chester, PA), Sinclair Finally IBM PC (w/out windows & mouse) MAC (w/ windows & mouse)

6 What is a computer? Computers are devices for manipulating information. Computers operate under the control of a changeable program.

7 What is a computer? INPUT (information) PROCESSING OUTPUT
MEMORY

8 Functional View of a Computer
Output Devices CPU Input Devices Main Memory Secondary Memory

9 Hardware Basics The central processing unit (CPU) is the “brain” of a computer. The CPU carries out all the basic operations on the data. The CPU communicates with the main memory

10 Number of processors (cores)
1 – uni 2 – dual 4 – quad Multi/parallel

11 Hardware Basics Memory stores programs and data.
CPU can only directly access information stored in main memory (RAM or Random Access Memory). Main memory is fast, but volatile, i.e. when the power is interrupted, the contents of memory are lost. Secondary memory provides more permanent storage: magnetic (hard drive, floppy), optical (CD, DVD)

12 Hardware Basics Input devices Output devices
Information is passed to the computer through keyboards, mice, etc. Output devices Processed information is presented to the user through the monitor, printer, etc.

13 Computer Size ENIAC then… ENIAC today…

14 Computational Power Intel Pentium 4: ENIAC: 5000 instructions /second
6 instructions/clock cycle 3.4 GHz = 3.4 billion clock cycles/second ENIAC: 5000 instructions /second

15 What computers understand
Very very little!! They really only know about numbers More accurate: computers are used to encode numbers Voltage on wire: 1 No voltage: 0 Electronic devices

16 Bits & bytes Bit = 0 or 1 Byte = 8 bits
K (kilo) byte = 2^10 = 1024 ~= 1000 bytes M (mega) byte = 10^6 bytes G (giga) byte = 10^9 bytes T (tera) byte = 10^12 bytes

17 Byte Everything a computer is working with is encoded in bytes!
JPEG pictures, Excel spreadsheets, annoying Web pop-up adds, everything! Using the binary number system, a byte can be interpreted as a decimal number

18 Base 2 vs. base 10 Numbers in base 10 10112 = ? in base 10
= 9x x x x100 10112 = ? in base 10

19 What is a computer program?
A detailed, step-by-step set of instructions telling a computer what to do. Computational recipe If we change the program, the computer performs a different set of actions or a different task. The machine stays the same, but the program changes!

20 Program Power Software (programs) rule the hardware (the physical machine). The process of creating this software is called programming.

21 What is Computer Science?
It is not the study of computers! “Computers are to computer science what telescopes are to astronomy.” – E. Dijkstra

22 What is Computer Science
This question is really, “What can be computed?” Exploration of problem solving using computers Design a solution by developing an algorithm Algorithm: step-by-step description of a process. break down complicated problems into simple steps that the computer can understand Robust, time and space efficient solutions

23 Why learn to program?

24 Programming Languages
Programs are expressed in a precise, unambiguous way using programming languages. Are like code to the computer Every structure in programming language has a precise form, called its syntax Every structure in programming language has a precise meaning, called its semantics.

25 Programming languages
Programming developments Machine code Assembly Language Easier to write, debug, and update High level languages Strive to be machine independent Easier to learn and use 1954 – FORTRAN 1961 – COBOL Then ALGOL, LISP, BASIC 1970 – Pascal 1980’s – C 1990’s – C++, Java And many, many others.

26 Programming Languages
Eamample of an Assembly Language program: Add two numbers: Load the number from memory location 2001 into the CPU Load the number from memory location 2002 into the CPU Add the two numbers in the CPU Store the result into location 2003

27 Programming Languages
High-level language c = a + b

28 High level languges (HLL)
Not directly understood by the computer Humanly readable Requires the use of a compiler Compilers convert programs written in a high-level language into the machine language of some computer. Compiler is a program Input = code written in a HLL Output = machine code

29 Let’s make it clear.. A program is a description of a process (recipe) in a particular programming language that achieves some task Could be small, e.g. one that implements a calculator Or huge: e.g. a program that your bank uses to track all of its accounts.

30 Algorithm A description of a process apart from any programming language Can be implemented in any programming language Can be written in English, but pseudo-code is better! between English and a programming language

31 Types of software OS (operating system) Programming environment/tools
Applications

32 Operating Systems (OS)
An OS is a program that manages the computer hardware (e.g. scheduling of resources like CPU, storage, etc.) Acts as an intermediary between the computer user and the computer hardware. Windows Linux Unix Mac OS Many others

33 Programming environments/tools
Tools (examples) emacs (an editor) vi (an editor) g++ (a compiler) gdb (a debugger)

34 Programming environments/tools
IDE’s (integrated development environment) Consist of: editor, compiler or interpreter, debugger, linker Examples: jGrasp, Ready, Visual C++, Visual BASIC, JBuilder, and many others

35 Applications Computer games Word processors Graphics packages
Virtual reality software Web browsers Presentation Database Spreadsheet And many others.

36 Program development Our programming language is Java.
The IDE we will use is jGrasp. Editor is used to type in program text (it is not a word processor; don’t use a word processor). Compiler (syntax errors) Run/execute (semantic errors)

37 Next time Java


Download ppt "Introduction to Computers and Programming"

Similar presentations


Ads by Google