CSCI 161: Introduction to Programming Lecture 2: computer History and Language Basics
Computer and Programming Basics A computer is an electronic device that can perform certain tasks. Hardware architecture: CPU, Memory, IO, Secondary Storage; Software (Computer programs) give instructions to computers to perform the tasks. Computers use binary system, meaning that they essentially only understand 1 and 0. Low Level Programming language High level language: C Language is an example. Programs written in C has to be compiled to machine language so that computer can understand. IDE: CodeBlock
A brief History of Computers https://www.youtube.com/watch?v=VPDy2y4AjSo
History of Computers Modern computers result from 2 streams of evolution Mechanization of arithmetic calculating machines (hardware) Concept of stored programs process control (software)
Mechanization 1 The abacus Blaise Pascal (1623-1662) used by the Chinese 3 to 4 thousand years ago Blaise Pascal (1623-1662) 1642 - Pascal’s Adder 1st mechanized adding machine gears and wheels add and subtract, calculate taxes inaccurate
Mechanization 2 Gottfried Wilhelm von Liebniz (1646-1716) 1670’s - Liebniz calculator similar to Pascal’s design add, subtract, multiply, divide more reliable and accurate still inaccurate he also invented calculus
Stored Program 1 Joseph Marie Jacquard (1752-1834) 1800 - Jacquard’s Loom weaving loom metal punch cards to position threads for the weaving process within the decade, 11,000 used in France may have been 1st case of unemployment caused by automation
Stored Program 2 Herman Hollerith (1860-1929) designed a machine that used electric charges to read info off of punch cards for use in 1890 US census store and process census data on punched cards started his own company in 1896 in 1924 that company became International Business Machines Corporation or IBM
Charles Babbage (1792-1871) 1830-71 - Analytical Engine 1822-33 - Difference Engine compute polynomials for math tables abandoned, wasn’t precise 1830-71 - Analytical Engine designed but never completed, ahead of its time Mill - arithmetic computations Store - store data and results Operation cards - program instructions Variable cards - select memory location for ops Output - printer or punch cards
First Computers 1944 - Mark I John Atanasoff and 1939-42 - ABC John Atanasoff and Clifford Berry (Iowa State) small scale - 300 vacum tubes 1944 - Mark I electromechanical computer Howard Aiken (Harvard U.) first real analytical engine based on relays
ENIAC - 1946 Electronic Numerical Integrator and Calculator Best known as first fully electronic computer 18,000 vacuum tubes 1,500 relays 20 x 40 foot room low reliability, lots of power, air conditioning Grace Hopper debugging it
von Neumann Architecture 1946 - John von Neumann (Princeton) Developed stored program concept both programs and data stored in same memory Fetch decode cycle Modern computers said to use von Neumann architecture
First programmer: Ada Agusta Daughter of Lord Byron Wrote about analytical engine Designed several programs for it Known as the first programmer 1970’s Dept. of Defence named its programming language Ada
Computer Generations 1st Generation - before 1960 vacuum tubes and relays ENIAC 2nd Generation - 1958 - 65 transistors IBM 7090 3rd Generation - 1964 - 80 integrated circuits or chips IBM 360 4th Generation - after 1980 large-scale integration - microprocessors
Review Questions What two streams do modern computer evolve from? The name of the first fully electronic computer What architecture do modern computers use?
Programming
High Level Languages 1842 - Ada Agusta - analytical engine 1957 - John Backus - FORTRAN 1958, 60, 64 - ALGOL, COBOL, BASIC 1970 - US Dept. of Defence - Ada 1971 - Nicklaus Wirth - Pascal 1972 - Dennis Ritchie - C 1977 - Nicklaus Wirth - Modula-2 1989 - ANSI C adopted Java, Python ….
Software Development Early computers - complex coding schemes machine language - 0’s and 1’s Later on - introduction of system software assembly language - mnemonics for operations assembly program assembler machine lang Even later - compilers created high-level languages (HLL) - natural language HLL program compiler machine language
HLL to Machine Language Enter HLL program into file using editor program.cpp - source file Translate source code to machine code program.obj - object file Combine object code with libraries program.exe - executable file
IDE Integrated Development Environment Note combines editor, compiler, linker, loader usually includes tools to assist in debugging Note IDE’s usually do not write to disk automatically must remember to save work to disk often, especially before executing a program
First Program //library inclusion //function “main” //display string #include <iostream> using namespace std; int main() { cout << ”Hello world.”; return 0; } //library inclusion //function “main” //display string
Programming Errors Vocabulary and grammar - syntax Rules determine if statement legally constructed - syntax rules Compiler checks rules - gives syntax errors Programs also contain errors in logic - bugs Debugging - finding & fixing logic errors
A program to output the sum of two numbers