Documente Academic
Documente Profesional
Documente Cultură
John Knight
Hazards
Glitches and a Hazards
A glitch is a fast spike usually unwanted.
A hazard in a circuit may produce a glitch.
if the propagation delays are unbalanced.
John Knight
or down
FIG. 1-1
x
1
1
Any circuit with a static-0 hazard must reduce to the equivalent circuit of FIG. 1-1,
if other variables are set to appropriate constants.
0
FIG. 1-2
x
1
x
0
x
x
1
x
x
John Knight
Basic static-1
hazard circuit
0
Any circuit with a static-1 hazard must reduce to the equivalent circuit of FIG. 1-3
FIG. 1-4
x
x
0
1
John Knight
delay
FIG. 1-6
John Knight
Adding an equal delay in the other path removes the falling-edge glitch.
Adding too much delay will make the glitch appear on the rising edge.
FIG. 1-8
0
0
At the silicon layout level, one might balance delays closely enough to suppress the
glitch.
With standard cells and field-programmable arrays, balancing is harder.
But see Absorption of Glitches by Gates on page 53.
John Knight
FIG. 1-9
x
0
map of y
The
x=0
x=1
An interpretation of the map of y.
John Knight
FIG. 1-10
AX
AX
AX + BX
BX
Masking a Hazard.
To mask static-1 hazards add a gate that stays high across the
This gate is logically redundant.
AB
X 00 01 11 10
0 0 BX
0
1 0 0
AX
AB
FIG. 1-11
X
A
AX
AB
BX + AX + AB
transition.
The equation
F = BX + AX
has redundant term AB added
F = BX + AX + AB
This fills the valley between terms
BX and AX.
B
BX
John Knight
A+B
AB
A+B
D+E
DE
D+E
= DE
F = {A+B+C}{D+{A+B}C}+A
Examples
F = ABC
John Knight
{ABC}
F = {A+B+C}
F = ABC + AB
{ABC} + {AB }
F = {A+B+C}{A+B }
F = AB(C + AB)
{AB}(C+{ AB })
F = {A+B}+(C{ A+B })
F = XB + XA
AB
X 00 01 11 10
0 0 1 1 0
1
0 1
AB
X 00 01 11 10
0 0 1 1 0
1
0 1
F = {X + B}{ X + A}
AB
X 00 01 11 10
0 0 1 1 0
1
John Knight
10
0 1
D+X
XD
E 00 01 11 10
0
1 E+X
1
1 1 1
hazard
D
D+X
F = (D + X)(E + X)
E
Get of implementation.
Plot 0s not 1s.
Connect letters with OR, not AND.
D + X, E + X
Gaps between adjacent circles
show
static-0 hazards.
Consider wrap around
E+X
D+E
D+X
XD
E 00 01 11 10
D+E 1 E+X D+E
1
hazard
D
X
D+X
E+X
F= (D + X)(E + X) (D + E)
XD
00 01 11 10
E
D+E
D+E
John Knight
11
Simplification
x + xy = x + y
(x + y) = xy
xy + xy = y
(x + y)(x + y) = y
Multiplying Out
(x + y)(x + z) = xz + xy
xy + xz = (x + z)(x + y)
Consensus
xy + yz + xz = xy + xz
(x + y)(y + z)(x + z) = (x+y)(x + z)
For work with dynamic hazards, avoid the distributive law. (Factoring)
The distributive laws can create dynamic hazards from static hazards,
even a masked one.
They will not remove or create static hazards.
The Distributive Laws
x(y + z) = xy + xz
x + yz = (x + y)(x + z)
John Knight
12
Algebra of Hazards
Algebra of Hazards
The basic forms for hazards and their equations.
x and x are treated as separate variables.
If a circuit has a hazard, the equation of the circuit will reduce to one of these forms.
FIG. 1-14
Static-0
xx
Static-1
x+x
Dynamic
xx + x
Dynamic
(x + x )x
An Example
Below, a hazard in x must reduce to a basic hazard circuit when c=1 or when c=0.
c
x
Static-1 hazard
x
c
cx + x
FIG. 1-15
John Knight
FIG. 1-16
Circuit equation is
cx + x
when c = 1 get
1x + x = x + x
The hazard is exposed
13
No Hazard
(c + x )xc
Circuit equation is
(c + x)xc
When c = 1, get (1 + x)x1 = x
When c = 0, get (0 + x)x0 = 0
There are no hazard
Algebra of Hazards
FIG. 1-17
ORIGINAL CIRCUIT
c
x
c
Static-1 hazard
xc + x
(c + x )(x + x)
When c=1 x + x
(1 + x )(x + x) = x + x
c
Masked Hazard
xc(c + x )
xc + xcx
John Knight
14
Method
Method
1. Remove confusing extended overbars.
1. (A + B) + AC => AB + (A + C)
AX + (BX + C)
1X + (1X + 0)
X + X
John Knight
15
Example
Find All The Hazards In F.
b
c
F
a
d
John Knight
16
Equivalent graphical forms for AND, OR, NAND and NOR, using DeMorgans theorem.
AB
A
B
AND
GH
G
H NAND
FIG. 1-19
K
K
=
A
B
A+B
AND
D+E
C
D
E
= G+H
G
K
NAND
H
=
F
OR
D+E
D
E
NOR
=
D
E
DE
OR
= DE
D
NOR
E
John Knight
2) Transform gates
4) Result
17
F = (a + c)(b + c) + cd
Printed; March 19, 01
Modified; November 1, 97
b
c
F
a
d
b
c
a
d
John Knight
F = (a + c)(b + c) + cd
18
0
0
1
1
0
0
1
1
c
c
c
c
c
c
c
c
0
1
1
0
0
1
1
0
(a + c) (b + c) + cd
(0 + c) (0 + c)+c0
0 + c 0 + c c1
0 + c 1 + c c1
0 + c 1 + c c0
1 + c 0 + c c0
1 + c 0 + c c1
1 + c 1 + c c1
1 + c 1 + c c0
Type of hazard.
cc
cc+c
c+c
c
c
c+c
1+c
Static-0
Dynamic
Static-1
a,b,d = 0,0,0,
a,b,d = 0,0,1,
a,b,d = 0,1,1.
John Knight
19
F = (a + c)(b + c) + cd
Note only c can have a hazard.
Select c to to be the variable that changes.
Sequentially substitute 1 or 0 for the other letters.
A little thought shows a must be 0, else a + c = 1 => no c => no hazard
Set a = 0 first.
a bcd
(a + c)(b + c) + cd
a b cd
0 bcd
(a + c)(b + c)+ cd
(0 + c)(b + c)+ cd
0 1 cd
0 1 c1
try b = 1
d must be 1
0 0 cd
0 0 c0
0 0 c1
try b = 0
= c(0 + c)+ cd = cc + cd
d may be 0
= cc + c0 = cc
or d may be 1
= cc + c1 = cc + c
1
0
a,b,c,d.
a must be 0, or no c.
= c(b + c)+ cd
= c(1 + c)+ cd = c + cd
= c + c1
0
1
b
0
John Knight
= c+c
20
Static-1 for 0 1 c 1
Static-0 for 0 0 c 0
Dynamic for 0 0 c 1
c+c
cc
cc + c
Printed; March 19, 01
Modified; November 1, 97
a bcd
a bcd
a 1 cd
a1 0d
a 10 0
a 10 1
= [a1+ a0]a = aa
or d may be 1
a bcd
0 bcd
0 bc 0
a must be 1, or F 0
d must be 0 or no b
Static-0 for 0 b - 0
This hazard is independent of c.
a b cd
0 1 cd
a bc d
0 1 cd
John Knight
21
1
0
[ad +ad]a
0
1
0
1
John Knight
0
1
aa
aa
0
1
bb
bb
[(bc0+ b1]b
[ bcd + bd ]b
0
1
0
1
1
0
0
1
1
0
[cd]
d
[cd]
c
22
0
1
0
1
+ aceX
set a,c,e to1,1,1 or no X
If only one X, set all symbols ANDing X to 1.
If only one X, set symbols ANDing X at 1, and ORing X at 0. y(e + Xc) set c,e,y to 1,0,1 or no X.
If all Xs have a common factor, fix factor at 1.
b(cX + acX) + acXy c must be 1 or no X
a bce y
a bce y
a b 1ey
c must be 1, or no a
no a => no hazards in a
a bce y
a b 010
a b ce y
a b c1 y
a 0c 01
e must be 1 or no c.
yb must be 1,1 or no c
no c => No hazards.
a b ce y
a b 1e y
a b 1e 0
a 11e 0
c must be 1 or no e
y must be 1 or no e
b must be 1
Static-1 for a11e0
a b ce y
1 b 11 y
John Knight
23
1
0
0
1
no a
no a
1
0
no b
1
0
0
1
no b
0
1
no c
no b
1
0
1
0
0
1
1
0
1
0
1
0
1
0
John Knight
24
e+e
no y
Masking Hazards
Mask a static-1 with an AND gate.
A hazard is between two squares
Since hazard is static-1, the function is 1 in those two squares
Mask it with a function which is guaranteed
1 in those two squares
0 elsewhere
That function is G = AB
AB
X 00 01 11 10
0 0 1 1
0
1
0 1
Masking a static-1
X
A
AX
AB
X 00 01 11 10
0 0 0 1 0
1
0 1
A
X
FIG. 1-21
AB
0
G
AX
AX + BX
John Knight
BX + AX + G
G
B
BX
BX
25
Expression
c+c
Static-1 for 0 1 c 1
cc
Static-0 for 0 0 c 0
cc + c Dynamic for 0 0 c 1
cd
ab
a
00
01
11
10
00
01
d 11
10
c.
ab
there.
Define G:
G=1 when a,b,d = 0,1,1
G=0 anywhere else.
F+G=F
Since when G is 1, F is 1.
elsewhere F + 0 = F
00
01
11
10
01
11
10
01
11
10
ab
00
cd
00
F
01
F=1 F
Desired G = abd
11
F=1
10
Expression
John Knight
cd
00
F+G
F = (a + c)(b + c) + cd
26
F = (a + c)(b + c) + cd
Expression
cc
Static-0 for 0 0 c 0
cd
ab
01
11
10
00
01
c.
d 11
10
there.
b
ab
Define H:
H=0 when a,b,d = 0,0,0
H=1 anywhere else.
FH = F
a
00
Since when H is 0, F is 0.
elsewhere F1 = F
FH
F with cc masked is
FH = F = (a+b+d((a + c)(b + c) + cd)
00
01
11
10
01
11
10
11
10
ab
00 01
cd
00 F=0 F
cd
00
01
11
10 F=0
John Knight
27
John Knight
0
0
1
1
c
c
c
c
0
1
1
0
(0 + c
(0 + c
(0 + c
(0 + c
0+c
0+c
1+c
1+c
c0)
c1)
c1)
c0)
100
101
111
110
28
F
0cc
cc+c
1
c
Type of hazard.
No more hazard
Dynamic
No more hazard
ab
a
00
01
11
10
00
11
10
01
cd
ab
a
00
01
11
10
00
f1
01
11
10
This F has masked the embedded static hazard and thus the dynamic hazard.
John Knight
29
John Knight
b c d
1 0 1
1 1 1
(a +1)
(a +1)
1
1
30
Type of hazard.
No hazard
No hazard
a
f
b)
a)
f
b
c)
F = a(a + b) + b(a + b) + (a + b)
Potential hazards in both a and b.
Table to expose hazards in b with a fixed.
John Knight
a(a + b) + b(a + b) + ab
0
1
F
b
b + bb + b
31
Type of hazard.
No hazard
Static-1 hazard
Explanation of b + bb + b
FIG. 1-23
bb
b+b
John Knight
32
John Knight
33
John Knight
34
John Knight
Map of function
F = bx + ax
It is of
The hazards must all be static-1.
Hazard when a,b = 1,1.
Add term ab to mask the hazard.
F = bx + ax + ab
Is shown on the right.
ab
x
00 01
bx
35
11 10
0
ax
ab
x
0
00 01 11 10
0
0
bx
ab
FIG. 1-25
ax
36
F = ab + bc + bcd
Then add circles which cover the arrows; FIG. 1-26(right).
The hazard free equation, on this final map, is -
F = ab + bc + bd + ac + ad
FIG. 1-26
cd
cd
ab
00
01
11
10
ab
00
01
11
10
ab
00
01
11
10
00
00
bcd
bc
00
01
01
01
11
11
11
ad
1
ac
10
10
10
0
ab
bcd
bc
F = ab + bc + bcd
John Knight
37
F = ab + bc + bcd + ac + ad
Distributive Laws
Normal Law
(a + b)x = bx + ax
FIG. 1-27
ab + x = (a + x)(b + x)
John Knight
38
F = ab + b(c + d) + a(c + d)
= ab + (a + b)(c + d)
= ab +
F = ab + u
F = (a + u)(b + u);
3 parallel paths
u = (a + b)(c + d)
F => (0 + b)(b + b)
b
a
c
d
u
a
u = (a + b)(c + d)
39
F = (a + u)(b + u)
Two-variable-change hazards
FIG. 1-28
AB00 01 11 10
BX
A
X
AX
BX
0
AX
BX
F
AX + BX + BX
BX
John Knight
40
Two-variable-change hazards
AB00 01 11 10
BX
AX
BX
0
AB00 01 11 10
BX
AX
BX
0
AB00 01 11 10
BX
AX
0 AB
F= AX + AB +BX
When AB=10 => F = X + X
When AX=11 => F = B + B
Maskable, single-variable, static-1, hazards.
John Knight
41
Two-variable-change hazards
00
01
AB
AB 0
A
B
RAYDON
DECAY
COSMIC
RAY
AB
AIR
DETECTOR B
John Knight
Wont Cancel
DETECTOR A
May Cancel
AB + AB
AB
42
Recall
AB = AB + AB
AB
CD
There are
squares through which this
P variable transition may travel.
P=2
00
01
11
10
AB
CD
00
00
01
01
11
11
10
10
P=3
00
01
11
10
For static hazards F has the same value before and after the changes.
a + a,
c + c,
aa,
P=2
AB
CD
00
01
P=3
11
00
10
AB
CD
00
01
11
10
00
01
01
11
11
10
10
cc,
a+a + c+c,
John Knight
aacc,
c+c +aa.
43
AB
CD 00
Start
End
P=2
01
11
10
01
11
11
10
00
Squares
in path
10
AB
CD 00
01
00
01
11
1
1
1
1
10
John Knight
A change
AB
CD 00 01
00
01
01
11
11
10
10
C change
44
11 10
A change
AB
CD 00 01
00
11 10
D change
A change
CD
AB
00
01
11
10
00
F = AB + ABD + CD + BCD
01
11
F=A+A+C+C
10
Set BD=11
F= A + A + CC
John Knight
45
C1
DA
DA
DA
DA
1D
1D
1D
1D
AB
CD 00
A
B
C
D
01
11
10
00
COMBINATIONAL
P=4
01
LOGIC
11
2P=16
10
GLITCH HEAVEN
John Knight
46
The flip-flops only respond in the circled region on the waveforms below.
A glitch at any other time will not influence state of the machine.
The glitches die out long before the clock edge.
The glitches have negligible influence.
INPUT
CLOCK
1D
Q1
D2
C1
1D
Q2
C1
slow
D3
1D
Q3
C1
D INPUT
CLOCK
Q1
D2
Q2
D3
Q3
47
RESET
GLITCH HEAVEN
CLK
C1
DA
1D
DA
1D
DA
1D
DA
1D
A
B
C
D
COMBINATIONAL
LOGIC
S1 1
R
C1
1D
1D
1D
1D
KILLER GLITCH
John Knight
48
1
q
C1
G1
C
Q = DC + Cq
Q= C+C
Q = DC + Cq +Dq
SET D=1, q=1
Q = 1C + C1 +1
Q= 1
Hazard-free latch
John Knight
49
Memories
Memory chips are asynchronous latches, and are sensitive to
glitches.
Memory control leads must be glitch free.
DA
QA
John Knight
50
C1
CLK
1D
1D
QA
1D
1D
FALSE SIGNAL
FIG. 1-34
En
C=0
B=1
En
En
En
En
Enable C
0=off
Enable D
1=on
0=off
Enable A
Enable B
A short high-current glitch on a bus Normally does not damage the gates (at least in the short term).
It causes a dip in the power supply voltage.
This may cause flip-flops or memory cells to change state.
John Knight
51
A=1
En
0=off
Enable A
B=1
En
0=off
Enable B
C=1
En
Enable C
En
0=off
Enable D
John Knight
52
A
A
A rule of thumb
A pulse shorter than the propagation delay of the gate
will not pass through it.
This is called gate inertia or inertial delay.
Propagation
Delay
B
A
B
Synchronous circuits would have many many glitches except for inertial delay.
Digital simulator software uses inertial delay to keep simulation waveform displays
from being a wasteland of glitches.
Simulators normally suppress glitches shorter that a certain duration.
The default duration is the propagation delay of the gate passing the glitch.
John Knight
53
FIG. 1-36
xw 00 01 11 10
0
1
0xc
FIG. 1-37
John Knight
xw
xw
s@0
z = xc + cw +xw
xc
cw
Map for z
z = xc + cw +xw
A circuit with a
masked hazard,
and an
xw 00 01 11 10
cw
cw
0xc
54
Basic static-1 hazard circuit from FIG. 1-3 ( FIG. 1-39 left).
With delays balanced, glitch is eliminated.
x
delay
0
0
Adding too much delay will make the glitch appear on the opposite input edge.
FIG. 1-39
Falling
x
to x
delay
0
0
55
C1
DA
1D
DA
DA
DA
AB
1D
CHAIN STRUCTURE
1D
C
D
1D
C1
DA
1D
DA
DA
DA
John Knight
1D
1D
1D
A
B
AB
F
CD
TREE(Chopped Dow
STRUCTURE
56
John Knight
57
Summary Of Hazards
Single variable change hazards
Can be found and cured.
John Knight
58