The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124...

124
1 The Design of a Relay Computer Harry Porter, Ph.D. Portland State University April 24, 2006

Transcript of The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124...

Page 1: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

1

The Design of aRelay Computer

Harry Porter, Ph.D.Portland State University

April 24, 2006

Page 2: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

2

Page 3: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

3

+V

Page 4: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

4

Double Throw Relay

Page 5: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

5

+V

Double Throw Relay

Page 6: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

6

Four Pole, Double Throw Relay

Page 7: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

7

+V

Four Pole, Double Throw Relay

Page 8: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

8

Page 9: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

9

Schematic Diagrams

Page 10: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

10

Schematic Diagrams

Assume other terminalis connected to ground

Page 11: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

11

Schematic Diagrams

Assume other terminalis connected to ground

+V

Page 12: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

12

The “NOT” Circuit

in out

in out 0 1 1 0

in

out+V

Page 13: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

13

The “NOT” Circuit

in out

in

out+V

in out 0 1 1 0

0

1

Convention: “1” = +12V “0” = not connected

Page 14: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

14

The “NOT” Circuit

in out

in

out+V

in out 0 1 1 0

1

0

Convention: “1” = +12V “0” = not connected

Page 15: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

15

c

The “OR” Circuit

b b or c

+V

+V

b c OUT0 0 0 0 1 11 0 11 1 1

bc b or c

Page 16: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

16

An Optimization?

c

b

b or cb or cbc

Page 17: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

17

c

An Optimization?

b b or c

b

b or cc

c or dd

d

c or d

Page 18: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

18

c

An Optimization?

b b or c

b

b or cc

c or dd

d

c or d

Whoops!

Page 19: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

19

c

An Optimization?

b b or c

b

b or cc

c or dd

d

c or d

Whoops!

Page 20: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

20

An Optimization?

b or c

c

b

+V

d

c or d

b b or c

c

c or dd

Page 21: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

21

1-Bit Logic Circuit

b

c

NOT

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

AND

OR

XOR

Page 22: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

22

1-Bit Logic Circuit

b

VNOT

AND

OR

XOR

c

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 23: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

23

1-Bit Logic Circuit

b

V

c

NOT

AND

OR

XOR

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 24: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

24

1-Bit Logic Circuit

b

V

c

NOT

AND

OR

XOR

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 25: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

25

1-Bit Logic Circuit

b

V

c

NOT

AND

OR

XOR

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 26: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

26

1-Bit Logic Circuit

b

V

c

NOT

AND

OR

XOR

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 27: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

27

1-Bit Logic Circuit

b

V

c

NOT

AND

OR

XOR

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 28: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

28

1-Bit Logic Circuit

b

V

c

NOT

AND

OR

XOR

b c NOT AND OR XOR0 0 1 0 0 00 1 1 0 1 11 0 0 0 1 11 1 0 1 1 0

Page 29: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

29

AND7

OR7

Eight 1-bit circuits can be combinedto build an...

8-Bit Logic Circuit

LogicCircuit

NOT7

B7 C7

• • •

XOR7

AND1

OR1

LogicCircuit

NOT1

B1 C1

XOR1

AND0

OR0

LogicCircuit

NOT0

B0 C0

XOR0

Page 30: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

30

The “Full Adder” Circuit

CarryinCarryout FullAdder

Sum

B CCyin B C Cyout Sum

0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1

Page 31: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

31

CarryinCarryout FullAdder

Sum

B C

8 full-adders can be combined to build an...

8-Bit Adder

Page 32: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

32

8 full-adders can be combined to build an...

8-Bit Adder

CarryFullAdder

FullAdder

B0 C0

Sum0Sum1

B1 C1

FullAdder

Sum7

B7 C7

• • • 0Carry Carry

Page 33: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

33

8 full-adders can be combined to build an...

8-Bit Adder

CarryFullAdder

FullAdder

B0 C0

Sum0Sum1

B1 C1

Carry FullAdder

Sum7

B7 C7

• • •

