8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank...

22
8 October 2013 Birkbeck College, U. London 1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems [email protected] Autumn 2013 Week 2a: History of Computing

Transcript of 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank...

Page 1: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 1

Introduction to Computer Systems

Lecturer: Steve Maybank

Department of Computer Science and Information Systems

[email protected] 2013

Week 2a: History of Computing

Page 2: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 2

Computing Game

Tom has a game in which he pretends to be a computer…

Page 3: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 3

Equipment

A set of boxes Each box has a name: a, b, c, … Each box contains a piece of paper with a single number on it, e.g. box a contains 10

10a cb d e f g

5 12 -3 -1 111

Page 4: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 4

InstructionsTom carries out instructions such as:

Add the number in box a to the number in box c, then put the result in box c, i.e. make the result the new number in box c.

Subtract the number in box b from the number in box a. Put the result in box a.

Multiply the number in box b with the number in box c. Put the result in box d.

Page 5: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 5

Observations

The computer consists of a memory (the boxes), a device for changing the contents of the memory (Tom) and a list of instructions.

The instructions are simple and there are only a few types (so far add, subtract and multiply).

The instructions are carried out one at a time.

There is no limit to the number of instructions which are carried out (Tom never gets tired).

Page 6: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 6

Hardware for Evaluating 1+2

Brain Abacus – rods and beads Mechanical – rods and gears Electromechanical – magnets open

and close switches Vacuum tubes Transistors and integrated circuits

Page 7: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 7

Pascal’s Calculator: the Pascaline

Image from http://www.tcf.ua.edu/AZ/ITHistoryOutline.htm

Addition andsubtractiononly.

For an illuminating moving example (in French – click on GO) seehttp://therese.eveilleau.pagesperso-orange.fr/pages/truc_mat/textes/pascaline.htm#haut

Page 8: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 8

Difference Engine

Early computer for squaring numbers, and much more. Numerical results printed out in the form of tables.

Designer: Charles Babbage (1791-1871) 1821: plans for a Difference Engine. 1832: partially built by Joseph Clement. 1834: plans for a more advanced computer, the

programmable Analytical Engine. Never built. See http://en.wikipedia.org/wiki/Charles_Babbage

Page 9: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

Calculation of Squares Using Differences

x x*x 1st difference

2nd difference

0 0

1 1 1

2 4 3 2

3 9 5 2

4 16 7 2

5 25 9 2

8 October 2013 Brookshear Section 0.2 9

Page 10: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 10

Difference Engine

http://www.sciencemuseum.org.uk/images/I033/10303328.aspx

EngineconstructedfromBabbage’sdesignsby theScienceMuseum

Page 11: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 11

Lego® Version of the Difference Engine

Built byAndrew Carol

http://acarol.woz.org/difference_engine.html

Page 12: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 12

Electromechanical Computer

1st fully automatic computer.

Vol16x2.4x0.6 m3, weight 4500 Kg.

Instructions read from punched paper.

Store: 72 nums. of 23 dec. digits.

Speed: + or - 0.3 s., * 6 s., / 15.3 s.

http://en.wikipedia.org/wiki/Harvard_Mark_1

H. Aiken, 1944

Page 13: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 13

ENIAC 18,000 vacuum tubes Vol 30x2.4x0.9 m3,

Weight 27000 Kg Data input: card reader. Volatile store: twenty 10

digit decimal nos.Read only store: 100 nos.

Programming: rewire Speed: + or – 0.2 ms,

* 3 ms, / 25 ms.

http://en.wikipedia.org/wiki/ENIAC

J. Presper-Eckert and J. Mauchley

Page 14: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 14

Computing at Birkbeck 1945: Andrew Booth recruited by J.D. Bernal

to work on mathematical methods for inferring crystal structure from X-rays.

1946-: builds series of computers, Automatic Relay Computer (ARC), ARC2, SEC, …

1957: establishes Department of Numerical Automation at Birkbeck

See http://www.dcs.bbk.ac.uk/50years/50yearsofcomputing.pdf

Page 15: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 15

Computing at Birkbeck

MSc student Norman Kitzworking on the SEC (SimpleElectronic Computer) atBirkbeck (1949).

http://www.dcs.bbk.ac.uk/50years/50yearsofcomputing.pdf

Page 16: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 16

Algorithms

An algorithm is an ordered set of unambiguous executable steps that defines a terminating process.

It is implicit that something (e.g. a machine) carries out the steps.

Page 17: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 17

Informal Algorithms Directions to go from one place to

another. Cooking recipes. How to use a device (TV,

microwave, etc.) How to assemble flat pack furniture A list of instructions for Tom

Page 18: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 18

Algorithms and Computers An algorithms is converted into a list of

instructions (program) for a particular computer.

The details of the instructions vary from one computer to another

If an algorithm is programmable on one computer, then it is programmable on any computer.

Page 19: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 19

First Example of an Algorithm

Input: integers 12, 5Output: quotient q and remainder r on dividing 12

by 5Algorithm1. q = 0; r = 12;2. Subtract 5 from r; Increase q by 1;3. Subtract 5 from r; Increase q by 1;4. Output q, r;5. Halt;

Page 20: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 20

Second Example of an Algorithm

Input: strictly positive integers m, nOutput: quotient q and remainder r on dividing m

by nAlgorithm1. q = 0;2. r = m; 3. If r < n, Output q, r; Halt;4. r = r-n; 5. q = q+1; 6. go to 3;

Page 21: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 21

Third Example of an AlgorithmInput: strictly positive integers m, nOutput: quotient q and remainder r on dividing m by nAlgorithm1. q = 0;2. r = m;3. While r >= n,4. r = r-n;5. q = q+1; 6. EndWhile7. Output q, r;8. Halt;

Page 22: 8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

8 October 2013 Birkbeck College, U. London 22

Exercise

Sketch an algorithm that takes as input a strictly positive integer n and outputs an integer k such that

nn kk 12 and 2