61
Combinational Brandon L Fernandes University of Southern California

Combinational Hazards Brandon L Fernandes University of Southern California

Embed Size (px)

Citation preview

Page 1: Combinational Hazards Brandon L Fernandes University of Southern California

Combinational

Brandon L FernandesUniversity of Southern California

Page 2: Combinational Hazards Brandon L Fernandes University of Southern California

Table Of Contents

Delays in Logic Networks. What are Hazards, and what causes them?

Coping with hazards.

Transition types.

Hazard types. Hazard detection using the Karnaugh map.

(S1) hazards. Vacuous implicants and (S0) hazards.

Page 3: Combinational Hazards Brandon L Fernandes University of Southern California

Dynamic hazards.

Can all hazards be eliminated?

Multilevel network hazard detection. Boolean transformation.

Substitution.

Eight-valued algebra.

Page 4: Combinational Hazards Brandon L Fernandes University of Southern California

Every wire within an IC can be modeled as a transmission line.

Delays In Logic Networks - Line delays

R

CModeled circuit(lumped)

The R an C elements causes the speed of a signal to decrease as it passes through a wire.

Page 5: Combinational Hazards Brandon L Fernandes University of Southern California

Also, there exist a delay between the input and output transition of every gate.

Input (I/p) Output (O/p)

I/p

O/p

Gate Delays

Delay

Page 6: Combinational Hazards Brandon L Fernandes University of Southern California

Delays and Hazards

These delays (line & gate delays) may result in undesired output changes in certain asynchronous combinational networks .

Such networks are said to have combinational hazards.

Page 7: Combinational Hazards Brandon L Fernandes University of Southern California

What do we do when there is a Hazard?

Use a synchronous network .

Redesign the logic to eliminate the hazard if possible.

Insert delays into the network.

Now lets take a closer look at delays that can be inserted into a network to suppress hazards.

Page 8: Combinational Hazards Brandon L Fernandes University of Southern California

1 The Pure Delay Model , and

2 The Inertial Delay Model

There are two different types of delay models

Delay models

Page 9: Combinational Hazards Brandon L Fernandes University of Southern California

Input

t

To explain these two models, we consider the following waveform applied to the input of a delay element.

Delay elementInput Output

Page 10: Combinational Hazards Brandon L Fernandes University of Southern California

In case of a pure delay element , the output waveform is a replica of the original waveform , delayed , by an amount T

Input

Output

t

t

Pure Delay Element

T

Page 11: Combinational Hazards Brandon L Fernandes University of Southern California

In case of an inertial delay element, the output changes if the input state changes and remains constant for a large amount of time. This delay element acts like a filter .

Input

Output

t

t

Input state changes and remains constant for A long time……..

…..Hence output state changes

Inertial Delay Element

Got filtered

out

Got filtered

out

Page 12: Combinational Hazards Brandon L Fernandes University of Southern California

Combinational hazards are analyzed in terms of whether or not the o/p changes in response to an i/p transition.

In case of a Static i/p transition, the o/p should be constantly 0 or constantly 1 .Such transitions are called Static zero (SO) ,and Static one (S1) transitions respectively.

Transition Types

AND

0 0 0

AND 0 1 OR 0

1

O/p remainsThe same

(S1) transition

Page 13: Combinational Hazards Brandon L Fernandes University of Southern California

If the output of a network is supposed to change in response to an input transition, then the transition is Dynamic .

AND

1 1 1

AND

1 0 OR

0

1

0

0

O/p changes

Dynamictransition

Page 14: Combinational Hazards Brandon L Fernandes University of Southern California

Function Vs Logic Hazards

A Logic Hazard is the result of poor combinational logic design. It is removable by redesigning the network.

A Function Hazard is innate in the function itself and cannot be removed by redesigning the network .

Note that the critical characteristic used to distinguish between the two types of hazards is whether or not the hazard is removable.

Page 15: Combinational Hazards Brandon L Fernandes University of Southern California

Function hazard detection by Karnaugh maps

1 Draw the transition cube for the transition. This will give you all minimal paths from source to destination .

2 If the specified function value changes more than once along some minimal path, then there is a function hazard.

Transition cube

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv 00 01 11 10 00 01 11

10 xy

Initially Output =1

Output = 0Output =1

(S1) Funct.Hazard

Page 16: Combinational Hazards Brandon L Fernandes University of Southern California

Facts About Function Hazards

Function hazards cannot be removed by redesignof combinational logic.

The only way to get rid of it is by inserting delays.

