Introduction to Computing - McGill School Of Computer Science

Download Report

Transcript Introduction to Computing - McGill School Of Computer Science

Computer Structure
Nathan Friedman
Fall, 2006
Fall, 2006
Computer Strtucture
1
A Brief History
The Abacus is
considered to be the
first mechanical
computing device
Fall, 2006
Computer Strtucture
2
Mechanical Calculators




1612 – John Napier used floating point
arithmetic and invented the logarithm
1622 – William Oughtred created the slide
rule based on Napier’s logarithms. This was
the primary calculator used by engineers until
the 1960’s
1642 – Blaise Pascal created a machine that
could add and subtract, automatically
carrying numbers
1673 – Gottfried Leibnitz built a calculator
that could multiply as well
Fall, 2006
Computer Strtucture
3
Mechanical Calculators

1612 – John Napier used floating point
arithmetic and invented the logarithm
Fall, 2006
Computer Strtucture
4
Mechanical Calculators


1612 – John Napier used floating point
arithmetic and invented the logarithm
1622 – William Oughtred created the
slide rule based on Napier’s logarithms.
This was the primary calculator used by
engineers until the 1960’s
Fall, 2006
Computer Strtucture
5
Mechanical Calculators



1612 – John Napier used floating point
arithmetic and invented the logarithm
1622 – William Oughtred created the slide
rule based on Napier’s logarithms. This was
the primary calculator used by engineers until
the 1960’s
1642 – Blaise Pascal created a machine that
could add and subtract, automatically
carrying numbers
Fall, 2006
Computer Strtucture
6
The Pascaline -- 1642
Fall, 2006
Computer Strtucture
7
Mechanical Calculators




1612 – John Napier used floating point
arithmetic and invented the logarithm
1622 – William Oughtred created the slide
rule based on Napier’s logarithms. This was
the primary calculator used by engineers until
the 1960’s
1642 – Blaise Pascal created a machine that
could add and subtract, automatically
carrying numbers
1673 – Gottfried Leibnitz built a calculator
that could multiply as well
Fall, 2006
Computer Strtucture
8
The Industrial Age
Joseph-Marie Jacquard
invented an
automatic loom
using punched cards
to control patterns
in the fabrics.
(Leading to riots
against replacing
people by
machines.)
Fall, 2006
Computer Strtucture
9
Charles Babbage



1822 – Charles Babbage designed the
Difference Engine for comuputing
navigational tables
1833 – Designed the Analytical Engine
that had the basic components used in
a modern computer
1847-1849 – Work on Difference
Machine but technology too primitive to
build it. In 1991 the Science Museum in
London built it
Fall, 2006
Computer Strtucture
10
The World’s First Programmer
Ada Augusta King,
Countess of Loveless
adds notes and
documentation on
Analytical Engine.
She writes first
program.
Fall, 2006
Computer Strtucture
11
The Difference Engine
Fall, 2006
Computer Strtucture
12
Herman Hollerith


1890 Hollerith won
competition for
developing data
processing equipment for
the US Census
Founded Hollerith
Tabulating Company that
became IBM in 1924
Fall, 2006
Computer Strtucture
13
Early Modern Machines


1935-38 Konrad Zuse developed Z-1
and Z-2 computers using binary
arithmetic
1936-39 John Vincent Atanasoff and
John Berry built ABC computer for
solving linear systems in Physics.
Introduced ALU and rewriting memory.
Fall, 2006
Computer Strtucture
14
Early Modern Machines


1943 Alan Turing built Colossus used to break
German codes encrypted using ENIGMA machine
1944 – Harvard Mark 1 used to compute artillery and
navigation tables
Fall, 2006
Computer Strtucture
15
The First Computer Bug

1945 Grace Murray
Hopper found bug
killed in jaws of
electromechanical
relay on Mark II
computer at Harvard
Fall, 2006
Computer Strtucture
16
ENIAC
The First Electronic Computer


1943 Work started on ENIAC at
University of Pennsylvania under John
Mauchly and J. Presper Eckert with
Herman Goldstein
A general purpose computer used for
computing artillery tables
Fall, 2006
Computer Strtucture
17
ENIAC




Fall, 2006
Used 18,000
vacuum tubes
U shaped, 25m long,
2.5m high, 1m wide
Programmed by
plugging cables and
setting switches
From 1 hour to 1
day to program
Computer Strtucture
18
Von Neumann Computer



1944 – John von Neumann joined
ENIAC team.
Credited with the idea of storing
programs as numbers
1945 – von Neumann proposed a stored
program computer called EDVAC
Fall, 2006
Computer Strtucture
19
The Late 1940’s



1947 – William Shockley, John Bardeen,
Walter Brattain invent the transistor
1949 – Maurice Wilkes at Cambridge
developed EDSAC, the first large scale,
fully operational stored program
computer
1951 – Remington-Rand sold Univac 1
to US government for $1,000,000
Fall, 2006
Computer Strtucture
20
The 1950’s




IBM produces series of compters with
Jean Amdahl as chief architiect
Memory upgraded to magnetic core
memory, magnetic tapes and disks with
movable read/write heads
1957 – Fortran introduced
1958 – Integrated Circuit invented
Fall, 2006
Computer Strtucture
21
The 1960’s




1963 – ASCII code introduced
1965 – IBM/360 introduced using
integrated circuits
1965 – DEC introduced PDP-8, first
minicomputer
1969 – Work began on ARPAnet (the
predecessor of the internet)
Fall, 2006
Computer Strtucture
22
The Early 1970’s