+B 8

8

8CSumCarry

Carry0

Page 34: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

34

The Zero-Detect Circuit

ResultBus

ZeroV+

Page 35: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

35

The Zero-Detect Circuit

ResultBus

ZeroV+

Sign

Page 36: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

36

Enable Circuit

Enable

Page 37: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

37

Enable Circuit

Enable

Bus

Page 38: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

38

Enable Circuit x7 x6 x5 x4 x3 x2 x1 x0

ResultBus

B XOR C

Enable

Page 39: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

39

Enable

Shift Left Circular (SHL)b7 b6 b5 b4 b3 b2 b1 b0

ResultBus

B

Page 40: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

40

3-to-8 Decoderf0 f1 f2 OUTPUT

0 0 0 1 0 0 0 0 0 0 00 0 1 0 1 0 0 0 0 0 00 1 0 0 0 1 0 0 0 0 00 1 1 0 0 0 1 0 0 0 01 0 0 0 0 0 0 1 0 0 01 0 1 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 01 1 1 0 0 0 0 0 0 0 1

Page 41: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

41

3-to-8 Decoder

f1

Vf0

f2

f0 f1 f2 OUTPUT

0 0 0 1 0 0 0 0 0 0 00 0 1 0 1 0 0 0 0 0 00 1 0 0 0 1 0 0 0 0 00 1 1 0 0 0 1 0 0 0 01 0 0 0 0 0 0 1 0 0 01 0 1 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 01 1 1 0 0 0 0 0 0 0 1

Page 42: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

42

3-to-8 Decoder

f1

Vf0

f2

INCANDORXORNOTSHL<unused>

ADD

f0 f1 f2 OUTPUT

0 0 0 1 0 0 0 0 0 0 00 0 1 0 1 0 0 0 0 0 00 1 0 0 0 1 0 0 0 0 00 1 1 0 0 0 1 0 0 0 01 0 0 0 0 0 0 1 0 0 01 0 1 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 01 1 1 0 0 0 0 0 0 0 1

21:46

Page 43: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

43CarrySign

Arithmetic Logic Unit (ALU)B 8

8

8C

Data Bus

3

Zero

8-bitLogic

8-bitAdder

Enable En En En En EnEn

AN

D

OR

XO

R

NO

T

SHL

INC

AD

D

Function

3-to-8Decoder

Zero-Detect

Page 44: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

44

CarrySign

An 8-Bit ALU

ALU

B 8

8

8C

Result

Function Code 000 add 001 inc 010 and 011 or 100 xor 101 not 110 shl 111 <nop>

3

Zero

Page 45: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

45

Register Storage

+VA

Page 46: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

46

Register Storage

+V

• • •

A7 A0A6

Page 47: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

47

Register Storage

+V

Bus

• • •

Enable

A7 A0A6

Select

Page 48: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

48

Register Storage

A7

Select

Load A0

• • •

Enable

A6

Bus

Page 49: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

49

Register Storage

A7

Select

Load A0

• • •

Enable

A6

Bus

Page 50: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

508-Bit “Data” Bus

LoadSelect

“X” Register

8-Bit Registers

Page 51: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

518-Bit “Data” Bus

LoadSelect

LoadSelect

“X” Register “Y” Register

8-Bit Registers

Page 52: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

52

16-Bit “Address” Bus

8-Bit “Data” Bus

“X” Register “Y” Register

LoadSelect

LoadSelect

LoadSelect

Page 53: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

53

SystemArchitecture

M1

M2

X

Y

8-bi

t D

ata

Bus

A B C D

Page 54: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

54

SystemArchitecture

M1

M2

X

Y

8-bitALU

8-bi

t D

ata

Bus

Z Cy S

A B C D

Page 55: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

55

SystemArchitecture

A B C D M1

M2 M

X

Y XY

8-bitALU

8-bi

t D

ata

Bus

Z Cy S

16-b

it A

ddre

ss B

us

Page 56: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

56

SystemArchitecture

A B C D M1

