Harry Porters Relay Computer Harry Porter, Ph.D. Portland State - - PowerPoint PPT Presentation

harry porter s relay computer
SMART_READER_LITE
LIVE PREVIEW

Harry Porters Relay Computer Harry Porter, Ph.D. Portland State - - PowerPoint PPT Presentation

Slides to Accompany a Video Tutorial on Harry Porters Relay Computer Harry Porter, Ph.D. Portland State University November 7, 2007 +V Double Throw Relay Double Throw Relay +V Four Pole, Double Throw Relay Four Pole, Double Throw


slide-1
SLIDE 1

Slides to Accompany a Video Tutorial on

Harry Porter’s Relay Computer

Harry Porter, Ph.D.

Portland State University November 7, 2007

slide-2
SLIDE 2

+V

slide-3
SLIDE 3

Double Throw Relay

slide-4
SLIDE 4

+V

Double Throw Relay

slide-5
SLIDE 5

Four Pole, Double Throw Relay

slide-6
SLIDE 6

+V

Four Pole, Double Throw Relay

slide-7
SLIDE 7
slide-8
SLIDE 8

Schematic Diagrams

Assume other terminal is connected to ground

slide-9
SLIDE 9

Schematic Diagrams

Assume other terminal is connected to ground +V

slide-10
SLIDE 10

The “NOT” Circuit

in

  • ut

in

  • ut

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

slide-11
SLIDE 11

The “NOT” Circuit

in

  • ut

in

  • ut

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

slide-12
SLIDE 12

c

The “OR” Circuit

b b or c +V +V

b c OUT 0 0 0 0 1 1 1 0 1 1 1 1

b c b or c

slide-13
SLIDE 13

An Optimization?

c b b or c b or c b c

slide-14
SLIDE 14

c

An Optimization?

b b or c b b or c c c or d d d c or d

slide-15
SLIDE 15

c

An Optimization?

b b or c b b or c c c or d d d c or d

Whoops!

slide-16
SLIDE 16

An Optimization?

b or c c b +V d c or d b b or c c c or d d

slide-17
SLIDE 17

1-Bit Logic Circuit

b c NOT

b c NOT AND OR XOR 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0

AND OR XOR

slide-18
SLIDE 18

1-Bit Logic Circuit

b V NOT AND OR XOR c

b c NOT AND OR XOR 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0

slide-19
SLIDE 19

1-Bit Logic Circuit

b V c NOT AND OR XOR

b c NOT AND OR XOR 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0

slide-20
SLIDE 20

1-Bit Logic Circuit

b V c NOT AND OR XOR

b c NOT AND OR XOR 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0

slide-21
SLIDE 21

1-Bit Logic Circuit

b V c NOT AND OR XOR

b c NOT AND OR XOR 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0

slide-22
SLIDE 22

1-Bit Logic Circuit

b V c NOT AND OR XOR

b c NOT AND OR XOR 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0

slide-23
SLIDE 23

AND7 OR7

Eight 1-bit circuits can be combined to build an...

8-Bit Logic Circuit

Logic Circuit

NOT7

B7 C7

  • • •

XOR7 AND1 OR1

Logic Circuit

NOT1

B1 C1

XOR1 AND0 OR0

Logic Circuit

NOT0

B0 C0

XOR0

slide-24
SLIDE 24

The “Full Adder” Circuit

Carryin Carryout

Full Adder

Sum B C

Cyin 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

slide-25
SLIDE 25

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

8-Bit Adder

Carry

Full Adder Full Adder

B0 C0 Sum0 Sum1 B1 C1 Carry

Full Adder

Sum7 B7 C7

  • • •

+ B

8 8 8

C Sum

Carry Carry

slide-26
SLIDE 26

The Zero-Detect Circuit

Result Bus

Zero V+

slide-27
SLIDE 27

The Zero-Detect Circuit

Result Bus

Zero V+ Sign

slide-28
SLIDE 28

Enable Circuit

Enable

slide-29
SLIDE 29

Enable Circuit

x7 x6 x5 x4 x3 x2 x1 x0

Result Bus

B XOR C Enable

slide-30
SLIDE 30

Enable

Shift Left Circular (SHL)

b7 b6 b5 b4 b3 b2 b1 b0

Result Bus

B

slide-31
SLIDE 31

3-to-8 Decoder

f1

V

f0 f2

INC AND OR XOR NOT SHL <unused> ADD

f0 f1 f2 OUTPUT 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1

slide-32
SLIDE 32

Carry Sign

Arithmetic Logic Unit (ALU)

B

8 8 8

C

Data Bus

3 Zero

8-bit Logic 8-bit Adder

Enable En En En En En En AND OR XOR NOT SHL INC ADD

Function

3-to-8 Decoder Zero-Detect

slide-33
SLIDE 33

Carry Sign

An 8-Bit ALU

ALU

B

8 8 8

C Result

Function Code

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

3 Zero

slide-34
SLIDE 34

Register Storage

+V A

slide-35
SLIDE 35

Register Storage

+V

  • • •

A7 A0 A6

slide-36
SLIDE 36

Register Storage

+V

Bus

  • • •

Enable

A7 A0 A6 Select

slide-37
SLIDE 37

Register Storage

A7 Select Load A0

  • • •

Enable

A6

Bus

slide-38
SLIDE 38

Register Storage

