k-maps, timing sequential circuits: latches & flip-flops lecture 4 digital design and computer...
TRANSCRIPT
K-Maps, TimingK-Maps, TimingSequential Circuits: Latches & Flip-FlopsSequential Circuits: Latches & Flip-Flops
Lecture 4Digital Design and Computer Architecture
Harris & HarrisMorgan Kaufmann / Elsevier, 2007
2.7 3-input K-map2.7 3-input K-map
C 00 01
0
1
Y
11 10AB
ABC
ABC
ABC
ABC
ABC
ABC
ABC
ABC
1 0
B C Y0 0 00 1 01 01 1 1
Truth Table
C 00 01
0
1
Y
11 10ABA
0000
0 0 00 1 11 0 01 1 0
1111
0
1
1
0
0
0
1
K-Map
3-input K-map3-input K-map
C 00 01
0
1
Y
11 10AB
ABC
ABC
ABC
ABC
ABC
ABC
ABC
ABC
1 0
B C Y0 0 00 1 01 01 1 1
Truth Table
C 00 01
0
1
Y
11 10ABA
0000
0 0 00 1 01 0 01 1 1
1111
0
1
1
1
0
0
0
K-Map
K-map DefinitionsK-map Definitions
• Complement: variable with a bar over it
• Literal: variable or its complement
• Implicant: product of literals
• Prime implicant: implicant corresponding to the larges circle in the K-map
K-map RulesK-map Rules
• Each circle must span a power of 2 (i.e. 1, 2, 4) squares in each direction
• Each circle must be as large as possible• A circle may wrap around the edges of the K-
map• A one in a K-map may be circled multiple
times• A “don't care” (X) is circled only if it helps
minimize the equation
2.8 Building Blocks2.8 Building Blocks
• Multiplexer vs. Demultiplexer• Decoder vs. Encoder• Priority Encoder• Adder
DecodersDecoders
2:4Decoder
A1
A0
Y3Y2Y1Y000
011011
0 00 11 01 1
0001
Y3 Y2 Y1 Y0A0A1
0010
0100
1000
2.9.1 Propagation & Contamination Delay2.9.1 Propagation & Contamination Delay
• Propagation Delay: tpd = max delay from input to output
• Contamination Delay: tcd = min delay from input to output
A
Y
Time
A Y
tpd
tcd
2.9.2 Glitches2.9.2 Glitches
• Glitch: when a single input change causes multiple output changes
• Glitches don’t cause problems because of synchronous design conventions (which we’ll talk about in a bit)
• But it’s important to recognize a glitch when you see one in timing diagrams
Glitches: ExampleGlitches: Example
00 01
1
Y
11 10AB
1
1
0
1
0
1
0
0
C
0
Y = AB + BC + ACAC
B = 1 0Y = 1
A = 0
C = 1
Ch.3 Sequential CircuitsCh.3 Sequential Circuits
• Circuits that:– give sequence to events– have memory (short-term)– use feedback from output to input
3.2 State Elements3.2 State Elements
• State: information that determines future behavior of circuit
• State elements store state– Cross coupled inverter pair– SR Latch– D Latch– D Flip-flop
3.2.2 D Latch3.2.2 D Latch
S
R Q
Q
Q
QD
CLKD
R
S
CLK
D Q
Q
S R Q
0 0 Qprev0 1 01 0 1
Q
10
CLK D
0 X1 01 1
D
X10
Qprev
3.2.3 D Flip-Flop3.2.3 D Flip-Flop
CLK
D Q
Q
CLK
D Q
Q
Q
Q
DN1
CLK
L1 L2
master slave
D Q
Q
How many transistors required for a D-FF ?
D Flip-Flop Input Timing ConstraintsD Flip-Flop Input Timing Constraints
CLK
tsetup
D
thold
• Setup time: tsetup = time before the clock edge that data must be stable (i.e. not changing)
• Setup time: thold = time after the clock edge that data must be stable
• Aperture time: To = time around clock edge that data must be stable
D Q
Q
D Flip-Flop Output TimingD Flip-Flop Output Timing
• Propagation Delay: tpcq = time after clock edge that Q is guaranteed to be stable (i.e. stop changing)
• Contamination Delay: tccq = time after clock edge that Q might be unstable (i.e. start changing)
D Q
Q
CLK
tccq
tpcq
tsetup
Q
D
thold