Design considerations

39
Design Considerations Digital Logic and Software Applications Level 4 © University of Wales Newport 2009 This work is licensed under a Creative Commons Attribution 2.0 License .

description

The following presentation is a part of the level 4 module -- Digital Logic and Signal Principles. This resources is a part of the 2009/2010 Engineering (foundation degree, BEng and HN) courses from University of Wales Newport (course codes H101, H691, H620, HH37 and 001H). This resource is a part of the core modules for the full time 1st year undergraduate programme. The BEng & Foundation Degrees and HNC/D in Engineering are designed to meet the needs of employers by placing the emphasis on the theoretical, practical and vocational aspects of engineering within the workplace and beyond. Engineering is becoming more high profile, and therefore more in demand as a skill set, in today’s high-tech world. This course has been designed to provide you with knowledge, skills and practical experience encountered in everyday engineering environments.

Transcript of Design considerations

Page 1: Design considerations

DesignConsiderations

Digital Logic and Software Applications

Level 4

© University of Wales Newport 2009 This work is licensed under a Creative Commons Attribution 2.0 License.

Page 2: Design considerations

The following presentation is a part of the level 4 module -- Digital Logic and Signal Principles. This resources is a part of the 2009/2010 Engineering (foundation degree, BEng and HN) courses from University of Wales Newport (course codes H101, H691, H620, HH37 and 001H). This resource is a part of the core modules for the full time 1st year undergraduate programme.

The BEng & Foundation Degrees and HNC/D in Engineering are designed to meet the needs of employers by placing the emphasis on the theoretical, practical and vocational aspects of engineering within the workplace and beyond. Engineering is becoming more high profile, and therefore more in demand as a skill set, in today’s high-tech world. This course has been designed to provide you with knowledge, skills and practical experience encountered in everyday engineering environments.

Contents Hazards Static Hazards Dynamic Hazards Function Hazards The simplest example of this is the exclusive-OR function Don’t Care Example Credits

In addition to the resource below, there are supporting documents which should be used in combination with this resource. Please see: Holdsworth B, Digital Logic Design, Newnes 2002 Crisp J, Introduction to Digital Systems, Newnes 2001

Stabilised Power Supplies

Page 3: Design considerations

Hazards What are Hazards ?Hazards are changes in the output when changes

should not logically occur. There are three types of hazard which can occur.

1. Static Hazards

2. Dynamic Hazards

3. Function Hazards

Design Considerations

Page 4: Design considerations

Static HazardsA static hazard is the situation where, when one

input variable changes, the output changes momentarily before stabilizing to the correct value. There are two types of static hazards:

Static-1 Hazard: the output is currently 1 and after the inputs change, the output momentarily changes to 0 before settling on 1

Static-0 Hazard: the output is currently 0 and after the inputs change, the output momentarily changes to 1 before settling on 0

* The above text is taken from http://en.wikipedia.org/wiki/Hazard_(logic) and is available under the Creative Commons Attribution-ShareAlike License.

Design Considerations

Page 5: Design considerations

Static HazardsIn properly formed two-level AND-OR logic based on a

Sum Of Products expression, there will be no static-0 hazards. Conversely, there will be no static-1 hazards in an OR-AND implementation of a Product Of Sums expression.

The most commonly used method to eliminate static hazards is to add redundant logic (consensus terms in the logic expression).

 * The above text is taken from http://en.wikipedia.org/wiki/Hazard_(logic) and is available

under the Creative Commons Attribution-ShareAlike License.

Design Considerations

Page 6: Design considerations

A

B

C

DY

1

2

3

4

5

This particular type of hazard is usually due to a NOT gate within the logic. We can see the effects of the delay in the circuit.

Design Considerations

Static-1 Hazard:

Page 7: Design considerations

What is the equation for the circuit?

What is the output when the inputs equal:A = 1 B = 1 C = 1 D = 1

What is the output when the inputs equal:A = 1 B = 1 C = 0 D = 1

What happens as C changes from 1 to 0?

DCBCBADCBAY

1Y

1Y

Design Considerations

Page 8: Design considerations

INPUT C

AND 3 O/P

NOT 5 O/P

AND 2 O/P

OR O/P

Design Considerations

Page 9: Design considerations

INPUT C

AND 3 O/P

NOT 5 O/P

AND 2 O/P

OR O/P

Design Considerations

Page 10: Design considerations

INPUT C

AND 3 O/P

NOT 5 O/P

AND 2 O/P

OR O/P

Design Considerations

Page 11: Design considerations

INPUT C

AND 3 O/P

NOT 5 O/P

AND 2 O/P