SIC (Single Input Changes) cannot cause a function hazard. -Why?-

Ans: This is because the transition cube cannot have a minimal path that contains more than one output change.

Page 17: Combinational Hazards Brandon L Fernandes University of Southern California

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv 00 01 11 10 00 01 11

10 xy

Static 1 Hazards in SOP networksConsider a SOP implemented function g(x,y,u,v) with input transition from uvx’y to uvxy.

If the transition cube is not covered by an AND gate then the transition will result in a (S1) Hazard.

Transition cube

Not covered by any AND gate

In case of POS: If the transition cube is not covered by an OR gate then the transition will result in a (S0) Hazard.

Page 18: Combinational Hazards Brandon L Fernandes University of Southern California

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv 00 01 11 10 00 01 11

10 xy

Why Does the (S1) Hazard Occur ?

A

B

Lets suppose that the SOP consist of AND gates A and B , followed by an OR gate.

Initially, gate A is on, hence………………… o/p = 1

During the transition, there is a possibility that both gates A, B turn off, hence …………o/p=0

And finally , gate B comes on hence ………….o/p=1

(S1) Hazard

o/p(S1)

Hazard

A is ON B is ON

A, B are OFF

Page 19: Combinational Hazards Brandon L Fernandes University of Southern California

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv 00 01 11 10 00 01 11

10 xy

Avoiding the Static 1 hazard Again consider the SOP implemented function g(x,y,u,v) with input transition from uvx’y to uvxy.

Include an extra AND gate which covers the transition cube.

Transition cube Is Now covered by an AND Gate.

But it’s not always possible to cover the transition cube with a AND gate. In that case, the hazard is a (S1) function hazard.

Page 20: Combinational Hazards Brandon L Fernandes University of Southern California

Vacuous implicants and (S0) hazards in SOP networks

(S0) hazards generallygenerally don’t occur in SOP networks.

The only way they can occur is if there exist a vacuous implicant, that comes in the transition path.

Page 21: Combinational Hazards Brandon L Fernandes University of Southern California

Vacuous Implicants are those that contain contradictory pair of inputs .

AND A

a’ c’ c

What are Vacuous Implicants?

Suppose that we had a 2-level SOP network for the K-map:

0 0 1 0

0 0 1 0

0 0 1 0

0 0 1 0

ab 00 01 11 10

00 01 11 10 cd

AND B

a b OR O/p

Vacuous implicant

Contradictory inputs

Page 22: Combinational Hazards Brandon L Fernandes University of Southern California

Now suppose initially a=0 b=0 c=0 c’=1, d=1

Hence o/p should continue to remain 0Now suppose that c changes from 0 to 1

AND A

a’ c’ c

0 0 1 0

0 0 1 0

0 0 1 0

0 0 1 0

ab 00 01 11 10 00 01 11 10

cd

AND B

a b OR O/p

Hence o/p = 0

Page 23: Combinational Hazards Brandon L Fernandes University of Southern California

AND A

a’ c

c

We redraw the AND A gate from the previous diagram , showing how c’ was obtained

Lets have a closer look into the matter

O/p to OR gate

c’

Page 24: Combinational Hazards Brandon L Fernandes University of Southern California

AND A

a’ c

c

Now suppose a=0 , a’=1, b=0 , c=0 , c’=1Hence o/p = 0

a’ c c’ o/p

Now suppose that c changes from 0 to 1

Inverter delay

(S0) Hazard

Then c’ changes from 1 to 0 with some delay

c’O/p to OR gate

Page 25: Combinational Hazards Brandon L Fernandes University of Southern California

But Why Would Anyone Include a Vacuous Implicant?

Of course, in a two level network the no one would purposely do such a thing.

However when analyzing multilevel networks, we use transformations which convert multilevel networks to two level networks that sometimes have vacuous implicants.

Page 26: Combinational Hazards Brandon L Fernandes University of Southern California

How To Get Rid of (S0) Logic Hazards in SOP Networks

It is clear that the (S0) hazard in an SOP network, due to Vacuous implicants, is a Logic Hazard.

To get rid of the (S0) hazard, simply get rid of the vacuous implicant.

POS networks : Vacuous implicates in the case of POS networks can give rise to (S1) logic hazard, which can beeliminated by removing the OR gates with contradictoryinputs.

Page 27: Combinational Hazards Brandon L Fernandes University of Southern California

(S0) Function Hazards in SOP Networks

If the transition cube intersects a non-vacuous implicantof some AND gate, then there is a (S0) function hazard for the network

0 0 1 0

0 0 1 0

