Get the truth table of your circuit
Label every pin
The labels become the column names in the table, so name them (A, B, S) and avoid spaces.
Check: Each input and output pin has a label in its Properties.
Open the analysis
Choose Project, then Analyze Circuit.
Check: A Combinational Analysis window opens.
Read the Table tab
The tab says how many rows are shown, for example “8 of 8 rows shown” for a three-input circuit, and has buttons to collapse duplicated rows and to show all rows (F95).
Check: You see every input combination and its outputs.
In our test the window opened on the tab used last, so look for the tab names across the top: Inputs & Outputs, Table, Expression, Minimized.
The Analyze Circuit window on the Table tab: four rows of A, B, S and C. 0 0 gives 0 0; 0 1 gives 1 0; 1 0 gives 1 0; 1 1 gives 0 1.
“Expression Not Determined” with tunnels
If the circuit uses Tunnels, Logisim shows this notice:
Expression Not Determined: Computing truth table instead of expression due to Tunnel.Dialog after Project, Analyze Circuit on a circuit that uses tunnels
Logisim-evolution 5.0.0 with a full adder built from gates and tunnels. A dialog titled Expression Not Determined says: Computing truth table instead of expression due to Tunnel. There is an OK button.
After OK the window still shows the truth table, sum-of-products expressions and K-maps worked out from the table. For our full adder, S and Cout were correct (F48). It is a notice, not a failure. See Tunnels when available.
Build a circuit from a truth table or an analysis
The window has a Build Circuit button on every tab. We tested it from an analysed full adder, not from a table typed by hand.
Define inputs and outputs
Each list ends with a line “Click to add a new variable”. When you analyse an existing circuit, the pins fill these lists for you.
Check: The Inputs & Outputs tab lists your variables.
Click Build Circuit
The name is pre-filled with the name of the circuit you analysed, so type a new one or you may collide with it. The dialog also offers “Use Two-Input Gates Only” and “Use NAND Gates Only”; the NAND box was greyed out until the first was ticked.
Check: A dialog asks for a destination project and a circuit name.
Press OK and save
Logisim adds the circuit to the project and shows it. Save the file with Ctrl+S.
Check: The circuit tree lists the new circuit.
The Inputs and Outputs tab of the Combinational Analysis window. Two lists: Input Variables A, B and Cin, and Output Variables S and Cout, each ending with the line Click to add a new variable. Buttons below: Import Table, Build Circuit, Optimize minterms, Optimize maxterms, Export Table and Export TeX.
The Build Circuit dialog over the Combinational Analysis window. Fields: Destination Project fa, Circuit Name main, and two check boxes, Use Two-Input Gates Only and Use NAND Gates Only, the second greyed out. Buttons OK and Cancel.
The main window after Build Circuit. The circuit tree lists main and a new circuit named built. The canvas shows inputs A, B and Cin, outputs S and Cout, a three-input parity gate and AND and OR gates wired between them.
We named the new circuit built and saved the file. Run against an 8-row full-adder test vector, the circuit passed 8 of 8 (F95). Download the file with both circuits and the vector; the vector names the circuit to test:
java -jar logisim-evolution-5.0.0-all.jar --no-splash -w built circ-combinational-analysis-built.vec.txt circ-combinational-analysis-built.circ
For test vectors in general, see Test vectors when available, and the tutorial for how a circuit is built by hand. We did not test the case where the circuit name already exists.
Build from a Boolean expression
The Expression tab has a Notation list (we saw Mathematical) and shows each output as an expression; for the full adder it read S = A⊕B⊕Cin and Cout = A·B+(A⊕B)·Cin (F95).
We called the 5.0.0 parser directly on each expression and evaluated all eight rows (F37). The last column is the output for a, b, c counting 000 to 111:
| a + b*c | (a OR b) AND c | 00010101 |
|---|---|---|
| a + b c | a OR (b AND c) | 00011111 |
| a*b + c | (a AND b) OR c | 01010111 |
| a | b & c | a OR (b AND c) | 00011111 |
| a' b + c | (NOT a AND b) OR c | 01110101 |
No rows match.
This test used the parser, not the typing box in the window; we expect the window to agree, and T-ANA-01 in our plan will confirm it.
K-maps and minimised expressions
The Minimized tab shows, for the output you pick, a Format list (Sum of products was selected), a Style list (Numbered), a Notation list (Mathematical) and a Karnaugh map (F95). The buttons Optimize minterms and Optimize maxterms were greyed out for our full adder.
The Minimized tab of the Combinational Analysis window for output S. Lists for Output, Format (Sum of products), Style (Numbered) and Notation (Mathematical), above a Karnaugh map with inputs A down the side and B, Cin across the top.
Limits and wrong results
- The table has two to the power of n rows, so keep the input count small. The project’s source sets a maximum, but we did not reach it, so we state no number.
- Circuits with memory give no meaningful table.
- A community issue reports that minimising an expression can give an incorrect result. We did not check whether 5.0.0 shows it. Always check the built circuit with a test vector, as above.
Getting a truth table without the window
--tty table prints a full truth table for a circuit and exits; on our full adder it printed eight rows (F05, F91). Classic 2.7.1’s -tty table behaves differently. See Command line reference.
java -jar logisim-evolution-5.0.0-all.jar --tty table circ-tutorial-full-adder.circ
Our tool and this window
The Truth Table to Circuit tool generates a .circ in your browser without opening Logisim; use this window when you already have the circuit open.