a relay 1early history. vacuum tubes 2early history

25
A rela y 1 Early history

Upload: madelyn-wyant

Post on 29-Mar-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A relay 1Early history. Vacuum tubes 2Early history

Early history 1

A relay

Page 2: A relay 1Early history. Vacuum tubes 2Early history

Early history 2

Vacuum tubes

Page 3: A relay 1Early history. Vacuum tubes 2Early history

3

ENIAC: 17, 468 vacuum tubes, 70,000 resistors, 10,000 capacitors, 1,500 relays, 6,000 manual switches, 5 million hand-soldered joints … Not a stored program computer. 1946.

Page 4: A relay 1Early history. Vacuum tubes 2Early history

4

EDSAC (Electronic Delay Storage Automatic Calculator): University of Cambridge Mathematical Laboratory, England, 1949.

1 K 18-bit words of memory, in mercury delay tubes.

First practical stored-program computer. Subroutines were used! (The word “compiler” originated here.)

Page 5: A relay 1Early history. Vacuum tubes 2Early history

Early history 5A magnetic drum at work

Page 6: A relay 1Early history. Vacuum tubes 2Early history

6A magnetic drum with opened cover

Page 7: A relay 1Early history. Vacuum tubes 2Early history

Early history 7

Core memory: 1 ferrite core = 1 bit

Page 8: A relay 1Early history. Vacuum tubes 2Early history

Early history 8

Page 9: A relay 1Early history. Vacuum tubes 2Early history

Early history 9

Page 10: A relay 1Early history. Vacuum tubes 2Early history

Early history 10

An IBM 7090 computer

Page 11: A relay 1Early history. Vacuum tubes 2Early history

Early history 11The control panel of an IBM 360 computer

Page 12: A relay 1Early history. Vacuum tubes 2Early history

Early history 12

Inside the CPU there are three registers:• The instruction register: IR (20 bits, i.e., one word)• The instruction counter: IC (16 bits, i.e., an address)• The accumulator: A (20 bits, i.e., one word)

A program is composed of one-word instructions.The instruction counter (IC) holds the address of the next instruction to be executed.The instruction register (IR) holds the instruction that is being executed. Here is the format of an instruction:

opcode operand 4 bits 16 bits

Page 13: A relay 1Early history. Vacuum tubes 2Early history

Early history 13

The CPU cycle:

The processor performs a very simple sequence of actions, over and over again:1. Load the word at address IC into IR: IR := m[ IC ].2. Increment IC: IC := IC + 1.3. Perform the action prescribed by the instruction in IR.4. Repeat from step 1 (unless it was a halt instruction)

Page 14: A relay 1Early history. Vacuum tubes 2Early history

Early history 14

0 HLT a HALT the machine, after loading MA with a.1 STO a STORE the accumulator: m[ a ] := A .2 LOA a LOAD into the accumulator: A := m[ a ] .3 AND a Bitwise AND: A := A bit_and m[ a ] .4 OR a Bitwise OR: A := A bit_or m[ a ] .5 XOR a Bitwise exclusive OR: A := A bit_xor m[ a ] .6 LSH a Logical SHift (right if a positive, left otherwise)7 ASH a Arithmetic Shift (with sign-extension)8 ADD a ADD: A := A + m[ A ]9 SUB a SUBTRACT: A := A – m[ A ]A JMP a JUMP: IC := aB JMZ a JUMP on Zero: if A = 0 then IC := a fiC JMN a JUMP on Negative: if A < 0 then IC := a fiD CAL a subroutine CALL: m[ a ] := IC; IC := a + 1E RET a subroutine RETURN: IC := m[ a ]F DEV i DEVICE operation

Page 15: A relay 1Early history. Vacuum tubes 2Early history

Early history 15

0 HLT a1 STO a2 LOA a3 AND a4 OR a5 XOR a6 LSH i7 ASH i8 ADD a9 SUB aA JMP aB JMZ aC JMN aDEF

;; Add a sequence of integers that ends with zero.;; Leave the result in the accumulator.

LOA DATA ; the next integerJMZ DONE ; if zero then end of dataADD SUM ; add to the running sum …STO SUM ; and save it…

DONE LOA SUM ; result to accumulatorHLT 0

;SUM LIT 0 ; the sum so far;DATA …

LIT 0 ; end of dataEND

Page 16: A relay 1Early history. Vacuum tubes 2Early history

Early history 16

0 HLT a1 STO a2 LOA a3 AND a4 OR a5 XOR a6 LSH i7 ASH i8 ADD a9 SUB aA JMP aB JMZ aC JMN aDEF

;; Add a sequence of integers that ends with zero.;; Leave the result in the accumulator.LOOP LOA DATA ; the next integer

