# Karnaugh Map Logic Simplification with Logisim

Logisim's *Combinational Analysis* tool lets you build, analyse and simplify *combinational logic* circuits with up to 8 input variables, and having one or more outputs. The visually oriented *Karnaugh map* tool discussed in this tutorial is available for circuits with up to four inputs only, with algebraic simplification being used exclusively for circuits with between 5 and 8 inputs.

This tutorial focuses on finding the simplest possible Boolean expression, based on a given truth table. In cases where you already know the Boolean expression, then you may prefer to enter this directly.

A new analysis may be started by selecting the **Window > Combinational Analysis** option from the Logisim program's pull-down menu. The normal approach is to first define the truth table, which may be achieved by specifying input variables, output variables and truth table output values in that order (see creating truth tables with Logisim for more details). Consider the design of a 3-input majority detector circuit, which gives a logic-1 output if two or more inputs are simultaneously active.

With the truth table successfully entered, switching to the Karnaugh view tab shows that three overlapping groups have been identified, corresponding to ** B C**,

**and**

*A C***. Notice that the Karnaugh map defaults to**

*A B**Sum of Products*form, so the resulting Boolean expression is

**.**

*X*=*B C*+*A C*+*A B*AProduct of Sumsform is also available, giving an alternative Boolean expression. In general, choose the form which gives the simplest Boolean expression, hence requiring the smallest number of logic gates to implement.)X= (A+B)(A+C) (B+C)

Finally, click the build circuit button to create a sub-circuit with the desired circuit name, which may optionally be used as a component within other circuits.

You can interactively change the Boolean expression by clicking on cells within the Karnaugh map, causing them to cycle through possible values of0,1orX(don't care). Notice that the Karnaugh map automatically adapts,showing the simplest possible Boolean expression.

## Case Study: 7-Segment Decoder

To illustrate the power of the *Combinational Analysis* tool, consider the design of a binary to BCD (*binary coded decimal*) 7-segment display decoder. The driver accepts a 4-bit binary input, and produces seven active high LED driver outputs when the input binary value is in the range 0–9. Output values are undefined when the binary input is in the range 10-15 and these may be represented as don't care states in the truth table, as shown below.

A separate Karnaugh map is automatically produced for each of the seven outputs, as shown below.

The 'proof of the pudding' is to allow Logisim to automatically generate the circuit, then connect it to binary inputs and a 7-segment display, as shown below.