0 0 1 0

0 0 1 0

uv 00 01 11 10 00 01 11

10 xy

Non Vacuous Implicant

TransitionCube

Such transitions could generate a temporary 1 at the output.

Intersection

transition

Page 28: Combinational Hazards Brandon L Fernandes University of Southern California

(S1) Function Hazards in POS Networks

If the transition cube intersects a non-vacuous implicateof some OR gate, then there is a (S1) function hazard for the network

1 1 0 1

1 1 0 1

1 1 0 1

1 1 0 1

uv 00 01 11 10 00 01 11 10 xy

Non Vacuous Implicate

TransitionCube

Such transitions could generate a temporary 0 at the output.

Intersection

transition

Page 29: Combinational Hazards Brandon L Fernandes University of Southern California

Dynamic Hazards in SOP networks

There are two types of dynamic hazards

The first kind is caused because of vacuous implicants.

The second type is relatively difficult to spot, and arises due to unmatched gate speeds.

Page 30: Combinational Hazards Brandon L Fernandes University of Southern California

Dynamic Hazards Without Vacuous Implicants

Now suppose that there is a dynamic transition from uvx’y’ to u’vx’y

Consider a function implemented as a SOP with AND gates A , B and C following

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv 00 01 11 10 00 01 11

10 xy

A

B

CTransition cube

The transition cube is as shown .

Page 31: Combinational Hazards Brandon L Fernandes University of Southern California

Dynamic Hazards Without Vacuous Implicants

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv00 01 11 10 00 01 11 10

xy

A

B

C

Transition cube

We assume that A is a slow gate and B is a fast gate

We also assume the following transition uvx’y’ to uvx’y to u’vx’y

Page 32: Combinational Hazards Brandon L Fernandes University of Southern California

Dynamic Hazards Without Vacuous Implicants

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

uv 00 01 11 10 00 01 11

10 xy

A

B

C

Transition cube

Consider the first transition

O/p

Because of our assumption that A is a slower gate than B,B comes on and causes the output to go high

Page 33: Combinational Hazards Brandon L Fernandes University of Southern California

Dynamic Hazards Without Vacuous Implicants

uv 00 01 11 10

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

00 01 11 10 xy

A

B

C

Transition cube

O/p

Now consider the second transition

The B gate responds first and its output goes to 0, causing the o/p to go to 0

After a long time , the A gate responds and goes high causing the o/p to go high

HAZARD

Page 34: Combinational Hazards Brandon L Fernandes University of Southern California

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

00 01 11 10

00 01 11 10

A

B

C

Transition cube

How do you get rid of such a hazard?

Just remove the AND gate B and you will get rid of the dynamic hazard

Page 35: Combinational Hazards Brandon L Fernandes University of Southern California

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

00 01 11 10

00 01 11 10

A

C

Transition cube

Having removed the AND gate B, the K-map becomes

Page 36: Combinational Hazards Brandon L Fernandes University of Southern California

0 0 0 0

0 1 1 0

0 0 1 1

0 0 0 0

00 01 11 10

00 01 11 10

A

C

Transition cube

By removing the and gate, you have introduced a (S1) hazard

Does removing the AND Gate solve our problem ?Yes and NO

Page 37: Combinational Hazards Brandon L Fernandes University of Southern California

So, the conclusion we draw from the example is:

You are always able to redesign the network to eliminate any particular logic hazard, but…………..

You may not be able to get rid of all the logic hazards.

Page 38: Combinational Hazards Brandon L Fernandes University of Southern California

Hazards in Multilevel Logic Realization

We cannot analyze logic hazards in multilevel networks using Karnaugh map techniques.

Some of the techniques used to analyze multilevel networks are:

Boolean Transformation

Substitution

Eight Valued Algebra

Page 39: Combinational Hazards Brandon L Fernandes University of Southern California

Multilevel Hazard Analysis Using Boolean Transformations

In the case of Boolean transformations, we convert a multilevel network into an equivalent 2-level SOP network.

Only Boolean transformations that preserve logic hazards Can be used in the transformations.

MultilevelNetwork

2-level SOP Network

Boolean transformations

That preserve hazards

Page 40: Combinational Hazards Brandon L Fernandes University of Southern California

What Kind of Boolean Transformations Can We Use?

The following transformations preserve logic hazards

Double Inversion x = x

Commutative Laws

Associative laws

The following principles do not preserve logic hazards

x + x = 1

x x = 0

DeMorgans Law

Distributive laws preserve static hazards only.

Function hazards are not affected by any the above transformations.

