News & Updates

Version released.

19 January 2018

Please download new bug fixing release.

Version released.

17 December 2017

New version is available for download.

Version released.

26 November 2017

Auto save option been added. Please download the new version.

Version released.

15 August 2017

New version is available for download.

Version released.

21 March 2017

Python scripting language is now embedded in LogicCircuit. Please download and start automating your circuits.

Version released.

20 September 2016

Japanese translation and bug fixes release is available for download.

Version released.

3 June 2016

New translation and bug fixes are available for download.

Version released.

21 October 2015

New version is available for download.

Version released.

28 July 2015

Persian translation available for download.

Version released.

26 June 2015

Please download fix of one nasty bug.

Version released.

16 June 2015

New bug fix release available for download.

Version released.

24 March 2015

New translations are now available. Please download the program and give it a try.

Version released.

6 January 2015

LogicCircuit now translated to Lithuanian. Please download and give it a try.

Version released.

16 December 2014

Release with new features, bug fixes, and translation is here for download.

Truth Table

You can build truth table of your sub circuit if it has input and output pins and does not contain any states holding elements like flip-flops and RAM. In other words you circuit is a pure function.

For more details on pure functions see:

For more details on truth table see:

To build truth table click menu Circuit/Truth Table.

Truth table of simple AND circuit

In the popped up dialog you'll see a table which columns are named like input and output pins.

All the rows of the table are all the permutations of input and result of the outputs.

Here is another example of truth table of full adder.

Truth table of full adder

So as you can imagine number of rows should be equal to two in power of sum of number of bits on all inputs. For example if you circuit like the one above has 3 input pins of one bit each then 2 ^ 3 = 8 the truth table will be 8 rows long. Therefore it is fairly easy to build very big truth table by just increasing bit width of input pins. The dialog however will not show more than 4096 rows because it is unmanageable number of rows. But you can use filter to ensure correctness of you circuit.

Filter is just an expression that applied to each row in the truth table to determine if the row needs to be included in the resulting truth table. In these expressions you can use names of input and output pins and check if their values are satisfy some conditions. For example for the first truth table which is just AND gate the filter expression can be: q = x & y. Please note the invert check box right next to Filter text box in the top of the dialog. If this box is checked then the result of the expression is inverted and hence the above expression been inverted will result in empty table. This is indicating correct behavior of the circuit. If you uncheck it then all the rows will be visible in the table. Please note that there is two numbers in the bottom of the dialog showing total number of rows in the truth table and number displayed in the dialog.

Expression syntax

You should know a few things about the syntax of the expressions.

If name of the pin is starting from letter and contains only letters and digits (like: a, x21, Pin190) than you can just use the name in the expression. In all other cases you need to take it in the double quote.

For example: "q+" character + is not a letter or digit, so enclose it in quotes. "a f" there is a space between letters. "1s" - the name starts from digit.

If pin name contains double quote than you need to prepend it with back slash: "a\"" for pin a". Same with the back slash itself if it is in the name use two of them in expression: "a\\" will represent name of a\ pin.

If you need to specify a number in the expression you have 4 options:

There are two types of expressions you can use: arithmetic and logical. Arithmetic expressions evaluated on 32 bit numbers and include addition, multiplications and bit operations. Logical operation evaluated to either 0 or 1 - both are also 32 bit numbers. For example result of arithmetic operation 3 + 4 will be number 7, but result of logical operation comparison 3 < 5 will be 1.

You can use the following operations in the expressions:

PriorityOperation Meaning
1(E)Enclose expression in the parentheses
1-EUnary negation - change sign of the expression
1~EBitwise not inverts all bits in the expression
1!ELogical Not - results in 0 if expression is not equal to 0 and to 1 if it is
2E1 << E2Bitwise left shift. Shifts e1 to number of bits provide in e2
2E1 >> E2Bitwise right shift. Shifts e1 to number of bits provide in e2
3E1 & E2Bitwise AND of expressions E1 and E2
4E1 | E2Bitwise OR of expressions E1 and E2
4E1 ^ E2Bitwise EXCLUSIVE OR of expressions E1 and E2
5E1 * E2Multiplication of E1 and E2
5E1 / E2Division of E1 by E2
5E1 % E2Reminder of division E1 by E2
6E1 + E2Additions of E1 and E2
6E1 - E2Subtraction of E2 from E1
7E1 = E2You can use == also. Logical operation: equality of E1 and E2
7E1 <> E2You can use != instead of <>. Logical operation: not equality
7E1 @ E2@ one of: < <= >= > Logical operation: comparison of E1 and E2
8E1 && E2Logical AND: results in 1 if E1 is not 0 and E2 is not 0 otherwise 0
9E1 || E2Logical OR: result in 1 ifE1 is not 0 or E2 is not 0 otherwise 0

The fact that logical operations produce numbers 0 or 1 lets you use them in arithmetic expressions. For example if you have 4 inputs multiplexer and hence 2 bit selector input you can use the following expressions to validate it. Let's assume data inputs named X0, X1, X2, X3, selector is called N, and output is Q.

(N = 0) * X0 + (N = 1) * X1 + (N = 2) * X2 + (N = 3) * X3 = Q

Here each of comparison of N will produce either 0 or 1 and 0 been multiplied to input value will results in 0 so the result will be equal to selected input.

When writing expression you need to be careful to suppress extra bits not needed in other parts like comparison. For example if you checking only s output of full adder in the above image you'll need to suppress carry in the expression. So instead of:

s = inC + a + b

You will need to have

s = (inC + a + b) & 1

Finally expression result is just a number. This number is treated as logical value "true" for any number that is not equal to 0 and "false" if it is zero.