M2 M

X

Y XY

8-bitALU

8-bi

t D

ata

Bus

Z Cy S

Inst

PC

16-b

it A

ddre

ss B

us

Page 57: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

57

SystemArchitecture

M1

M2 M

X

Y XY

8-bitALU

8-bi

t D

ata

Bus

Z Cy S

Inst

PC

Memory

AddrData

A B C D

16-b

it A

ddre

ss B

us

Page 58: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

58

SystemArchitecture

M1

M2 M

X

Y XY

8-bitALU

8-bi

t D

ata

Bus

Z Cy S

Inst

PC

Memory

AddrData

16-bitIncrement

Inc

A B C D

16-b

it A

ddre

ss B

us

Page 59: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

59

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

SystemArchitecture

8-bi

t D

ata

Bus

A B C D

16-b

it A

ddre

ss B

us

Page 60: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

60

32K Byte Static RAM Chip

LEDs

8 FET Power Transistors(to drive relays during

a memory-read operation)

Page 61: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

61

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

16-b

it A

ddre

ss B

us Example:The ALU

Instruction

Page 62: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

62

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 1:Fetch Instruction

16-b

it A

ddre

ss B

us

Page 63: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

63

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 1:Fetch Instruction

SELECT 16-b

it A

ddre

ss B

us

Page 64: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

64

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 1:Fetch Instruction

SELECT 16-b

it A

ddre

ss B

us

Page 65: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

65

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 1:Fetch Instruction

MEM-READ

PC

SELECT 16-b

it A

ddre

ss B

us

Page 66: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

66

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 1:Fetch Instruction

MEM-READ

PC

SELECT 16-b

it A

ddre

ss B

us

Page 67: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

67

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 1:Fetch Instruction

MEM-READ

PC

SELECT

LOAD16

-bit

Add

ress

Bus

Page 68: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

68

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

Step 1:Fetch Instruction

8-bi

t D

ata

Bus

A B C D

MEM-READSELECT

LOAD16

-bit

Add

ress

Bus

Page 69: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

69

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 2:Increment PC

16-b

it A

ddre

ss B

us

Page 70: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

70

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 2:Increment PC

SELECT 16-b

it A

ddre

ss B

us

Page 71: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

71

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 2:Increment PC

SELECT 16-b

it A

ddre

ss B

us

Page 72: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

72

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 2:Increment PC

SELECT

LOAD

16-b

it A

ddre

ss B

us

Page 73: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

73

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 2:Increment PC

SELECT

LOAD 16-bitIncrement

16-b

it A

ddre

ss B

us

Page 74: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

74

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

Step 3:Update PC

16-b

it A

ddre

ss B

us

Page 75: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

75

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

SELECT

Step 3:Update PC

16-b

it A

ddre

ss B

us

Page 76: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

76

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

SELECT

Step 3:Update PC

16-b

it A

ddre

ss B

us

Page 77: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

77

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

LOAD

SELECT

Step 3:Update PC

16-b

it A

ddre

ss B

us

Page 78: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

78

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

8-bitALU

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A B C D

LOAD

SELECT

Step 3:Update PC

16-b

it A

ddre

ss B

us

Page 79: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

79

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A

D

Step 4:Execute Instruction

B C

8-bitALU

16-b

it A

ddre

ss B

us

Page 80: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

80

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A

D

Step 4:Execute Instruction

FUNCTION

B C

8-bitALU

16-b

it A

ddre

ss B

us

Page 81: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

81

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A

D

Step 4:Execute Instruction

FUNCTION

B C

8-bitALU

16-b

it A

ddre

ss B

us

Page 82: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

82

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A

D

Step 4:Execute Instruction

FUNCTION

B C

8-bitALU

16-b

it A

ddre

ss B

us

Page 83: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

83

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A

D

Step 4:Execute Instruction

FUNCTION

LOAD

LOAD

B C

8-bitALU

16-b

it A

ddre

ss B

us

Page 84: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

84

16-bitIncrement

Inst