Page 41: Combinational Hazards Brandon L Fernandes University of Southern California

Example 1 (Generalized substitution): Suppose that we have to find out if the following network implementation had a hazard: F(x, y, z, t) = (xz’ + yz)(xy’t)

For the input transition 0101 0110

The transition is from 0 1 0 1 to

0 1 1 0 0 1 u

Hence, what we have to find is F(0, 1, u, u’)

u’

Page 42: Combinational Hazards Brandon L Fernandes University of Southern California

We have to find F(0,1,u,u’)

F(0, 1, u, u’) = (0u’ +1u)(0.0.u’)

= ( 0 + u)(0)

= 0

Hence, this is a hazardless transition.

F(x, y, z, t) = (xz’ + yz)(xy’t)

Page 43: Combinational Hazards Brandon L Fernandes University of Southern California

Example 2 (Generalized substitution): Suppose that we have to find out if the following network implementation had a hazard: F(x,y,z,t)=(xz’ + yz)(xy’+yz’)(t)

For the input transition 0101 0110

The transition is from 0 1 0 1 to

0 1 1 00 1 u

Hence, what we have to find is F(0, 1, u, u’)

u’

Page 44: Combinational Hazards Brandon L Fernandes University of Southern California

We have to find F(0,1,u,u’)

F(0, 1, u, u’) = (0u’ +1u)(0.0+1u’)(u’)

=( u )( u’)(u’)

Resist the temptation to simplify this as = 0

Doing so will destroy hazards.

If the simplification yields anything other than 1 ,0, u, or u’, then there is a hazard present.

Hence the transition has a hazard.

F(x, y, z, t) = (xz’ + yz)(xy’+yz’)(t)

Page 45: Combinational Hazards Brandon L Fernandes University of Southern California

Hazard Detection Using 8 Valued Algebra

This method differentiates between static and dynamic hazardsbut not between logic and function hazards

It makes use of 8 values , hence the name:

0 0~11~

Static 0 transitionStatic 0 transition with a hazardStatic 1 transitionStatic 1 transition with a hazardDynamic transition from 1 to 0Dynamic transition from 0 to 1 with a hazardDynamic transition from 0 to 1Dynamic transition from 0 to 1 with hazard~

~

The ~ signifies a hazard

Page 46: Combinational Hazards Brandon L Fernandes University of Southern California

8 Valued algebra

Just like Boolean algebra, Boolean operations like and, or can be carried out with these 8 values.

Evaluation of these operations entails intuitions for Worst case situations

Lets consider an example:

+ = ?

Page 47: Combinational Hazards Brandon L Fernandes University of Southern California

+ = ?

We observe that the operation involves the or + operator.

We also observe that the operands are hazardless 0 to1 and 1to 0 transitions.

Because the operator is or the output must continue to remain high

Logic 1O/p

Operand 1

Operand 2

(expected)

Example:

Page 48: Combinational Hazards Brandon L Fernandes University of Southern California

Operand 2

Logic 1O/p

Operand 1

Now as a worst case , lets assume that the first input (operand 1) goes high after the second input (operand 2) goes low.

As you can see this causes a hazard in the output waveform.

+

S1 Hazard

= 1~

Page 49: Combinational Hazards Brandon L Fernandes University of Southern California

. = ?

We observe that the operation involves the AND operator.

We also observe that the operands are hazardless 0 to1 and 1to 0 transitions.

Because the operator is AND the output must continue to remain low.

Logic 0O/p

Operand 1

Operand 2

(expected)

Example:

Page 50: Combinational Hazards Brandon L Fernandes University of Southern California

Operand 2

Logic 0

O/p

Operand 1

Now as a worst case , lets assume that the first input (operand 1) goes high before the second input (operand 2) goes low.

As you can see this causes a hazard in the output waveform.

.

(S0) Hazard

= 0 ~

Page 51: Combinational Hazards Brandon L Fernandes University of Southern California

. = ?

We observe that the operation involves the AND operator.

We also observe that the operands are hazardless 0 to1 transitions.

Because the operator is and , the output must go from 0 to 1.

Logic 1O/p

Operand 1

Operand 2

(expected)

Example:

Page 52: Combinational Hazards Brandon L Fernandes University of Southern California

Operand 2

Logic 1O/p

Operand 1

Now as a worst case , lets assume that the first input (operand 1) goes high after the second input (operand 2) goes high.

As you can see there is no hazard in the output waveform.

+

No Hazard

=

Page 53: Combinational Hazards Brandon L Fernandes University of Southern California

