# Three and Four Variable Karnaugh Maps

concept

Karnaugh maps wouldn't be very useful if you could only use them to simplify expressions of two variables. The real power comes in simplifying expressions with three or more variables, where the boolean algebra is confusing and it's rarely clear what you should do.
When you have three or more variables a Karnaugh map makes simplifying an expression much, much simpler (and faster as well!)

fact

When creating a Karnaugh map for a three variable expression of variables \(A,\: B,\: C\) we draw the Karnaugh map like so:

The top row combines \(B\) and \(C\), so the \(01\) column corresponds to \(B=0\) and \(C=1\).

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | ||||

1 |

The order of the \(BC\) numbers isn't just counting up in binary and it is done the way it is on purpose. It's called a "Gray Code" and it's important for using the Karnaugh map to simplify expressions later.
In a Gray code only one digit in the number ever changes at a time. Going from \(01\) to \(10\) would involve changing both bits, so instead we count \(00,\: 01,\: 11,\: 10\), in each case only one bit is changing.

example

Fill out the Karnaugh map for \(AB + C\)

Starting out with the empty map we'll look at the first column corresponding to \(B = 0\) and \(C = 0\). In this case we're always 0 so write those in.\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 0 | |||

1 | 0 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 0 | 1 | 1 | |

1 | 0 | 1 | 1 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 0 | 1 | 1 | 0 |

1 | 0 | 1 | 1 | 1 |

That's great and all, but how do we use Karnaugh maps to actually simplify an expression?
Well remember when I said we look for rectangles of 1s together in a Karnaugh map? It didn't make much sense for 2 variable maps but it makes more sense now.
Look at the map in the example above and you'll notice a nice block of four 1s right smack in the middle of that table. That's telling us that we've got a simple little rule to account for all of those 1s.
In fact just by looking at the table we can see that that block comes from the rule \(C=1\)
Just from that one block we know that the expression that this Karnaugh map comes from has a \(+C\) in it.
Now there's still one 1 not accounted for, but the trick is actually to see it as a block of two 1s including the 1 to its left (all blocks have to be rectangles and the dimensions being a power of 2 helps).
That block of two 1s corresponds to the rule \(AB\).
So we know that the map's simplified expression is \(AB + C\) just like we started with.
This technique takes a little practice to get used to but makes simplifying large boolean expressions a breeze once you're used to it.

example

Draw the Karnaugh map for the expression \(\not{A} + B\not{C}\)

This time we've got some nots in there, don't worry it doesn't make things any trickier. We'll again start by drawing out the empty Karnaugh map:\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | ||||

1 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | 1 | 1 | 1 |

1 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | 1 | 1 | 1 |

1 | 1 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | 1 | 1 | 1 |

1 | 0 | 0 | 0 | 1 |

example

Use a Karnaugh map to simplify \(\not{A(\not{B}+C)}\)

Starting with our empty map:\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | ||||

1 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | |||

1 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | |||

1 | 0 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | 1 | ||

1 | 0 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | 1 | ||

1 | 0 | 0 |

\(_A\text{\\}^{BC}\) | 00 | 01 | 11 | 10 |

0 | 1 | 1 | 1 | 1 |

1 | 0 | 0 | 0 | 1 |

practice problems