The Test Vector window

The Test Vector window is similar to the Table tab of the Logging window. You can load a test vector from a file, and Logisim will start running tests on the current circuit. Like the logging window, there is only one test vector window for the project, and the table will change to reflect whichever circuit is being simulated in the project window. Note, however, that the Test Vector module runs a separate copy of the circuit simulator, and so does not interfere with, and is not influenced by, the simulation in the project window.

For the example, we will test the circuit below. This circuit gives the results of five logic functions from two inputs. It contains an error because the bottom NAND gate should be an AND gate.

Example circuit with five logic functions

The test vector file looks like this:

A B O_Nor O_Nand O_Xor O_Or O_And O_AB[2]
0 0 1 1 0 0 0 00
0 1 0 1 1 1 0 01
1 0 0 1 1 1 0 10
1 1 0 0 0 1 1 11

To run the test, select the menu |  Simulate  ||  Test vector  | then use the Load Vector button. Select the vector file you built. The simulation is executed immediately and a table is displayed with the result.

Test Vector window showing results with errors flagged in red

Any incorrect outputs will be flagged in red. Hover the mouse over the red box to see what the output should have been, according to the test vector. Rows with incorrect outputs are sorted to the top of the window.

The file format is simple. You can use the Logging module (with "Include Header Line" selected in the file output tab) to get started, since in most cases the Logging module outputs the same format as used by the Test Vector module.

Interactive Test Execution

Each row in the Test Vector window has two buttons that allow you to manually interact with individual tests:

Highlighting behavior:

Previous: Test Vectors | Next: Test Vector File Format.