OR O/P

Design Considerations

Page 12: Design considerations

INPUT C

AND 3 O/P

NOT 5 O/P

AND 2 O/P

OR O/P

GLITCH Design Considerations

Page 13: Design considerations

The hazard can be dealt with in two ways:

Either match the delay causing the hazard with another delay by adding a buffer gate which delays a path without changing the state.

Ensure that the hazard does not change the output by forcing the output to stay on using and additional function which is not effected by the input state.

The first option is often the simplest and therefore is most often implemented but it can lead to problems as delays can never be absolutely matched.

'Huffman' discovered that a hazard can be removed by:

“The insertion of a redundant loop can eliminate a static hazard.” Design Considerations

Page 14: Design considerations

The glitch is due to gates delays and should not happen logically.

Does it occur as C changes from 0 to 1? No – as gate 3 turns on before gate 2 turns off.How do we recognise where hazards occur?Look at the Karnaugh Map.

HAZARDS

1

1

0

111 1 0

1 1 1

111 0 1

1 0 0

011C D

B Y

 1100A

Design Considerations

Page 15: Design considerations

A hazard will occur where we have two groups that are next to each other vertically or horizontally which do not overlap.

1

1

0

111 1 0

1 1 1

111 0 1

1 0 0

011C D

B Y

 1100AWhat we do is to add redundant groups to “cover” the change that produces the hazard.

The solution requires two more three-input AND gates and a six-input OR rather than a four-input – but the solution is “hazard-free”.

Design Considerations

Page 16: Design considerations

Dynamic HazardsA dynamic hazard is the possibility of an output changing more than once as a result of a single input change. Dynamic hazards often occur in larger logic circuits where there are different routes to the output (from the input). If each route has a different delay, then it quickly becomes clear that there is the potential for changing output values that differ from the required / expected output. e.g. A logic circuit is meant to change output state from 1 to 0, but instead changes from 1 to 0 then 1 and finally rests at the correct value 0. This is a dynamic hazard.

* The above text is taken from http://en.wikipedia.org/wiki/Hazard_(logic) and is available under the Creative Commons Attribution-ShareAlike License .

Design Considerations

Page 17: Design considerations

Dynamic HazardsAs a rule, dynamic hazards are more complex to resolve, but note that if all static hazards have been eliminated from a circuit, then dynamic hazards cannot occur.

* The above text is taken from http://en.wikipedia.org/wiki/Hazard_(logic) and is available under the Creative Commons Attribution-ShareAlike License.

e.g. A given logic circuit has been design to change output state from ‘0' to ‘1‘ when a certain chane in input occurs, but instead changes from ‘0' to ‘1' then back to ‘0‘ before finally coming to rest at the correct value ‘1'. This is a dynamic hazard.

Design Considerations

Page 18: Design considerations

As we shall see, dynamic hazards require a more complex method to resolve (we shall not cover in

detail). A

C

B1

2

34

5

67

Consider all inputs at logic 0 then B changes to logic 1

Design Considerations

Page 19: Design considerations

A

C

B1

2

34

5

67

0

0

0

0

1

0

11

1

1

Design Considerations

Page 20: Design considerations

A

C

B1

2

34

5

67

00

01

00

00

11

00

1111

11

11

Design Considerations

Page 21: Design considerations

A

C

B1

2

34

5

67

000

011

000

001

110

000

111111

111

111

Design Considerations

Page 22: Design considerations

A

C

B1

2

34

5

67

0000

0111

0000

0011

1100

0001

11101111

1111

1110

Design Considerations

Page 23: Design considerations

A

C

B1

2

34

5

67

00000

01111

00000

00111

11000

00010

1110011111

11111

11100

Design Considerations

Page 24: Design considerations

A

C

B1

2

34

5

67

000000

011111

000000

001111

110000

000100

111000111110

111111

111000

Design Considerations

Page 25: Design considerations

What can be seen is that when B changes from 0 to 1 there is a sequence of changes within the gates which leads to the output changing from 1 to 0 – which is correct.

At one point gates 2 and 7 change simultaneously – Gate 2 goes from 0 to 1Gate 7 goes from 1 to 0

Which keeps the output at 1

Design Considerations

Page 26: Design considerations

A

C

B1

2

34

5

67

0000

0111

0000

0011

1100

0001

11101111

1111

1110

Design Considerations

Page 27: Design considerations

If the AND gate 7 changed just before the AND gate 2 then the OR gate 5 would see two 0’s on its input driving its output low before gate 2 turned on.

This would have the following effect:

This is a dynamic hazard.

Design Considerations

Page 28: Design considerations

