Professional Documents
Culture Documents
B
A
Digital Logic
Topics to Cover
The Transistor
Devices: Inverter, NAND, NOR, Drivers
De Morgans Law
Translations
Decoders, Multiplexors, Adders, PLAs
Logical Completeness
Sequential Logic
Latches
Memory
Finite State Machine
Digital Logic
The Transistor
Digital Logic
The Transistor
Digital Logic
The Transistor
Digital Logic
The Transistor
Moores Law
2000s
1990s
1980s
1970s
1960s
1950s
1947
Early 1900s
BYU CS/ECEn 124
The Transistor
P-type Transistor
N-type Transistor
gate FET
0 off
1 on
gate
current flow
gate
current flow
complementary
gate FET
0 on
1 off
Digital Logic
The Transistor
N type
S
G
D
Gate = Ground = 0
BYU CS/ECEn 124
Digital Logic
The Transistor
N type
S
G
D
Gate = Vcc = 1
BYU CS/ECEn 124
Digital Logic
10
The Transistor
CMOS Gates
We want complementary pull-up and pulldown logic: the pull-down is on when
the pull-up is off, and visa-versa.
Pullup
Structure
F
Complementary
The C in CMOS
Pulldown
Structure
Digital Logic
11
The Inverter
1
on
off
in
out
0
on
in out
0 1
1 0
This is a truth-table. It
tells what the output will be
for all combinations of the
inputs.
Symbols are
abstractions!
BYU CS/ECEn 124
off
Digital Logic
Inverter Symbols
12
on
on
nor
on
off
1
0
ab
00
01
10
11
off
off
nor
1
0
0
0
on
off
NOR Symbols
Digital Logic
13
The OR Gate
a
or
or
b
ab
00
01
10
11
BYU CS/ECEn 124
or
0
1
1
1
OR Symbol
Digital Logic
14
off
off
on
off
NAND
b
1
0
on
on
0
on
ab
00
01
10
11
nand
1
1
1
0
off
NAND Symbols
Digital Logic
15
a
0
0
1
1
b AND
0 0
1 0
0 0
1 1
AND Symbol
Digital Logic
16
Because
?
?
Pullup
Structure
F
Pulldown
Structure
Digital Logic
17
Drivers
Digital Logic
18
De Morgans Law
De Morgans Law
To distribute the
bar, change the
operation.
A B AB
NOR Symbols
A B A B
NAND Symbols
BYU CS/ECEn 124
Digital Logic
19
De Morgans Law
De Morgans Proof
A
A B
1
1
A+B A+B
Digital Logic
20
Translations
a
0
0
1
1
b
0
1
0
1
out
1
1
1
0
21
Translations
Logic
Equations
Logic
Gates
Truth
Tables
Digital Logic
22
Translations
b
s
a
Digital Logic
23
Translations
out
b
s
a
b
s
a
b
BYU CS/ECEn 124
Digital Logic
24
Translations
a
0
0
1
1
0
0
1
1
b
0
1
0
1
0
1
0
1
out
0
0
1
1
0
1
0
1
s
a
b
s
a
b
out
s
a
b
s
a
b
Digital Logic
25
Translations
s
0
0
0
0
1
1
1
1
equivalent to gates
easily converted to gates
a
0
0
1
1
0
0
1
1
b
0
1
0
1
0
1
0
1
out
0
0
1
1
0
1
0
1
out =
s ab
OR
s ab
Digital Logic
OR
sa b
OR
sab
26
Translations
out s a sb
out s a OR sb
out s ab s ab sa b sab
s
0
0
0
0
1
1
1
1
a
0
0
1
1
0
0
1
1
b
0
1
0
1
0
1
0
1
out
0
0
1
1
0
1
0
1
out
s ab
s ab
sa b
sab
OR
OR
OR
s
0
0
0
0
1
1
1
1
Digital Logic
a
0
0
1
1
0
0
1
1
b
0
1
0
1
0
1
0
1
out
0
0
1
1
0
1
0
1
Translations
Law
OR
AND
Identity
x0=x
x1=x
One/Zero
x1=1
x0=0
Idempotent
xx= x
xx=x
Inverse
x x = 1
x x = 0
Commutative
xy=yx
xy=yx
Associative
(x y) z = x (y z)
(x y) z = x (y z)
Distributive
x (y z) = (x y) (x z)
x (y z) = (x y) (x z)
DeMorgans
(x y) = xy
(x y) = x y
Digital Logic
28
Circuits
Decoders
W
W
B
X
1 if A,B = 00
1 if A,B = 01
1 if A,B = 10
1 if A,B = 11
2-to-4
Decoder
X
Y
Z
DECODER
Symbol
BYU CS/ECEn 124
Digital Logic
30
Circuits
Decoders
B
X
A
0
0
1
1
B
0
1
0
1
W
1
0
0
0
X
0
1
0
0
Y
0
0
1
0
Z
0
0
0
1
Digital Logic
31
Circuits
Multiplexors
B
S
C
Symbols are
abstractions!
MULTIPLEXOR Symbol
Digital Logic
32
Circuits
Multiplexors
B
0
0
1
1
0
0
1
1
S
0
1
0
1
0
1
0
1
C
0
0
0
1
1
0
1
1
A simpler way
A
Digital Logic
A
0
1
X
X
B
X
X
0
1
S
0
0
1
1
C
0
1
0
1
33
Circuits
Adders
c
0110
+0101
1011
b3 a3
b2 a2
b1 a1
b0 a0
Full
c3 Adder
Full
c2 Adder
Full
c1 Adder
Full
c0 Adder
s3
s2
s1
s0
Digital Logic
34
Circuits
b
0
0
1
1
0
0
1
1
c
0
1
0
1
0
1
0
1
cyout sum
0
0
0
1
0
1
1
0
0
1
1
0
1
0
1
1
Digital Logic
35
Logical Completeness
Logical Completeness
What is the minimum set of gate types needed to
implement any logic function?
AND gate, OR gate, INVERTER
A B AB
A B AB
DeMorgans Theorem
OR gate, INVERTER
AB A B
BYU CS/ECEn 124
A B A B
Digital Logic
DeMorgans Theorem
36
PLAs
Outputs
:
?
?
?
?
?
?
Inputs
:
BYU CS/ECEn 124
?
?
?
?
?
?
?
?
?
?
?
?
Digital Logic
37
PLAs
PLA Example
Out1 = ABC + ABC + ABC
Out2 = ABC + ABC + ABC
Out3 = ABC + ABC
Out1
Out2
Out3
?
?
?
?
A B C
0 0 0
Out
3
0
0
0
1
1
1
1
0
1
1
0
0
1
1
1
0
1
0
1
0
1
Out1 Out2
0
1
0
0
1
0
0
1
1
0
1
0
0
1
0
0
?
?
?
1
0
0
0
0
0
0
1
?
?
Outputs
Inputs
A
B
C
Digital Logic
?
?
?
?
?
?
?
?
?
?
?
?
38
Logical Completeness
Logical Completeness
NAND
INVERTER
AND
OR
Digital Logic
39
Sequential Logic
25
4 1 8 4
20
Combinational
Success depends only on
the values, not the order in
which they are set.
BYU CS/ECEn 124
Digital Logic
30
15
5
10
Sequential
Success depends on
the sequence of values
(e.g, R-13, L-22, R-3).
40
Sequential Logic
Storage Elements
Digital Logic
41
Sequential Logic
Digital Logic
42
Sequential Logic
RS Latch
same
q
r
same
Cross-coupled
NAND gates
Note the
feedback
Digital Logic
43
Sequential Logic
Digital Logic
44
Sequential Logic
RS Latch
(continued)
s
r
1
Digital Logic
45
Sequential Logic
r
0
0
1
1
0
0
1
1
q
0
1
0
1
0
1
0
1
qnext
x
x
1
1
0
0
q
q
Digital Logic
not allowed
set
reset
keep old state
46
Latch
Gated D Latch
we
q
WE
D
Q
D-Latch
r
Symbols are
abstractions!
BYU CS/ECEn 124
Digital Logic
LATCH Symbol
47
Quiz
1. What is a bi-stable circuit?
2. Draw a logic circuit (using N and P type
transistors) for a 3 input NAND gate.
3. With a RS NAND latch, why cant R and
S be low at the same time?
4. How is Q set with the following latch?
Digital Logic
48
Quiz (Answers)
1. What is a bi-stable circuit?
Digital Logic
49
Quiz (Answers)
3. With a RS NAND latch, why cant R and
S be low at the same time?
Digital Logic
50
Quiz (Answers)
4. How is Q set with the following latch?
0
1
0
0
Digital Logic
51
Latch
Register
we
d2
d1
d0
d
D-Latch
D-Latch
D-Latch
D-Latch
we
Register
q
q3
q2
q1
q0
REGISTER Symbol
Digital Logic
52
Memory
Memory
we
address
d
n
m
Memory
Digital Logic
53
Memory
Memory Usage
addr
000
001
010
011
100
101
110
111
value
1001
0000
1111
1011
0000
0011
1010
0101
addr
000
001
010
011
100
101
110
111
value
1001
0000
1111
1011
0000
0000
1010
0101
addr
000
001
010
011
100
101
110
111
value
1001
0000
1111
1011
0000
0000
1010
0101
addr
000
001
010
011
100
101
110
111
value
1001
0000
1111
1011
0000
0000
1010
1100
Power-Up State
(random bits)
addr
000
001
010
011
100
101
110
111
value
0000
0000
1111
1011
0000
0000
1010
1100
addr
000
001
010
011
100
101
110
111
value
0110
0000
1111
1011
0000
0000
1010
1100
Digital Logic
addr
000
001
010
011
100
101
110
111
value
0110
0000
1111
1011
0000
0000
1010
1100
54
Memory
2-to-4
Decoder
a1 a0
address
n=2
d input
00
we
Register
01
we
Register
10
we
Register
11
we
Register
Digital Logic
q0
q1
q output
q2
q3
we
address
d
MEMORY
Symbol
n
m
Memory
55
Memory
Address Space
Digital Logic
56
The MSP430
You may not know how it works, but you know the parts its made from!
Status Register
Program Counter
Register
Memory
Multiplexor
Memory
Mapped I/O
Bus Driver
16 16-bit
Registers
Instruction Register
BYU CS/ECEn 124
Lots of Gates
60
START HERE
Digital Logic
61
Inputs
Combinational
Logic Circuit
Outputs
Storage
Elements
Digital Logic
62
State of a System
Digital Logic
63
25
4 1 8 4
20
Combinational
Success depends only on
the values, not the order in
which they are set.
BYU CS/ECEn 124
30
15
5
10
Sequential
Success depends on
the sequence of values
(e.g, R-13, L-22, R-3).
Digital Logic
64
Digital Logic
65
State Diagram
Open = 1
Open = 0
Digital Logic
66
Digital Logic
67
The Clock
One
Cycle
time
Digital Logic
68
FSM Implementation
Combinational logic
Determine outputs and next state.
Storage elements
Maintains state representation.
State Machine
Inputs
Clock
Combinational
Logic Circuit
Outputs
Storage
Elements
Digital Logic
69
Digital Logic
70
HOLD
SET/RESET
Digital Logic
71
HOLD
SET/RESET
Digital Logic
72
Another view
Input
Combinational
Logic
Slave
Master
LOW
Digital Logic
73
Another view
Input
Combinational
Logic
Slave
Master
LOW
Digital Logic
74
Another view
Input
Combinational
Logic
Slave
Master
HIGH
Digital Logic
75
Another view
Input
Combinational
Logic
Slave
Master
HIGH
Digital Logic
76
Another view
Input
Combinational
Logic
Slave
Master
HIGH
Digital Logic
77
Another view
Input
Combinational
Logic
Slave
Master
LOW
Digital Logic
78
Another view
Input
Combinational
Logic
Slave
Master
LOW
Digital Logic
79
Storage Elements
Digital Logic
80
No lights on
1 & 2 on
1, 2, 3, & 4 on
1, 2, 3, 4, & 5 on
DANGER
Digital Logic
MOVE
RIGHT
81
Switch on
Transition on each clock cycle.
State bit S1
Switch off
State bit S0
Digital Logic
Outputs
82
Lights 1 and 2
Lights 3 and 4
Light 5
0
1
1
1
1
S1 S0 Z Y X
0
0
1
1
0
1
0
1
0
1
1
1
0
0
1
1
0
0
0
1
In S1 S0 S1' S0'
X
0
0
1
1
X
0
1
0
1
0
0
1
1
0
0
1
0
1
0
Digital Logic
83
Digital Logic
84
Digital Logic
85
STOP HERE
Digital Logic
86
DECODE:NOCLK:MOV||EVSRC
EVDST:CLK1:MOV,Rd|D,ROX=Rd|STORE
EVSRC:CLK1:MOV,Rs|S,ROX=Rs|EVDST
STORE:CLK1:MOV,Rd|ALU,RWE,RIX=Rd|
FETCH
...
Digital Logic
87
Digital Logic
88
Review
NOT
AND
OR
XOR
Operator
sign and
alternat e(s)
x _
x or x
xy
x y
x y
xy
xy
x y
Output
is 1 iff:
Input is 0
Both inputs
are 1s
At least one
input is 1
Inputs are
not equal
1x
x y or xy
x y xy
x y 2xy
Graphical
symbol
Arithmetic
expression
Digital Logic
90
OR
NAND
NOR
XNOR
Gates with more than two inputs and/or with inverted signals at
input or output.
Digital Logic
91
Enable/Pass signal
e
Data out
x or 0
Data in
x
Data in
x
Data out
x or high impedance
(b) Tristate buffer
e
0
0
x
ex
No data
or x
Digital Logic
92
x
ey
Data out
(x, y, z, or 0)
ez
z
z
(a) Wired OR of product terms
ex
ey
Data out
(x, y, z,
or high
impedance)
ez
Digital Logic
93
Digital Logic
94
Name of law
OR version
AND version
Identity
x0=x
x1=x
One/Zero
x1=1
x0=0
Idempotent
xx= x
xx=x
Inverse
x x = 1
xx=0
Commutative
xy=yx
xy=yx
Associative
(x y) z = x (y z)
(x y) z = x (y z)
Distributive
x (y z) = (x y) (x z)
x (y z) = (x y) (x z)
DeMorgans
(x y) = x y
(x y) = x y
Digital Logic
95
x
y
y
z
z
x
x
y
y
z
z
x
Digital Logic
96
BCD-to-Seven-Segment Decoder
4-bit input in [0, 9]
x3 x2 x1 x0
Signals to
enable or
turn on the
segments
e0
e5
e6
e4
e3
6
4
2
3
e2
e1
The logic circuit that generates the enable signal for the lowermost
segment (number 3) in a seven-segment display unit.
BYU CS/ECEn 124
Digital Logic
97
Digital Logic
98
Multiplexers
x0
z
x1
y
/
32
/
32
/
32
x0
x1
z
y
e (Enable)
x0
0
1
2
3
x1
x2
x3
y1y0
(d) Mux array
x1
y
(c) Mux symbol
x0
x1
x2
x3
x0
y0
y1
y0
Digital Logic
99
Decoders/Demultiplexers
y1
y0
x0
x1
x2
y1y0
y1 y0
0
1
2
3
x0
x1
x2
x3
x3
(a) 2-to-4 decoder
e
(Enable)
0
1
2
3
x0
x1
x2
x3
(c) Demultiplexer, or
decoder wit h enable
Digital Logic
100
Encoders
x0
x1
x0
x1
x2
x3
x2
x3
y1 y0
y1y0
(a) 4-to-2 encoder
0
1
2
3
Digital Logic
101
Digital Logic
102
PROMs
w
Inputs
Decoder
.
.
.
...
Outputs
(a) Programmable
OR gates
Digital Logic
103
8-input
ANDs
...
AND
array
(AND
plane)
.
.
.
6-input
ANDs
OR
array
(OR
plane)
...
4-input
ORs
Outputs
(a) General programmable
combinational logic
Digital Logic
104
D
C
D
C
(a) SR latch
D
Q
Q
(b) D latch
Q
FF
D
C
FF
Q /
k
Q
Digital Logic
105
Latches vs Flip-Flops
Setup Hold
time time
Setup Hold
time time
D
C
D latch: Q
D FF: Q
Operations of D latch and negative-edge-triggered D flip-flop.
Digital Logic
106
FF
Clock
Computation module
(combinational logic)
D
C
FF
Propagation delay
Digital Logic
107
Finite-State Machines
Quarter
Reset
Current
state
S 00
S 10
S 25
S 00
S 10
S 20
S 35
S 00
S 20
S 30
S 35
S 00
S 25
S 35
S 35
S 00
S 30
S 35
S 35
S 00
S 35
S 35
S 35
S 00
Next state
S 00 is the initial state
S 35 is the final state
Dime
S 10
Reset
Reset
Dime
Start
S 20
Quarter
Dime
Quarter
Quarter
S 00
S 25
Reset
Reset
Dime
Quarter
Reset
Dime
Quarter
S 35
Dime
Quarter
S 30
Digital Logic
108
2 h k -bit registers
/
Write
/
address h
D
C
Write
enable
Decoder
FF
Read
data 0
k
Q
FF
D
C
Write enable
D
C
FF
D
C
Muxes
Write
data
Write
addr
Read
addr 0
Read
data 1
FF
Read
data 0 k/
Read
data 1 k/
Read
addr 1
Read enable
Push
Read address 0
Read address 1
Read
enable
Input
Empty
Full
Output /
k
Pop
Digital Logic
109
Row decoder
SRAM
Write enable
Data in
Address
Chip
select
.
.
.
Square or
almost square
memory matrix
Data out /
g
. . .
Output
enable
Row buffer
Address /
Row
h Column
. . .
Column mux
g bits data out
Digital Logic
110
Digital Logic
111
Highlevel
view
Computer organization
Circuit designer
Logic designer
Electronic components
Hardware
Computer designer
System designer
Application designer
Application domains
Software
Lowlevel
view
Digital Logic
112
One task =
Many instructions
BYU CS/ECEn 124
temp=v[i];
v[i]=v[i+1];
v[i+1]=temp;
Assembly
language
instruction,
mnemonic
Compiler
Swapv[i]
andv[i+1]
High-level
language
statements
Interpreter
One statement =
Several instructions
MOV.B 0x0001(SP),R14
MOV.W SP,R15
INCD.W R15
ADD.W R15,R14
MOV.B @R14,0x0000(SP)
MOV.B 0x0001(SP),R14
INC.W R14
MOV.W SP,R15
INCD.W R15
ADD.W R15,R14
MOV.B 0x0001(SP),R13
MOV.W SP,R15
INCD.W R15
ADD.W R15,R13
MOV.B @R14,0x0000(R13)
MOV.B 0x0001(SP),R15
INC.W R15
MOV.W SP,R14
INCD.W R14
ADD.W R15,R14
MOV.B @SP,0x0000(R14)
Digital Logic
Assembler
Mostly one
for one
Machine
language
instructions
binary (hex)
415E 0001
410F
532F
5F0E
4EE1 0000
415E 0001
531E
410F
532F
5F0E
415D 0001
410F
532F
5F0D
4EED 0000
415F 0001
531F
410E
532E
5F0E
41EE 0000
113