1971 – Intel 4004 the first microprocessor
and the first floppy disk introduced
1973 – Xerox invents Ethernet
1775 – First PC, MITS Altair 8800 (no
keyboard, no display, no auxilliary storage)
Bill Gates and Paul Allen wrote a BASIC
compiler for the Altair, their first product
Fall, 2006
Computer Strtucture
23
The Later 1970’s


1976 – Steve Jobs and Steve Wozniak
develop Apple I in their parent’s garage
1976 – Cray-1, first supercomputer
announced
Fall, 2006
Computer Strtucture
24
IBM PC



1981 – IBM enters
market with IBM PC
based on Intel 8088
chip
Release of Microsoft
DOS for the PC
1982 Computer
chosen by Time
Magazine as “Man of
the Year”
Fall, 2006
Computer Strtucture
25
Apple Macintosh

Fall, 2006
1984 – Macintosh
introduced, based
on Xerox Alto. The
icon and mouse
became the main
tools for interacting
with computers
Computer Strtucture
26
Computer Architecture
At the lowest level a computer is just a
collection of switches that can be on or
off (representing 1 and 0).
The circuitry is organized into
components that serve different
functions such decoding bit sequences,
carrying out simple arithmetic
operations, etc.
Fall, 2006
Computer Strtucture
27
Von Neumann Machines
Modern computers are called Von
Neumann Machines
John Von Neumann is credited with the
idea that programs can be encoded and
stored in the memory just like data
A control unit transfers instructions from
the memory into registers so that a
processing unit can execute them
Fall, 2006
Computer Strtucture
28
The 5 Classic Components
Computer
CPU
Fall, 2006
Memory
Control
Input
Devices
Registers
Output
Devices
Computer Strtucture
29
The Intel Pentium Processor
Schematic Layout
Branch
Control
Data
cache
Bus
Instruction
cache
Fall, 2006
Integer
datapath
Floatingpoint
datapath
Computer Strtucture
30
The Von Neumann Model



Programs and data are both stored in
the main memory of the machine
There is one CPU (Central Processing
Unit)
The CPU has a control unit that fetches
program instructions from memory,
decodes them and executes them
Fall, 2006
Computer Strtucture
31
The Von Neumann Model



Data is loaded from memory into
registers in the CPU
The CPU contains circuitry to perform
basic arithmetic operations and to
compare values, placing the results into
registers
The values in the registers can be
stored in main memory
Fall, 2006
Computer Strtucture
32
Input / Ouput
Keyboard
Printer
Output
Input
PDA
PDA
Mouse
Digitizing pad
Scanner
Those are only the ones I came up with when
I wrote this slide…Computer Strtucture
Fall, 2006
33
The Von Neumann Model


Input devices (keyboard, pda, cell
phone, . . .) allow us to place data (and
programs) into memory
Output devices allow us to display
values stored in memory (on screen,
pda, cell phone, . . .)
Fall, 2006
Computer Strtucture
34
Low Level Programming
Programmers in the late 1940’s had to use binary
numbers to encode the instructions and the data
This was very time consuming and error prone so
written mnemonic codes were created. Programs
were written using these codes and then
translated into binary by hand
Soon programs were written to convert these
symbols to binary. These programs are called
assemblers and the instruction names are called
assembly language
Fall, 2006
Computer Strtucture
35
Assembler Example
We may want to evaluate the expression
f = (g + h) – (i + j)
Assembly program (where all the names refer
to registers)
add t0, g, h
add t1, i, j
sub f, t0, t1
Load and Store instructions are part of the
assembly language and allow transferring
data values between memory and registers
Fall, 2006
Computer Strtucture
36
Assembly Language



Low level langauage
Simple instructions of the form
op result, arg1, arg2
Machine dependent – each
processor has its own assembler
Fall, 2006
Computer Strtucture
37
High Level Languages
Programming in assembly language is still
difficult and tedious
Programs are very specific to specific
machines
High level languages provide a more
natural mathematically based formalism
for expressing algorithms
Fall, 2006
Computer Strtucture
38
High Level Languages
High level languages
 Hide details of memory allocation
 Allow expressing complex operations
together, not just one step at a time
 Provide a more natural way of
programming
 Allow programs to be ported from one
machine to another
Fall, 2006
Computer Strtucture
39
High Level Languages
These languages make it easier to write
programs but they are still very formal,
precisely structure languages that
follow very specific syntax rules
In addition to learning how to formulate
algorithms for the computer, we will
have to learn the rules for these
languages
Fall, 2006
Computer Strtucture
40
How Does This Work




Programs written in a high level
language are translated into
assembly/machine level programs
A program called a compiler does this
translation
This program is stored in memory by a
loader
We can then execute the program
Fall, 2006
Computer Strtucture
41
The Translation Process
source program
compiler
assembly program
linker/loader
native code
Fall, 2006
Computer Strtucture
42
Source Program



A program written in a high level
language (FORTRAN, C, Java, C++,
Ada)
Created with a text editor in human
readable form
File name extension often says what
language is used (a1.f90, a4.c,
test.java)
Fall, 2006
Computer Strtucture
43
Compiler



A program that analyses the source
program and translates it into a form
the computer can understand
Result is not readable by humans
Each high level language requires its
own compiler
Fall, 2006
Computer Strtucture
44
Linker/Loader


The Linker combines the assembler
code with other programs that were
compiled another time or are standard
programs available in libraries (sin, sqrt,
etc)
The Loader puts the complete program
in memory and begins execution with
the first instruction
Fall, 2006
Computer Strtucture
45
Coming Up Next


In our next lecture we begin to look at
a high level language, FORTRAN
We will begin writing actual programs
Fall, 2006
Computer Strtucture
46