Review – Digital Concepts 1

advertisement
Review – Digital Concepts
Microcomputer Architecture and Interfacing
Colorado School of Mines
Professor William Hoff
1
Digital Logic Elements
• Combinational logic elements
– The output depends only on the current combination of inputs
– Examples:
• AND, OR, NOT gates
• Decoders, multiplexers, encoders
• Adders, comparators
• Sequential logic elements
– The output depends on the current and past sequence of inputs
(i.e., has an internal state that remembers the past sequence)
– Examples:
• Flip-flops, registers
• Counters, state machines
• Memories
Microcomputer Architecture and Interfacing
Colorado School of Mines
Professor William Hoff
2
Simple Logic Gates
• Give the truth tables for these logic elements
x
y
f
x
y
x
y
f
f
• What is the Boolean expression for f?
x1
x2
f
x3
Microcomputer Architecture and Interfacing
Colorado School of Mines
Professor William Hoff
3
Simple Logic Gates
• Give the truth tables for these logic elements
x
y
f
x
0
0
1
1
y
0
1
0
1
f
1
0
0
0
x
y
f
x
0
0
1
1
y
0
1
0
1
f
1
1
1
0
x
y
f
x
0
0
1
1
y
0
1
0
1
f
1
0
0
0
• What is the Boolean expression for f?
x1
x1
(x1*x2)’
x2
x2
f
x3
x3’
Microcomputer Architecture and Interfacing
(x2+x3’)’
Colorado School of Mines
Professor William Hoff
f = ((x1*x2)’ + (x2+x3’)’)’
it is possible to
simplify this
4
Decoders, multiplexers, encoders
2:1 Multiplexer
2:4 Decoder
w0
w1
En
y0
y1
y2
y3
• What is the Boolean expression for f?
x2
x1
0
1
1
0
2:4 decoder
4:1
mux
x0
1
Microcomputer Architecture and Interfacing
w0
w1
En
y0
y1
y2
y3
Colorado School of Mines
f
Professor William Hoff
5
Decoders, multiplexers, encoders
2:1 Multiplexer
2:4 Decoder
w0
w1
out = sel’*I0 + sel*I1
En
y0 = En*(w1’ * w0’)
y1 = En*(w1’ * w0)
y2 = En*(w1 * w0’)
y3 = En*(w1 * w0)
y0
y1
y2
y3
• What is the Boolean expression for f?
x2
x1
0
1
1
0
A = x2’*x1 + x2*x1’
f = y1 + y2
= w1’*w0 + w1*w0’
= w1 $ w0 (exclusive OR)
= x0 $ A
2:4 decoder
4:1
mux
A
x0
1
Microcomputer Architecture and Interfacing
w0
w1
En
y0
y1
y2
y3
Colorado School of Mines
f
Professor William Hoff
6
Flip-flops and Latches
• Latches change state whenever inputs change (as long as control/enable is
asserted)
• Flip-flops only change state at the rising or falling edge of a clock signal
D flip-flop
D latch
C
0
1
1
D
x
0
1
D
Q
C
Q
Q(t+1)
Q(t)
0
1
D
Q
Clk
Clk
↑
↑
other
Q follows D
whenever
C=1
Microcomputer Architecture and Interfacing
Q
Colorado School of Mines
D
0
1
x
Q(t+1)
0
1
Q(t)
Professor William Hoff
Q takes on
the value of
D whenever
Clk rises
Registers
• A collection of D flip-flops
8-bit register
D0
D
Q
Q0
pre
D[7..0]
D1
D
Q
Q1
Q[7..0]
Clk
clr
Dn-1
D
Q
Qn-1
Useful for storing
numbers
Clk
Microcomputer Architecture and Interfacing
Parallel load,
parallel access
Colorado School of Mines
Professor William Hoff
Download