De Morgan's laws tell you how to remove a bar that covers a whole AND or OR:
- =
- =
The memory aid is break the bar, change the sign. Cut the long bar into short bars, one over each piece, and swap AND with OR. Always both moves.
Why the sign has to change. AND asks "are all of them 1?" The opposite of "all are 1" is "at least one is 0", which is an OR question. Likewise, the opposite of "at least one is 1" is "all are 0", an AND question. In everyday words: "not (rain or snow)" means "no rain and no snow".
The laws extend to any number of pieces, = , and to whole blocks. For something like , treat each product as one piece and break only the outermost bar first: = .
Where they show up: finding the complement of a function, turning SOP circuits into NAND-only circuits, bubble pushing, and tidying if conditions in code, where !(a && b) equals !a || !b.
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 0 |