Function HazardsFunction hazards are non-solvable hazards which

occur when more than one input variable changes at the same time. Hazards such as function hazards can not be logically eliminated as the problem lies with actual specification of the circuit. The only real way to avoid such problems is to restrict the changing of input variables so that only one input should change at any given time.

Restrictions are not always possible, for instance let us imagine some logic circuit that has two inputs. One input is used for a clock signal, and the other is connected to a random noise source that we wish to measure. It should be clear that restrictions in this case would not be an effective solution. Design Considerations

Page 29: Design considerations

The simplest example of this is the

exclusive-OR function

If both inputs are at 0 then the output is 0 – if they both then change to 1 simultaneously then the output should stay at 0 but delays may cause a short time when the output goes to 1.* The above text is taken from http://en.wikipedia.org/wiki/Hazard_(logic) and is available under the Creative Commons Attribution-ShareAlike License.

Page 30: Design considerations

Don’t CareA logic circuit with N inputs will have will have 2N

possible input combinations. For a number of reasons some of these combinations may never exist, in fact in some applications the majority may not exist.

How do we deal with combinations that cannot occur on the input?

We treat them as don’t cares when simplifying the logic expressions. What we mean is that the output can be 1 or 0 as the input will never occur to generate the output.

On the Karnaugh Map, a don’t care input is indicated by an X.

Design Considerations

Page 31: Design considerations

The following rules are applied when grouping:

X’s do not need to be groupedIf a smaller group can be made bigger by including

X’s – do so.If a group consists only of X’s remove itIf we are looking for a hazard free solution then if

we have an identified hazard point and one of the points of contact is an X – the hazard will not occur so ignore it.

Design Considerations

Page 32: Design considerations

Example

1 2 3

4 5 6

7 8 9

0

ABCD

The numerical pad is used to send information to a logic circuit. The pad has an encoder which converts the number pushed into a 4-bit binary number. A is the most significant bit and D the least.

A logic circuit must recognise if one of the following buttons has been pressed: 2, 3, 4, 7 or 8.Design a logic circuit to do this.

Design Considerations

Page 33: Design considerations

01111

00111

01011

00011

01101

00101

01001

100011

1 011110

0011011

1 101010

10010

0 111100

1010011

0 0

01000

Y0110C D B00000

1100AYDCBA

Design Considerations

Page 34: Design considerations

01111

00111

01011

00011

01101

00101

01001

100011

1 011110

0011011

1 101010

10010

0 111100

1010011

0 0

01000

Y0110C D B00000

1100AYDCBA

Expression

DCBADCBACBADCAY

Design Considerations

Page 35: Design considerations

This is a complicated expression and does not take into account the fact that six of the sixteen input combinations can never exist, as they are never generated. These are 1010 to 1111.

If we regenerate the Karnaugh Map with X’s in

these positions we will have:

DCBADCBACBADCAY

Design Considerations

Page 36: Design considerations

X1111

X0111

X1011

X0011

X1101

X0101

01001

10001XX1

1 011110

00110XX11

1 101010

10010X

0 111100

101001X1

0 0

01000

Y0110C D B00000

1100AYDCBA

Design Considerations

Page 37: Design considerations

X1111

X0111

X1011

X0011

X1101

X0101

01001

10001XX1

1 011110

00110XX11

1 101010

10010X

0 111100

101001X1

0 0

01000

Y0110C D B00000

1100AYDCBA

Expression

DCBCBDADCY

Design Considerations

Page 38: Design considerations

Notes.1. Not all X’s are grouped – this is fine.2. There is a potential hazard in this solution but it

cannot possibly occur.

Compare expressions

DCBADCBACBADCAY

DCBCBDADCY

Design Considerations

Page 39: Design considerations

This resource was created by the University of Wales Newport and released as an open educational resource through the Open Engineering Resources project of the HE Academy Engineering Subject Centre. The Open Engineering Resources project was funded by HEFCE and part of the JISC/HE Academy UKOER programme.

© 2009 University of Wales Newport

This work is licensed under a Creative Commons Attribution 2.0 License. The JISC logo is licensed under the terms of the Creative Commons Attribution-Non-Commercial-No Derivative Works 2.0 UK: England & Wales Licence.  All reproductions must comply with the terms of that licence.

The HEA logo is owned by the Higher Education Academy Limited may be freely distributed and copied for educational purposes only, provided that appropriate acknowledgement is given to the Higher Education Academy as the copyright holder and original publisher.

The name and logo of University of Wales Newport is a trade mark and all rights in it are reserved. The name and logo should not be reproduced without the express authorisation of the University.

Design Considerations