Hazard (logic)

Hazard (logic)

In digital logic, a hazard in a system is an undesirable effect caused by either a deficiency in the system or external influences. Logic hazards are manifestations of a problem in which changes in the input variables do not change the output correctly due to some form of delay caused by logic elements (NOT, AND, OR gates, etc.) This results in the logic not performing its function properly. The three different most common kinds of hazards are usually referred to as static, dynamic and function hazards.

Hazards are a temporary problem, as the logic circuit will eventually settle to the desired function. However, despite the logic arriving at the correct output, it is imperative that hazards be eliminated as they can have an effect on other connected systems.

Contents

Static hazards

A 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

In 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).

Example of a static hazard

Let us consider an imperfect circuit that suffers from a delay in the physical logic elements i.e. AND gates etc. The simple circuit performs the function noting:

f = X1 * X2 + X1' * X3

If we first look at the starting diagram, it is clear that if no delays were to occur, then the circuit would function normally. However since this isn't a perfect circuit, and an error occurs when the input changes from 111 to 011. i.e. when X1 changes state.

Now we know roughly how the hazard is occurring, for a clearer picture and the solution on how to solve this problem, we would look to the Karnaugh Map. The two gates are shown by solid rings, and the hazard can be seen under the dashed ring. The theory proved by Huffman tells us that by adding a redundant loop 'X2X3' this will eliminate the hazard.

So our original function is now: f = X1 * X2 + X1' * X3 + X2 * X3

Now we can see that even with imperfect logic elements, our example will not show signs of hazards when X1 changes state. This theory can be applied to any logic system. Computer programs deal with most of this work now, but for simple examples it is quicker to do the debugging by hand. When there are many input variables (say 6 or more) it will become quite difficult to 'see' the errors on a Karnaugh map.

Dynamic hazards

A 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.

As 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.

Function hazards

Function 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 the 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.

The simplest example of this is the exclusive-or function.

In this scenario it is quite difficult to see how a hazard could occur if the circuit is built up on the same couple of chips. However let us imagine that some circuit designer has split this function across different chips (i.e. one NOT gate on one chip and the other NOT gate is implemented on another chip across the PCB somewhere)

Let us set-up the initial state of our circuit. A = 1, B = 0. Now lets say there is a delay in the NOT gate marked (X). The inputs now change simultaneously so that A = 0 and B = 1 (remember in an equally delayed circuit or a perfect circuit, the circuit output would match the specification). If we observe what the circuit should do, and do not change the output of the NOT gate X (this simulates a delay in gate X), it should be clear that the output of the circuit changes. Now we change the output of NOT gate X and the circuit goes back to the proper state.

The most effective way to solve this hazard would be to carefully design the PCB so that delays are all equal, or at least match the delays on each path. i.e. Delay of A's path = Delay of B's path. Yet adding more gates to the circuit by the same methods as described in dynamic and static hazards will not work as Huffman's method cannot be applied..

See also


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Hazard (computer architecture) — Hazards are problems with the instruction pipeline in central processing unit (CPU) microarchitectures that potentially result in incorrect computation. There are typically three types of hazards: data hazards structural hazards control hazards… …   Wikipedia

  • Hazard (disambiguation) — A hazard is an event posing a threat to life, health, property or environment. Hazard may also refer to:* Chemical hazard, a property of a material dangerous to human life or health * A hazard, for instance a natural hazard, a danger or source of …   Wikipedia

  • Logic gate — A logic gate is an idealized or physical device implementing a Boolean function, that is, it performs a logical operation on one or more logic inputs and produces a single logic output. Depending on the context, the term may refer to an ideal… …   Wikipedia

  • Hegel’s logic and philosophy of mind — Willem deVries LOGIC AND MIND IN HEGEL’S PHILOSOPHY Hegel is above all a systematic philosopher. Awe inspiring in its scope, his philosophy left no subject untouched. Logic provides the central, unifying framework as well as the general… …   History of philosophy

  • The Logic of Violence in Civil War — is a book which challenges the conventional view of violence in civil wars as irrational. The main argument is that violence only emerges in those disputed territories, and it is generally driven not by the conflict itself, but by previous… …   Wikipedia

  • Classic RISC pipeline — In the history of computer hardware, some early reduced instruction set computer central processing units (RISC CPUs) used a very similar architectural solution, now called a classic RISC pipeline. Those CPUs were: MIPS, SPARC, Motorola 88000,… …   Wikipedia

  • Karnaugh map — For former radio station KMAP (1962 1968) in Dallas Fort Worth, see KRLD FM. An example Karnaugh map The Karnaugh map (K map for short), Maurice Karnaugh s 1953 refinement of Edward Veitch s 1952 Veitch diagram, is a method to simplify Boolean… …   Wikipedia

  • Predictive analytics — encompasses a variety of techniques from statistics and data mining that analyze current and historical data to make predictions about future events. Such predictions rarely take the form of absolute statements, and are more likely to be… …   Wikipedia

  • Pneumatics — Pneumatic redirects here. For the highest order of humans in Gnosticism, see Pneumatic (Gnosticism). Preserved Porter Locomotive Company No. 3290 of 1923. Pneumatics is a branch of technology, which deals with the study and application of use of… …   Wikipedia

  • Music of the Front Mission series — Front Mission is a series of tactical role playing games produced by Square Enix (originally Square). The music of the series includes the soundtracks to the main series, composed of Front Mission through Front Mission 5: Scars of the War, as… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”