There are many different combinations of the 8 operands and operators, but the results need not be memorized.

They can be easily derived as we have just seen.

Techniques in Advanced Switching Theory gives detailed truth tables .

You are advised to practice obtaining some of the results, using themethod of worst case analysis described before.

Page 54: Combinational Hazards Brandon L Fernandes University of Southern California

Example 3 ( 8 Valued algebra): Suppose that we have to find out if the following network implementation had a Hazard: F(x,y,z,t)=(xz’ + yz)(xy’t)

For the input transition 0101 0110

The transition is from 0 1 0 1 to

0 1 1 00 1

Hence, what we have to find is F(0, 1, , )

8 valued transition

Page 55: Combinational Hazards Brandon L Fernandes University of Southern California

F(x, y, z, t) = (xz’ + yz)(xy’t)

What we have to find is F(0,1, , )

F(0,1, , ) = (0 +1 )(0.0 )

= 0

Hence, this is a (S0) hazardless transition.

Page 56: Combinational Hazards Brandon L Fernandes University of Southern California

Example 4 (8 Valued algebra): Suppose that we have to find out if the following network implementation had a Hazard: F(x, y, z, t) = (xz’ + yz)(xy’+z’y)(t)

For the input transition 0101 0110

The transition is from 0 1 0 1 to

0 1 1 00 1

Hence, what we have to find is F(0,1, , )

8 valued transition

Page 57: Combinational Hazards Brandon L Fernandes University of Southern California

F(x, y, z, t) = (xz’ + yz)(xy’+z’y)(t)

What we have to find is F(0,1, , )

F(0,1, , ) = (0 + 1 )(0.0+ 1)( )

= ( )( )( )

This transition results in a static 0 hazard.

=0~ ( we have proved this before)= ( )( )

We can prove that ( )( ) = hence,

Page 58: Combinational Hazards Brandon L Fernandes University of Southern California

References

Techniques in Advanced Switching Theory by Professor J. Ellison, Chapter on Combinational Hazards (Ch4).

USC’s EE 552 Lecture Notes Spring 2001, Professor. J Ellison.

EE 552 Spring 2001 Handout Set 3-Part on Combinational Hazards.

EE 552 Spring 2001 Homework L.

Page 59: Combinational Hazards Brandon L Fernandes University of Southern California

 Referenced material: Slide no. 5EE 552 Class Notes Spring 2001 –Lecture on Combinational Hazards-Prof. Ellison

Slide no.6EE 552 Class Notes Spring 2001 –Lecture on Combinational Hazards-Prof. Ellison

Slide no 7Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-1

Slide no 8Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-2

Slide no 9,10,11,12 EE 552 Class Notes Spring 2001 –Lecture on Combinational Hazards-Prof. Ellison 

Page 60: Combinational Hazards Brandon L Fernandes University of Southern California

Slide no 13Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-3(Definitions of Static and Dynamic transitions)

Slide no 14Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-3(Definitions of Static and Dynamic transitions)

Slide no 15Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-3(Definitions of Logic and function Hazards)

Slide no 16Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 section 4.3(Method of Function Hazard detection Using Transition Cubes)

Slide no 17Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-7

Slide no 18,19,20Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 Paraphrased from Theorem 1 ( Static One hazards for SOP networks) and its Dual .

Slide no 21 to 29Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 Paraphrased from Theorem 2 ( Static 0 hazards for SOP networks) and its Dual . Pages 4-9----4-11 EE 552 Class Notes Spring 2001 –Lecture on Combinational Hazards-Prof. EllisonThe example on how a vacuous implicant actually works, is taken from the lecture notes.

   

Page 61: Combinational Hazards Brandon L Fernandes University of Southern California

Slide no 30 to 38

This part of the presentation explains in detail with animation ,how (S0) hazards can arise in the case of non vacuous implicants. It builds from material in the Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-11---4-14

Slide no 39,40,41Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-21--------4-22

Slide no 42,43,44,45The Example 1 and example 2 are taken from the homework set given to the ee552 class during spring 2001

Slide no 46Techniques in Advanced Switching Theory By Prof .J. Ellison Chapter 4 page 4-21--------4-22

Slide no 47 to 54 These slides explain how to derive the tables 4.2, 4.3, 4.4 of Techniques in Advanced Switching Theory By Prof .J. Ellison. These slides were made on basis of Prof. Ellison’s EE 522 lecture on hazards during Spring 2001. Slide no 55 to 58 Examples 3 and 4 are taken from the homework set L given to the EE552 class during Spring 2001