A7 Select Load A0

  • • •

Enable

A6

Bus

slide-39
SLIDE 39

8-Bit “Data” Bus

Load Select Load Select “X” Register “Y” Register

8-Bit Registers

slide-40
SLIDE 40

16-Bit “Address” Bus 8-Bit “Data” Bus

“X” Register “Y” Register Load Select Load Select Load Select

slide-41
SLIDE 41

16-bit

Increment

Inst

M1 M2

M

X Y

XY

J1 J2

J PC Inc

8-bit

ALU Memory

Addr Data

Z Cy S

System Architecture

8-bit Data Bus

A B C D

16-bit Address Bus

slide-42
SLIDE 42

32K Byte Static RAM Chip LEDs 8 FET Power Transistors (to drive relays during a memory-read operation)

slide-43
SLIDE 43

16-bit

Increment

Inst

M1 M2

M

X Y

XY

J1 J2

J PC Inc

8-bit

ALU Memory

Addr Data

Z Cy S

8-bit Data Bus

A B C D

16-bit Address Bus

Example:

The ALU Instruction

slide-44
SLIDE 44

16-bit

Increment

Inst

M1 M2

M

X Y

XY

J1 J2

J PC Inc

8-bit

ALU Memory

Addr Data

Z Cy S

Step 1: Fetch Instruction

8-bit Data Bus

A B C D

MEM-READ SELECT LOAD

16-bit Address Bus

slide-45
SLIDE 45

Inst

M1 M2

M

X Y

XY

J1 J2

J PC Inc

8-bit

ALU Memory

Addr Data

Z Cy S

8-bit Data Bus

A B C D

Step 2: Increment PC

SELECT LOAD

16-bit

Increment

16-bit Address Bus

slide-46
SLIDE 46

16-bit

Increment

Inst

M1 M2

M

X Y

XY

J1 J2

J PC Inc

8-bit

ALU Memory

Addr Data

Z Cy S

8-bit Data Bus

A B C D

LOAD SELECT

Step 3: Update PC

16-bit Address Bus

slide-47
SLIDE 47

16-bit

Increment

Inst

M1 M2

M

X Y

XY

J1 J2

J PC Inc

Memory

Addr Data

Z Cy S

8-bit Data Bus

A D

Step 4: Execute Instruction

FUNCTION LOAD LOAD

B C 8-bit

ALU 16-bit Address Bus

slide-48
SLIDE 48

Clock

Switch +V Output +V

slide-49
SLIDE 49

Clock

Switch +V Output +V Charging

slide-50
SLIDE 50

Clock

Switch +V Output +V Discharging

slide-51
SLIDE 51

Clock

Switch +V Output +V

slide-52
SLIDE 52

+V +V

Clock

+V +V

A B C D

slide-53
SLIDE 53

+V +V

Clock

Charging

+V +V On On

Discharging

A B C D

slide-54
SLIDE 54

+V +V

Clock

Charging

+V +V On

Discharging

On

A B C D

slide-55
SLIDE 55

+V +V

Clock

Charging

+V +V On

Discharging

On

A B C D

slide-56
SLIDE 56

+V +V

Clock

Charging

+V +V On

Discharging

On

A B C D

slide-57
SLIDE 57

+V +V

Clock

Charging

+V +V On

Discharging

On

A B C D

slide-58
SLIDE 58

Clock Timing Diagram

A B C D

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

slide-59
SLIDE 59

t7 t5 t4 t3 t2 t1

Finite State Machine

1 2 3 4 5 6 7 8 t6 t8

Outputs

clock

slide-60
SLIDE 60

Output from FSA

2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 1 t1 t2 t3 t4 t5 t6 t7 t8

slide-61
SLIDE 61

Instruction Timing - ALU Instruction

Select PC Memory Read Load Instr Load Inc Select Inc Load PC ALU Function Load A Load Cond.Code Reg. 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 1

slide-62
SLIDE 62

Instruction Timing - ALU Instruction

Select PC Memory Read Load Instr Load 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 3 1

Fetch

Load A

slide-63
SLIDE 63

Instruction Timing - ALU Instruction

Select PC Memory Read Load Instr Load 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 3 1

Increment

Load A

slide-64
SLIDE 64

Instruction Timing - ALU Instruction

Select PC Memory Read Load Instr Load 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 3 1 Load A

Execute

slide-65
SLIDE 65

Instruction Decoding

Instruction Register Finite State Machine

Control Signals

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

Combinational Logic

1 2 3 4 5 6

  • • •

7 6 5 4 3 2 1

slide-66
SLIDE 66

1 2 3 4 5 6 7 8 9 10

Instruction Timing - 16-bit Move

Select PC Memory Read Load Instr Load Inc Select Inc Load PC Select Source-Register 2 3 4 5 6 7 8 1 1 Load Dest-Register

(Same as before)

slide-67
SLIDE 67

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

slide-68
SLIDE 68

Instruction Decoding and Control

Clock Instruction Register Finite State Machine

Control Lines Instruction Decoding

Data Bus

slide-69
SLIDE 69

The Instruction Set

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 register sss = 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

slide-70
SLIDE 70

The Instruction Set

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

slide-71
SLIDE 71

The Instruction Set

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 address Save return location in XY register PC ← XY

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

slide-72
SLIDE 72

The Instruction Set

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

slide-73
SLIDE 73

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