Professional Documents
Culture Documents
Hazards and Glitches in Digital Ckts
Hazards and Glitches in Digital Ckts
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
1
Hazards
Glitches and a Hazards
A glitch is a fast “spike” usually unwanted.
static-one hazard;
signal is one, glitch falls.
dynamic hazard;
signal is changing, up or down
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
2
Glitches and Hazards in Digital Circuits The Two Basic Static-Hazard Circuits
x 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.
FIG. 1-2 An embedded static-0 hazard
0
1 1
x
x x x
0 x
x 0
x x
1 0
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
3
Glitches and Hazards in Digital Circuits The Two Basic Static-Hazard Circuits
Any circuit with a static-1 hazard must reduce to the equivalent circuit of FIG. 1-3
1 0
0 x
x
0 x
1 1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
4
Glitches and Hazards in Digital Circuits The Two Basic Dynamic-Hazard Circuits
delay
FIG. 1-6 The basic dynamic hazard
circuit with its imbedded
static-0 hazard.
Note that a dynamic hazard always has three parallel paths.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
5
Glitches and Hazards in Digital Circuits The Two Basic Dynamic-Hazard Circuits
x 0
• 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.
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 ”Summary Of Hazards” on page 36.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
6
Glitches and Hazards in Digital Circuits Hazards on a Karnaugh Map
x x
Standing on top of a hill gives a “1.”
0 1 0 1 Changing hills causes a “0” glitch as one
1 0 0 1 crosses the valley.
K-map of y=x K-map of y=x
x=0 x=1
An interpretation of the K-map of y.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
7
Masking a Hazard.
To mask static-1 hazards add a gate that stays high across the transition.
This gate is logically redundant.
AB FIG. 1-11 The equation
X 00 01 11 10 F = BX + AX
0 0 BX 0
AB
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
8
Glitches and Hazards in Digital Circuits DeMorgan’s General Theorem (Review)
Examples
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
9
F = (X·B) + (X·A)
2. Map F on a Karnaugh map
AB
This is a Σ of Π which is easy to map. X 00 01 11 10
0
F = X·B + X·A
1
Π of Σ map for F
F = (X + B)·( X + A)
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
10
Glitches and Hazards in Digital Circuits Showing a Static-0 Hazards
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
11
Glitches and Hazards in Digital Circuits Static-0 Hazard with Map Wrap Around
XD
FIG. 1-13 Get Π of Σ map
E 00 01 11 10 F = (D + X)(E + X)
D+X
0 1 E+X
1 1 1 1 F = (D·X)+(E·X)
1 1 1 1
D The hazard is X,D,E = 1,0,0 to 0,0,0.
X D+X hazard The term which stays 0 across the
gap is X,D,E = -,0,0, or (D + E).
D+E F= (D + X)(E + X) (D + E) XD
E 00 01 11 10
E D+E D+E
E+X
1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
12
Glitches and Hazards in Digital Circuits Algebra and Hazards.
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)
xy + x = x (x + y)x= x
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
13
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-15 x
x Static-0 Dynamic
xx xx + x
Static-1 x Dynamic
x
x+x (x + x )x
An Example
Below, a hazard in x must reduce to a basic hazard circuit when c=1 or when c=0.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
14
Glitches and Hazards in Digital Circuits Algebra of Hazards
c x (c + x )(x + x)
x cx + x
c
Static-1 hazard
cx + x = (c + x )(x + x)
When c=1 x + x (1 + x )(x + x) = x + x Static-1 hazard when c = 1;
(0 + x )(x + x) = x(x + x) Dynamic hazard when c = 0
x x
c c
Masked Hazard
xc(c + x ) = xc + xcx
When c=1 x1(1 + x ) = x x1 + x1x = x + xx Dynamic hazard when c = 1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
15
DeMorgan x+x = xx
a +b = a ·b
xx + x = (x + x)x
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
16
Glitches and Hazards in Digital Circuits Method
Method
1. (A + X) + X·C
Step 1) Remove confusing extended overbars.
using DeMorgan. => A·X + (X + C)
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
17
Example
Find All The Hazards In F.
b
c
F
a
Method
b+c+a+c+c+d
This is legal because DeMorgan’s law does not change hazards
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
18
Glitches and Hazards in Digital Circuits Step 1) Remove confusing extended overbars.
A ·B = C = A+B D·E
D+E = F =
A C A C
AND D F D F
B B AND OR OR
E E
NOR NOR
NOR NOR
i ) Select alternate levels starting at output. ii) Transform gates
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
19
Glitches and Hazards in Digital Circuits Step 1) Remove confusing extended overbars.
d
To check which variables can have hazards.
Check which variables have x and x
F = (a + c)(b + c) + cd
\ Only c has both c and c terms.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
20
Glitches and Hazards in Digital Circuits Step 3. Locating Hazards From the Circuit
a b cd (a + c) (b + c) + cd F Type of hazard.
0 0 c 0 (0 + c) (0 + c) + c0 cc Static-0
0 0 c 1 (0 + c) (0 + c) + c1 cc + c Dynamic
0 1 c 1 (0 + c) (1 + c) + c1 c+c Static-1
0 1 c 0 (0 + c) (1 + c) + c0 c
1 0 c 0 (1 + c) (0 + c) + c0 c
1 0 c 1 (1 + c) (0 + c) + c1 c+c c
1 1 c 1 (1 + c) (1 + c) + c1 1+c 1
1 1 c 0 (1 + c) (1 + c) + c0 1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
21
Glitches and Hazards in Digital Circuits Same Example With More Organization and
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
22
Glitches and Hazards in Digital Circuits Same Example With More Organization and
Example:
Find all the single-variable change hazards
f = ( abc + acd )( abc + de )
Note only c or d can have hazards.
a bcd e ( abc + acd)(abc + de )
a bcd e ( abc + acd)(abc + de ) a must be 0 (a = 1), or no c or d
0 bcd e ( bc + cd )( bc + de ) = (bc + cd)(bc + de)
0 cde b = 1 or no c = (c + cd )( c + de)
0 1c e if d is 1 = (c + c)( c + 0 ) = (c + c)c Dynamic for any e
0 1c 0 e if d is 0 = (c + 0)( c + 1e ) = (c)(c + e)
0 1c0 if e is 0 = (c)(c) Static-0
00 c d e try b = 0 = ( 0 + cd)(0 + de) =
001 d 1 if c=1 and e=1 = ( 0 + d)(0 + d) =d·d Static-0
01 c d e try b = 1 = ( c + cd)(c + de)
0 0 d e try c=1 = 0 + 1d)(1 + de) No hazard
0 0 d e try c=0 = ( 1 + 0d)(0 + de) No hazard
1 1
(c + c)c
c a 1 d 1
0 b
0
e c·c
0 0
1 1
1 c
d a 0
0 b 1
0 1 e d·d
c 0
1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
23
Glitches and Hazards in Digital Circuits Locating Hazards; More Complex Exmple
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
24
Glitches and Hazards in Digital Circuits
[(0+bc)d + (b+0)d ]b
= bcd + b·db [cd]
0 1 0
c a b d
1 0 1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
25
Rule I:
a
Except for the gross carelessness of including terms like acc, c
Σ of Π implementations have no static-0 hazards.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
26
Glitches and Hazards in Digital Circuits
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
27
Glitches and Hazards in Digital Circuits Sum-of-Product Circuits Have Only Easily
0 0
Hazard when a,b = 1,1. 1 ax ax
Add term ab to mask the hazard.
F = bx + ax + ab
Is shown on the right.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
28
Glitches and Hazards in Digital Circuits Product-of Sum Circuits Have No Static-1
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
29
Glitches and Hazards in Digital Circuits Product-of Sum Circuits Have Only Easily
ab 00 01 11 10 ab 00 01 11 10 ab 00 01 11 10
bc
00 0 1 1 1 00 0 a·cd 1 1 00 0 1 a·bd 1
01 0 1 0 0 01 0 1 0 0 01 0 1 0 0
11 1 1 1 1 11 1 1 ab 1 1 11 1
bcd 1 1
ac
10 0 0 1 1 10 0 0 1 1 10 0 0 1 1
bc
F = a·b + b·c + a·c·d
F = a·b + b·c + a·c ·d
+ a·c + bcd + a·b·d
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
30
Glitches and Hazards in Digital Circuits Two-variable-change hazards
AB00 01 FIG. 1-25 Start at square A,B,X =1,1,0 (the tail of the arrows)
11 10 Change both B and X to move to square A,B,X =1,0,1
X
0 0 BX AX (the head of the arrows).
1 BX 0 0 If B changes slightly before X,
one travels the upper route .
A
AX The valley between AX and BX may glitch.
X
F A masking term AB can cover the valley.
BX It only removes the glitch on the upper path.
AX + BX + BX
If X changes slightly before B,
one takes the lower path .
B
BX This will always glitch.
It cannot be covered.
Covering the offending “0” changes the function.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
31
Glitches and Hazards in Digital Circuits Multiple Variable Change Hazards are Plentiful
But very fast glitches will be absorbed inside gates (inertial delay)..
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
32
Glitches and Hazards in Digital Circuits Hazards do not hurt synchronous circuits
FIG. 1-27 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 no influence on the state.
Q1 D2 Q2 D3 Q3
INPUT 1D 1D slow 1D
CLOCK C1 C1 C1
D INPUT
CLOCK
Q1
D2
Q2
D3
Q3
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
33
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
34
Glitches and Hazards in Digital Circuits Outputs where hazards are of concern
Memories
Memory chips are asynchronous latches, and are sensitive to glitches.
Memory control leads must be glitch free.
FALSE SIGNAL
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
35
Summary Of Hazards
Single variable change hazards
Can be found and cured.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
36
Glitches and Hazards in Digital Circuits Locating Hazards; Example three
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
37
1
a e no a
0
no a
y(e + b) + b(a·e)
0 1
b c e no b
1 0
no b no b
y(b·c) + bc + acy b·c + bc
1 0 0
c e y b no c
0 1 1
no c no c no c
y·e + be + aey e + be
1 0 1
e c y b e+e
0 1 0
no e no e no e
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
38
Glitches and Hazards in Digital Circuits Example 4
Example 4
Equation.
f = ( abc + acd )( abc + de )
Note only c or d can have a hazard.
a bcde ( abc + acd)(abc + de )
0 cde b = 1 or no c = (c + cd )( c + de)
0 1c e if d is 1 = (c + c)( c + 0 ) = (c + c)c Dynamic for any e
0 1 c 1e if d is 0 = (c + 0)( c + 1e ) = (c)(c + e)
0 1 c 0 01 if e is 0 = (c)(c) Static-0
0 c·c
1 0
c a 1 d e 1
1
0 (c + c)c
b 0 e=1 or 0
0 1 0
d a 1 c e 1
1 d·d
0 b
1 1
c
0
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
39
1. Problem
a) Place arrows on the K-map for F to show where all the single-variable-change static-1 hazards might occur.
b) On another map show what AND terms must be added to F to mask these hazards.
Write the equation for the simplest F you can find that still has masked hazards.
You may change the original four terms of F if it would be beneficial.
d 1 d 1 d 1
1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1
b b b
1 1 1 1 1
a 1 a
1 1 1 a 1 1 1 1 1 1
c c c
F = a·b·c + bc + b·d + abc
2. Problem
Given G = b·a + a·c + b·c·d
(a) State with reasons, but without doing any calculation or map work,:
i) How many static-0 hazards G has.
ii) How many dynamic hazards G has.
(b) Find all the single-variable-change hazards algebraically.
© John Knight Electronics Department, Carleton University Printed; March 24, ’04
Modified; March 24, ’04
40