Fixing hazards in a logic expression

In summary, the conversation is about identifying and fixing hazards in a given expression using a K-map. The participants discuss the use of distributivity and simplification, and ultimately come up with the expression "f = ab + \bar{a}c + bc" which is hazard free.
  • #1
STEMucator
Homework Helper
2,076
140

Homework Statement



Identify and fix all hazards in ##f = (ab + \bar{a}c)(c + \bar{b}) + ab##. Re-check if the final expression obtained is hazard free.

Homework Equations

The Attempt at a Solution



So I used a binary tree and found a static 1 hazard present for ##bc = 11##. The hazard was ##a + \bar{a}##.

To fix this hazard, I need a ##\sum## of ##\Pi## map using ##f##.

I am confused about the term ##(ab + \bar{a}c)(c + \bar{b})##. I don't know how to place it on a K-Map.

I know I can't use the distributive laws because that will introduce dynamic hazards since ##b## and ##\bar{b}## are together.

How would I go about creating the K-Map exactly?
 
Physics news on Phys.org
  • #2
As you have "+ab" at the end, do you need the "ab" in the first bracket at all?
 
  • #3
mfb said:
As you have "+ab" at the end, do you need the "ab" in the first bracket at all?

I would think I do need it. I can't just remove it can I? The first term is an AND term, so I don't have a term of the form ##ab + ab##.
 
  • #4
"((X OR Y) AND Z) OR X" = "(X AND Z) OR (Y AND Z) OR X"
But "(X AND Z) OR X" is just X.

Alternatively, just test all 8 options to verify it.
 
  • #5
Okay, so I can use distributivity and simplification as long as I'm particularly careful about ##b## and ##\bar{b}##:

$$(ab + \bar{a}c)(c + \bar{b}) + ab$$
$$ab(c + \bar{b}) + \bar{a}c(c + \bar{b}) + ab$$
$$ab(c + \bar{b}) + ab + \bar{a}c(c + \bar{b})$$
$$ab + \bar{a}c(c + \bar{b})$$

It's safe to use distributivity now:

$$ab + \bar{a}cc + \bar{a}c \bar{b}$$
$$ab + \bar{a}c + \bar{a}c \bar{b}$$
$$ab + \bar{a}c$$

Drawing the K-Map:

ab\c
0 1
0 1
1 1
0 0

I see I need a term of the form ##bc## to fill the valley. Hence:

$$f = ab + \bar{a}c + bc$$

This expression is hazard free.
 
  • #6
Right.
 

1. How do I identify hazards in a logic expression?

To identify hazards in a logic expression, you first need to simplify the expression using Boolean algebra. Next, you can use a Karnaugh map to visualize the expression and identify any potential hazards. Finally, you can use the Quine-McCluskey method to find and eliminate the hazards.

2. What are the common types of hazards in a logic expression?

The common types of hazards in a logic expression are static-1, static-0, and dynamic hazards. Static-1 hazards occur when there is an unexpected transition from a 1 to another 1. Static-0 hazards occur when there is an unexpected transition from a 0 to another 0. Dynamic hazards occur when there is an unexpected transition from a 1 to a 0 or vice versa.

3. How can I fix static-1 hazards in a logic expression?

To fix static-1 hazards, you can use a Karnaugh map to identify the input combinations that cause the hazard. Then, you can add a redundant term to the expression to eliminate the hazard. This redundant term will not affect the overall output of the expression, but will prevent the unexpected transition from occurring.

4. Can dynamic hazards be completely eliminated from a logic expression?

Yes, dynamic hazards can be completely eliminated from a logic expression. This can be achieved by adding redundant terms to the expression, also known as hazard cover terms. These terms are specifically designed to eliminate dynamic hazards and will not affect the overall output of the expression.

5. How do I know if I have successfully fixed all hazards in a logic expression?

To ensure that all hazards have been fixed in a logic expression, you can use a hazard-free implementation chart. This chart compares the original expression with the simplified expression and indicates whether any hazards have been eliminated. Additionally, you can use a simulation tool to test the expression with various inputs and confirm that there are no unexpected transitions or glitches in the output.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
14
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
29K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Classical Physics
Replies
0
Views
147
Back
Top