M1

M2 M

X

Y XY

J1 J2

J

PC

Inc

Memory

AddrData

Z Cy S

8-bi

t D

ata

Bus

A

D

Step 4:Execute Instruction

FUNCTION

LOAD

LOAD

B C

8-bitALU

16-b

it A

ddre

ss B

us

21:46

Page 85: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

85

Clock

Switch

+V Output

+V

Page 86: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

86

Clock

Switch

+V Output

+V

Charging

Page 87: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

87

Clock

Switch

+V Output

+V

Discharging

Page 88: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

88

Clock

Switch

+V Output

+V

Page 89: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

89

+V +V

Clock

+V +V

A B C D

Page 90: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

90

+V +V

Clock

Charging

+V +VOnOn

Discharging

A B C D

Page 91: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

91

+V +V

Clock

Charging

+V +VOn

Discharging

On

A B C D

Page 92: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

92

+V +V

Clock

Charging

+V +VOn

Discharging

On

A B C D

Page 93: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

93

+V +V

Clock

Charging

+V +VOn

Discharging

On

A B C D

Page 94: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

94

+V +V

Clock

Charging

+V +VOn

Discharging

On

A B C D

Page 95: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

95

Clock Timing Diagram

A

B

C

D

Page 96: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

96

Clock Timing Diagram

A

B

C

D

Clock

Page 97: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

97

Clock Timing Diagram

A

B

C

D

Clock

Clock = (A and B) or (C and D)

Page 98: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

98

Finite State Machine

1 2 3 4 5 6 7 8

clock

Page 99: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

99

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 100: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

100

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 101: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

101

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 102: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

102

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 103: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

103

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 104: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

104

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 105: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

105

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 106: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

106

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 107: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

107

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 108: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

108

t7t5t4t3t2t1

Finite State Machine

1 2 3 4 5 6 7 8

t6 t8

Outputs

clock

Page 109: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

109

Output from FSA2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 31

t1

t2

t3

t4

t5

t6

t7

t8

Page 110: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

110

Instruction Timing - ALU Instruction

Select PCMemory Read

Load InstrLoad Inc

Select Inc Load PC

ALU FunctionLoad A

Load Cond.Code Reg.

2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 31

Page 111: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

111

Instruction Timing - ALU Instruction

Select PCMemory Read

Load InstrLoad Inc

Select Inc Load PC

ALU Function

Load Cond.Code Reg.

2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 31

Fetch

Load A

Page 112: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

112

Instruction Timing - ALU Instruction

Select PCMemory Read

Load InstrLoad Inc

Select Inc Load PC

ALU Function

Load Cond.Code Reg.

2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 31

Increment

Load A

Page 113: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

113

Instruction Timing - ALU Instruction

Select PCMemory Read

Load InstrLoad Inc

Select Inc Load PC

ALU Function

Load Cond.Code Reg.

2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 31

Load A

Execute

Page 114: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

114

Instruction Decoding

Instruction RegisterFinite State Machine

Control Signals(Load, Select, Mem-Read, etc.)

1 2 3 4 5 6 • • • 7 6 5 4 3 2 1 0

Page 115: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

115

Instruction Decoding

Instruction RegisterFinite State Machine

Control Signals(Load, Select, Mem-Read, etc.)

CombinationalLogic

1 2 3 4 5 6 • • • 7 6 5 4 3 2 1 0

Page 116: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

116

1 2 3 4 5 6 7 8 9 10

Instruction Timing - 16-bit Move

Select PCMemory Read

Load InstrLoad Inc

Select Inc Load PC

Select Source-Register

2 3 4 5 6 7 8 11

Load Dest-Register

(Same asbefore)

Page 117: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

117

Finite State Machine

1 2 3 4 5 6 7

9 11 13 15 16

17 18 19 20 21 22 23

10 12 14

24

8

Page 118: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

118

Finite State Machine

1 2 3 4 5 6 7

9 11 13 15 16

17 18 19 20 21 22 23

10 12 14

24

