Creating Truth Tables with Logisim

The Logisim Combinational Analysis Tool makes it incredibly easy to create truth tables, which is a key step in the design of combinational logic systems. To illustrate the process, we'll generate a truth table equivalent to the following circuit.

The Boolean expression here is X = A B + C D, which could be entered directly, but this tutorial focuses on manual entry of the truth table.

The first step is to open the Combinational Analysis tool by selecting the Window > Combinational Analysis menu option. Click on the Inputs tab and enter the four input variables, A, B, C and D.

Next click on the Outputs tab and add the intermediate outputs A B plus C D, as well as the main output X – in that order.

Clicking on the Table table will show the truth table with its four inputs and three outputs, although the outputs will initially be shown as a series of 'x's or don't care states. Click on each output to cycle through the possible values (0, 1, X) entering the appropriate values based on the desired Boolean expression for each column.

Next Steps

With the truth table created, the next stage in the process would normally to have a look at the Karnaugh map or Boolean expression, in order to see any logic simplification which Logisim has proposed (yes it does that too!), or you could simply allow Logisim to automatically draw the circuit – both of which are covered in other tutorials.

Our truth table could be pasted directly into a technical report as a screenshot, but the resulting appearance may be a little 'amateurish'. Surprisingly, it is also possible to import the truth table into a word processing application, allowing it to be turned into a native table and then reformatted, as desired.

The first step is to click on the Table tab in the Combinational Analysis tool. Either drag the mouse diagonally across the table to select the text, or simply press Ctrl + A to select all text. Copy the selected text to the clipboard (short-cut: Ctrl + C) and then switch to your word processing application and paste the truth table into a new document (short-cut: Ctrl + V). This will initially appear as text, organised into columns using tab characters. Next, highlight the truth table text in your word processor and use your the appropriate 'convert text to table' feature to create a table. An example screenshot from Microsoft Word is shown below.

(The equivalent menu sequence in LibreOffice / OpenOffice would be Table > Convert > Text to Table.)

You can now reformat the table, with a possible example shown below.

Working Smarter

With your truth table safely exported, you may wish to delete the intermediate columns (AB and CD) in the truth table, prior to automatically generating the circuit. Otherwise, Logisim will incorrecly create these as separate outputs. Also note that the Combinational Analysis cannot be saved, so you may wish to take a copy of the Boolean expression, which will enable the truth table to be regenerated quite quickly (removing the need to manually fill in the truth table outputs in the above process).

Creation of larger truth tables can become tedious unless sensible defaults are used for output values, particularly if only a few lines are different from the norm. In fact, Logisim allows truth tables with up to 8 inputs to be created, giving a maximum length of 256 lines! A great time-save in this type of situation is to change the default value, and then make changes on an 'exception' basis, as shown below.

To do this, first start a new combinational analysis. Create a single input, a single output, and then change the two output states to the desired default value (e.g. A, X and 0 respectively). You can then go back to the Inputs tab and add the remaining inputs, and finally edit any output lines which are not at the default value.

Related Topics