Chapter Hazard
Chapter Hazard
1
Outline
clock input
option feedback
output
• All wires, except clock, may • Combinational Logic Blocks (CL)
be multiple bits wide. – no internal state
• Registers (reg) – output only a function of inputs
– collections of flip-flops • Particular inputs/outputs are
• clock optional
– distributed to all flip-flops • Optional Feedback
– typical rate?
10-4-2007 Lec12 EECS150 Fa07 3
General Model of Synchronous Circuit
clock input
option feedback
output
input
D
output
clk
t Q
• What are typical delay
values? setup time clock to Q delay
clk
option feedback
output
• In general, for correct operation:
T time(clk→Q) + time(CL) + time(setup)
T clk→Q + CL + setup
for all paths.
• How do we enumerate all paths?
– Any circuit input or register output to any register input or circuit output.
– “setup time” for circuit outputs depends on what it connects to
– “clk-Q time” for circuit inputs depends on from where it comes.
• Inverter: d
• NAND gate:
10-4-2007 When
Lec12 does itFa07
EECS150 start? How quickly does it switch?
10
Delays in a series of gates
• Cascaded gates:
Vout
Vin
clk clk
clk’
Q
clk’
clk’
clk
clk
Data busses
datapath Controller
clock
time
CLK
CL CLK’
26
Gate Delays and Timing Diagrams (2)
27
Hazard
29
Hazards/Glitches
1 1
0 0
10-4-2007 Lec12 EECS150 Fa07 31
Static-1 Hazard
Z
Z’
YZ
XZ’
F
34
Static Hazards in
Karnaugh Maps
X
Z F
F = X•Z’ + Y•Z
X
How can we identify a static-1 hazard
1 1 in this Karnaugh map?
35
Static Hazards in
Karnaugh Maps
X
Z F
F = X•Z’ + Y•Z
X
How can we eliminate the hazard?
1 1
Z 1 1 We can add one extra term to F.
Consensus Term
36
Static Hazards in
Karnaugh Maps
X
Z F
X F = X•Z’ + Y•Z
X
How can we eliminate the hazard?
1 1
Z 1 1 We can add one extra term to F.
Consensus Term
37
Static Hazards
• Due to a literal and its complement momentarily
taking on the same value
– Thru different paths with different delays and converging
• May cause an output that should have stayed at
the same value to momentarily take on the wrong
value
• Example:
A
A
S B
F
S
B S'
F
S'
hazard
static-0 hazard static-1 hazard
10-4-2007 38
Another Example
W W
1 11 1 1 1 1
1 1 1 1 1 1
Z Z
1 1 1 1 1 1
Y Y
1 1 1 1 1 1
X X
F = W’•Z + X•Z’ + X’•W F = W’•Z + X•Z’ + X’•W
39
Another Example
W W
1 1 1 1 1 1
1 1 1 1 1 1
Z Z
1 1 1 1 1 1
Y Y
1 1 1 1 1 1
X X
F = W’•Z + X•Z’ + X’•W F = W’•Z + X•Z’ + X’•W + X•W’
40
Another Example
W W
1 11 1 1 1 1
1 1 1 1 1 1
Z Z
1 1 1 1 1 1
Y Y
1 1 1 1 1 1
X X
F = W’•Z + X•Z’ + X’•W F = W’•Z + X•Z’ + X’•W + X•W’ + W•Z’
41
Another Example
W W
1 1 1 1 1 1
1 1 1 1 1 1
Z Z
1 1 1 1 1 1
Y Y
1 1 1 1 1 1
X X
F = W’•Z + X•Z’ + X’•W F = W’•Z + X•Z’ + X’•W + X•W’ + W•Z’ + X’•Z
42
Dynamic Hazards
0
W 0
0 slow
X
0 0
Y 1 1
1 1
1
1
1 1
Z
slower
44
Dynamic Hazard Example
0
W 0 →1
0 →1 slow
X
0 0 →1→0
Y 1→0 1 →0 →1
1→0 1 →0 →0
1→0
1
1 1
Z
C
A
F B1
3
B 2
B2
1
B3
C
F
hazard
dynamic hazards
10-4-2007 Lec12 EECS150 Fa07 46
Dynamic Hazards
u
A F
B
t v w
B
C
w
Eliminating Static Hazards
• Very difficult!
• A circuit that is
static hazard free
1 01
\A
G1 can still have
B
01 dynamic hazards
Slow G3
1 01
\B 1 0
1 01 0
• Best approach:
\C G2
1 10 G5 F – Design critical
circuits to be two
0
A 10 level and eliminate all
\B G4
static hazards
10
V ery slow – OR, use good
clocked synchronous
design style