Professional Documents
Culture Documents
+V
+V
+V
Schematic Diagrams
Schematic Diagrams
+V
in out 0 1 1 0
in out 0 1 1 0
The OR Circuit
b c
b 0 0 1 1 c 0 1 0 1
b or c
OUT 0 1 1 1
+V b
b or c +V
An Optimization?
b b c b or c c b or c
An Optimization?
b b c d c or d c c or d d b or c b or c
An Optimization?
b b c d c or d c c or d b or c b or c
Whoops!
An Optimization?
b c d c or d c d b or c b +V c or d b or c
NOT AND OR
c XOR
V b
NOT AND OR
c XOR
V b
NOT AND OR
c XOR
V b
NOT AND OR
c XOR
V b
NOT AND OR
c XOR
V b
NOT AND OR
c XOR
Logic Circuit
XOR7 OR7 AND7 NOT7
Logic Circuit
XOR1 OR1 AND1 NOT1
Logic Circuit
XOR0 OR0 AND0 NOT0
Cyin B 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1
C 0 1 0 1 0 1 0 1
Cyout 0 0 0 1 0 1 1 1
Sum 0 1 1 0 1 0 0 1
Carryout
Full Adder
Carryin
Sum
8-Bit Adder
B7 C7 B1 C1 B0 C0 Carry Carry Carry
Full Adder
Full Adder
Full Adder
Sum7
Sum1
Sum0
B C
8 8 8
Sum
Carry
V+
Zero
Result Bus
V+
Zero
Result Bus
Sign
Enable Circuit
Enable
Enable Circuit
B XOR C
x7 x6 x5 x4 x3 x2 x1 x0
Enable
Result Bus
B
b7 b6 b5 b4 b3 b2 b1 b0
Enable
Result Bus
3-to-8 Decoder
f0 f1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 f2 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 OUTPUT 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1
ADD INC AND OR XOR NOT SHL <unused>
f0 f1 f2
B C
Function
8-bit Adder
ADD AND INC
8-bit Logic
XOR NOT OR SHL
3-to-8 Decoder
Enable En 8
En En En En En
Data Bus
Zero
Sign
Carry
Zero-Detect
An 8-Bit ALU
Function Code
000 001 010 011 100 101 110 111 add inc and or xor not shl <nop>
3
B C
8 8
ALU
8 Carry Sign Zero
Result
Register Storage
+V
Register Storage
+V A7 A6 A0
Register Storage
+V A7 Select A6 A0
Enable
Bus
Register Storage
Load Select
A7
A6
A0
Enable
Bus
Register Storage
Load Select
A7
A6
A0
Enable
Bus
8-Bit Registers
A B C D
M1 M2
ALU
M
Z Cy S
8-bit
X Y J1 J2
XY J
Inst
PC Inc
16-bit
System Architecture
Increment
Memory
Addr Data
A B C D
M1 M2
ALU
M XY J
Inst Z Cy S
8-bit
X Y J1 J2
Example:
The ALU Instruction
PC Inc
16-bit
Increment
Memory
Addr Data
A B C D
M1 M2
ALU
M XY J
Inst Z Cy S
8-bit
X Y J1 J2
LOAD SELECT
PC Inc
16-bit
Increment
Memory
Addr Data
A B C D
M1 M2
ALU
M XY J
Inst Z Cy S
8-bit
X Y J1 J2
Step 2: Increment PC
PC Inc
16-bit
SELECT LOAD
Increment
Memory
Addr Data
A B C D
M1 M2
ALU
M XY J
Inst Z Cy S
8-bit
X Y J1 J2
Step 3: Update PC
PC Inc
16-bit
LOAD SELECT
Increment
Memory
Addr Data
LOAD
A B C D
M1 M2
ALU
M XY J
Inst Z Cy S
8-bit
J1 J2
X Y
FUNCTION
LOAD
PC Inc
16-bit
Increment
Memory
Addr Data
Clock
+V Switch +V Output
Clock
+V Switch +V Charging Output
Clock
+V Switch +V Discharging Output
Clock
+V Switch +V Output
Clock
+V +V +V +V
Clock
On +V +V +V On +V
B
Discharging Charging
Clock
On +V +V +V +V On
B
Discharging
C
Charging
Clock
On +V +V +V +V On
B
Discharging
C
Charging
Clock
On +V +V +V +V On
A
Charging
C
Discharging
Clock
On +V +V On +V +V
A
Discharging Charging
clock
1 t1
Outputs
t1 t2 t3 t4 t5 t6 t7 t8
Fetch
Increment
Execute
Instruction Decoding
Finite State Machine
1 2 3 4 5 6
Instruction Register
7 6 5 4 3 2 1 0
Combinational Logic
Control Signals
(Load, Select, Mem-Read, etc.)
(Same as before)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
= destination register = source register (A, B, C, D, M1 ,M2 ,X or Y) destination register (A or D) = function code (add, inc, and, or, xor, not, shl) (A or B)
ALU
1 0 0 0 r f f f
r = fff
Load Immediate
0 1 r d d d d d
16-bit Increment
1 0 1 1 0 0 0 0
XY XY + 1
Store
1 0 0 1 1 0 r r
rr
Halt
1 0 1 0 1 1 1 0
Call
1 1 1 0 0 1 1 1 a a a a a a a a a a a a a a a a
PC XY
d = destination register (PC or XY) ss = source register (M, XY or J)
16-Bit Move
1 0 1 0 d s s 0
Branch If Carry
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 If Zero
1 1 1 0 0 1 0 0 a a a a a a a a a a a a a a a a
An Example Program
0000 0000 0000 0000 0000 0000 0000
address
0000 0001 0010 0011 0100 0101 0110
instr
0000 0111 0000 1000 0000 0000 0000 0000 0000 0000 0000 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 1001 1010 1011 1100 1101 1110 1111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100
0101 1001 0001 1000 0000 1000 0011 0000 1000 0011 0000 1000 1111 0000 0001 0000 1000 0011 0000 1000 1110 0000 0000 1010 1110 0110 0000 1111 0110 1000 1111 0101 0000 0000 0111 1110 0000 0000 1011 1001 0010 0000 1001 1110
Y=B Y B X=0 X 0 A=B If sign(Y)==1 BNEG Else . . . . . X=C X C Else: . A=-7 D -7 D=A . Loop: Loop: B=X Shift X left (circular) A=B<<1 . X=A . B=Y Shift Y left (circular) A=B<<1 . Y=A . B=Y If sign(Y)==1 A=B . BNEG Else2 . . . . . B=X X X + C A=B+C . X=A . Else2: . B=D D D + 1 D=B+1 . BNZ Loop If D != 0 goto Loop . . . . HALT HALT
assembly
comment