JMZ DONE ; if zero then end of dataADD SUM ; add to the running sum …STO SUM ; and save itJMP LOOP

;DONE LOA SUM ; result to accumulator

HLT 0;SUM LIT 0 ; the sum so far;DATA …

LIT 0 ; end of dataEND

It is now time to add the next integer. But just adding the green instruction will not do the trick. Why?

Page 17: A relay 1Early history. Vacuum tubes 2Early history

Early history 17

0 HLT a1 STO a2 LOA a3 AND a4 OR a5 XOR a6 LSH i7 ASH i8 ADD a9 SUB aA JMP aB JMZ aC JMN aDEF

;; Add a sequence of integers that ends with zero.;; Leave the result in the accumulator.LOOP LOA DATA ; the next integer

JMZ DONE ; if zero then end of dataADD SUM ; add to the running sum …STO SUM ; and save itLOA LOOP ; prepare for the next integer:ADD ONE ; increment the operandSTO LOOP ; of the first LOA instructionJMP LOOP ; iterate

;DONE LOA SUM ; result to accumulator

HLT 0;SUM LIT 0 ; the sum so farONE LIT 1 ; the constant 1;DATA …

LIT 0 ; end of dataEND

Page 18: A relay 1Early history. Vacuum tubes 2Early history

Early history 18

The ability to perform automodification was considered a great advantage of the “von Neuman” machine.

That is, the “stored program” computer.

Arthur W. (Arthur Walter) Burks, Herman Heine Goldstine, John Von Neumann; Preliminary Discussion of the Logical Design of an Electronic Computer Instrument; (Institute for Advanced Study, January 1, 1946) ASIN B0007HW8WE

+ earlier ideas of Alan Turing, Prosper Eckert, John Mauchly …

Page 19: A relay 1Early history. Vacuum tubes 2Early history

Early history 19

The ability to perform automodification was considered a great advantage of the “von Neuman” machine. With experience, and as progress made more registers affordable, we came to a very different conclusion. There were even some machines that made it almost impossible to modify the code memory (e.g., PDP 11/70).

What are the advantages of that?

Page 20: A relay 1Early history. Vacuum tubes 2Early history

Early history 20

The ability to perform automodification was considered a great advantage of the “von Neuman” machine. With experience, and as progress made more registers affordable, we came to a very different conclusion. There were even some machines that made it almost impossible to modify the code memory (e.g., PDP 11/70).

What are the advantages of that?

Why “almost” ?

Page 21: A relay 1Early history. Vacuum tubes 2Early history

Early history 21

While the idea of automodification of programs fell into disfavour relatively quickly, it took some time before there was any hardware support for a stack.

The subroutine calling sequence of the A1 was typical. So recursion was quite expensive, and considered an exotic luxury.

Page 22: A relay 1Early history. Vacuum tubes 2Early history

Early history 22

While the idea of automodification of programs fell into disfavour relatively quickly, it took some time before there was any hardware support for a stack.

The subroutine calling sequence of the A1 was typical. So recursion was quite expensive, and considered an exotic luxury.

This might seem strange to us now, but in those days machines were so incredibly expensive (and slow) that making efficient use of the computer was the highest priority.

Page 23: A relay 1Early history. Vacuum tubes 2Early history

Early history 23

;; GCD in A1:

BSS 2 ; argumentsGCD BSS 1 ; the entry point

STO GCD – 1 ; store the first argumentGCD_LOOP LOA GCD – 1 ; A

SUB GCD – 2 ; BJMZ GCD_EXIT ; A = B ?JMN GCD_LT ; A < BSTO GCD – 1 ; A <- A – B JMP GCD_LOOP ; iterate

;GCD_LT LOA GCD – 2 ; B

SUB GCD – 1 ; B – A STO GCD – 2 ; B <- B – AJMP GCD_LOOP ; iterate

;GCD_EXIT LOA GCD – 1 ; result

RET GCD ; return

Page 24: A relay 1Early history. Vacuum tubes 2Early history

Early history 24

C GCD IN FORTRAN II: 1 IF ( A – B ) 5, 9, 2 2 A = A – B

GOTO 1 5 B = B – A

GOTO 1 9 GCD = A

RETURNEND

A Hollerith card

IBM 029 card punch 19th century punch

Page 25: A relay 1Early history. Vacuum tubes 2Early history

Early history 25

C GCD IN FORTRAN II 1 IF ( A – B ) 5, 9, 2 2 A = A – B

GOTO 1 5 B = B – A

GOTO 1 9 GCD = A

RETURNEND

C GCD IN FORTRAN IV 1 IF ( A .EQ. B ) GOTO 9

IF ( A .LT. B ) GOTO 2A = A – B GO TO 1

2 B = B – A GOTO 1

9 GCD = ARETURNEND