# AND-OR to NAND conversion problem

#### engineering1

Joined Sep 20, 2017
12
Why doesn't the bubbles in the picture "Cancel out" (see attachment)
I would think they would cancel out and leave no more "NOT" bubbles.

#### Attachments

• 743.2 KB Views: 12

#### WBahn

Joined Mar 31, 2012
26,277
Which bubbles? There are a bunch of them in that diagram. Some from the original diagram, some that have been added by hand, some in red boxes, some in the black box, some in the yellow box.

The original drawing is correct.

Remember that when you convert an OR to and AND (or vice-versa), ALL of the inputs and outputs get inverted.

#### engineering1

Joined Sep 20, 2017
12
Black box to Yellow box. between level 4 and 3

#### Attachments

• 112.8 KB Views: 7

#### WBahn

Joined Mar 31, 2012
26,277
Black box to Yellow box. between level 4 and 3
There's got to be some unstated stuff going on in that second image involving the shaded lines, because otherwise what they are doing doesn't make sense.

In the original drawing, the OR gate at Level 3 is converted to an AND gate and when the inputs and outputs are inverted, that absorbs the red bubbles on the two outer inputs and inverts the b input to b'. The output is also inverted, which makes it a NAND gate. Since the original bubbles (in red) are absorbed, they are gone, leaving the other red bubbles at the output of the Level 4 gates.

#### JoeJester

Joined Apr 26, 2005
4,390
Are you sure this isn't an exercise in DeMorgan's theorem.

#### MrChips

Joined Oct 2, 2009
22,068
Take a look at these gate equivalents, i.e. how to apply DeMorgan's theorem to gates.