# Homework Help: Fixing hazards in a logic expression

1. Mar 28, 2015

### Zondrina

1. The problem statement, all variables and given/known data

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.

2. Relevant equations

3. 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?

2. Mar 28, 2015

### Staff: Mentor

As you have "+ab" at the end, do you need the "ab" in the first bracket at all?

3. Mar 28, 2015

### Zondrina

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. Mar 29, 2015

### Staff: Mentor

"((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. Mar 29, 2015

### Zondrina

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. Mar 29, 2015

Right.