8

Page 119: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

119

Instruction Decoding and Control

Clock

InstructionRegister

Finite StateMachine

Control Lines

Instruction Decoding

Dat

a Bu

s

Page 120: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

120

The Instruction Set (1)

0 0 d d d s s s

1 0 0 0 r f f f

0 1 r d d d d d

1 0 1 1 0 0 0 0

Move

ALU

Load Immediate

16-bit Increment

ddd = destination registersss = source register (A, B, C, D, M1 ,M2 ,X or Y)

r = destination register (A or D)fff = function code (add, inc, and, or, xor, not, shl)

r = destination register (A or B)ddddd = value (-16..15)

XY ← XY + 1

Page 121: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

121

The Instruction Set (2)

1 0 0 1 0 0 r r

1 0 0 1 1 0 r r

1 1 0 0 0 0 0 0

1 0 1 0 1 1 1 0

Load

Store

Load 16-bit Immediate

Halt

rr = destination register (A, B, C, D)reg ← [M]

rr = source register (A, B, C, D)[M] ← reg

Load the immediate value into M (i.e., M1 and M2)

v v v v v v v v v v v v v v v v

Page 122: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

122

The Instruction Set (3)

1 1 1 0 0 1 1 0

1 0 1 0 d s s 0

1 0 1 0 1 0 1 0

Goto

Call

16-Bit Move

Return / Branch Indirect

a a a a a a a a a a a a a a a a

Branch to the given address

1 1 1 0 0 1 1 1 a a a a a a a a a a a a a a a a

Branch to the given addressSave return location in XY register

PC ← XY

d = destination register (PC or XY)ss = source register (M, XY or J)

Page 123: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

123

The Instruction Set (4)

1 1 1 1 0 0 0 0

Branch If Negative

Branch If Carry

Branch If Zero

Branch If Not Zero

a a a a a a a a a a a a a a a a

Branch to the given address if S = 1

1 1 1 0 1 0 0 0 a a a a a a a a a a a a a a a a

Branch to the given address if Cy = 1

Branch to the given address if Z = 1

Branch to the given address if Z = 0

1 1 1 0 0 1 0 0 a a a a a a a a a a a a a a a a

1 1 1 0 0 0 1 0 a a a a a a a a a a a a a a a a

Page 124: The Design of a Relay Computer - Computer Action Teamweb.cecs.pdx.edu/~harry/Relay/RelayTalk.pdf124 An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ←

124

An Example Program address instr assembly comment 0000 0000 0011 1001 Y=B Y ← B 0000 0001 0011 0110 X=0 X ← 0 0000 0010 1000 0101 A=¬B If sign(Y)==1 0000 0011 1111 0000 BNEG Else . 0000 0100 0000 0000 . . 0000 0101 0000 0111 . . 0000 0110 0011 0010 X=C X ← C Else: . 0000 0111 0101 1001 A=-7 D ← -7 0000 1000 0001 1000 D=A . Loop: Loop: 0000 1001 0000 1110 B=X Shift X left (circular) 0000 1010 1000 0110 A=B<<1 . 0000 1011 0011 0000 X=A . 0000 1100 0000 1111 B=Y Shift Y left (circular) 0000 1101 1000 0110 A=B<<1 . 0000 1110 0011 1000 Y=A . 0000 1111 0000 1111 B=Y If sign(Y)==1 0001 0000 1000 0101 A=¬B . 0001 0001 1111 0000 BNEG Else2 . 0001 0010 0000 0000 . . 0001 0011 0001 0111 . . 0001 0100 0000 1110 B=X X ← X + C 0001 0101 1000 0000 A=B+C . 0001 0110 0011 0000 X=A . Else2: . 0001 0111 0000 1011 B=D D ← D + 1 0001 1000 1000 1001 D=B+1 . 0001 1001 1110 0010 BNZ Loop If D != 0 goto Loop 0001 1010 0000 0000 . . 0001 1011 0000 1001 . . 0001 1100 1010 1110 HALT HALT