Suppose we have a circuit with two variables, A and B. We can write the possible outputs of the circuit either in a truthtable or in a square grid, as shown below:


You may recognise the truthtable above. It's the truthtable for the ExclusiveOr gate. Each of the outputs has been transferred to the grid, so that the topleft square represents the combination of inputs A = B = 1, the topright square represents the combination A = 0, B = 1 etc. This is the Kmap for two inputs. We don't use a Kmap for only two variables much as its scope is so limited. In fact, this is the only time in this report that you'll see me refer to it. We can draw a similar Kmap for three inputs, A, B and C:


Here it is a little more complex as we have to show each value of A and each value of B twice. The leftmost column of the square grid represents possible input where both A and B are 0 (with the upper cell representing C = 1 and the lower one C = 0). The next column along represents the possible inputs where A = 0 and B = 1 etc. I have coloured the 1s in the grid specially so you can match them to the truthtable. We can even draw a Karnaugh map for four variables. I will dispense with the truthtable as you probably have the correct idea:
Looking along the edges of the square, you can see that it's important that the digits be staggered. The pattern of digits along the edge labelled A does not match that along the edge labelled B. Instead, the pattern is "offset" by one digit. Similarly, the edge labelled D has the same pattern as that on the edge labelled C except that it is offset by one place. This is done to ensure that the Kmap can represent all combinations of inputs. The following grids, for instance, would not be valid Karnaugh maps:


Of course, it gets a little harder if you want to represent five variables in a Karnaugh map. in that case you would probably have to draw two 4by4 grids, one representing E = 0, and the other E = 1.
Each loop represents a particular AND gate with its own particular inputs. Here are the rules



Two loops, each enclosing four 1s is legal. 

One loop enclosing six 1s is not! 
(In those last two examples, I have followed the timehonoured tradition of lazy engineers and omitted to draw the 0s in the Kmap. Wherever you see an empty square, just imagine that there is a 0 in it. This is quite a common practice).


This is akin to sailing around the world. You disappear off one side of the map and reappear on the other side.
Before we go on to how these loops may be interpreted, I would like to show you one more example of a legally looped map and one more example of an illegally looped one:



This 1 represents an AND gate responding to A = 1, B = 0 and C = 1 

Loops which include two items correspond to AND gates with all the inputs except one. The input that drops out is the one that changes as you pass from one end of the loop to the other. For instance in this Kmap:
The loop covers a transition from C = 0 to C = 1 with all the other inputs equal to 1. This corresponds to the gate shown  it has inputs which activate when A = B = D = 1, but no input for C. In the notation, the two ones would represent A.B.C.D + A.B.ØC.D which collapses to give A.B.D.
The same thing applies for loops that cover four 1s, except that in this case 2 inputs drop out  the two that change as you move around the loop. This applies whether the loop is a 4by1 loop or a 2by2 loop:

Corresponds to C = D = 1 regardless of the state of A and B. 


Corresponds to A = C = 0 regardless of the state of B and D. 

Don't be put off if the loop goes off one end of the map and reappears at the other side. You still lose inputs:
In fact, a loop covering 8 items would give a single input, which would not have to be fed into an AND gate. Instead, it would be fed straight into the OR gate into which all the other AND gates fed:



In this case, that first term (the A) derives from the loop containing eight 1s on the left of the Karnaugh map.







In this case, no looping is possible and so there are 4
separate terms  well, you can't get a coconut every time!

Go back 
Main Menu 
Questions 
Go on 