News & Updates

Version 2.14.03.12 released.

13 March 2014

New language and bug fix released. Please download it here.

Version 2.14.03.03 released.

4 March 2014

New major release with some long awaited changes is here. Please download it and try.

Version 2.13.07.22 released.

22 July 2013

New major release with lot of changes is here for you to enjoy. Please download it and try.

Version 2.13.03.27 released.

27 March 2013

Translation to 2 more laguages released. Please download it and try.

Version 2.13.02.12 released.

12 February 2013

Translation to 8 laguages released. Please download it and try.

Localization initiative.

05 December 2012

"Translate it to your language" initiative is started. If you can help please contact us at webmaster@logiccircuit.org.

Version 2.12.9.20 released.

20 September 2012

Improvements in RAM and text notes were made. Please download it and start use new and old features of digital logic circuit designer and simulator.

Version 2.12.7.12 released.

12 July 2012

Dialog showing truth table of current circuit is added. Please download it to start playing with truth tables and filtering expressions.

Version 2.12.5.22 released.

22 May 2012

This release is bug fixing. Please download it here.

Version 2.12.5.15 released.

15 May 2012

This release is mainly fixing one but nasty bug. Please download it here.

Version 2.12.5.1 released.

1 May 2012

Various bugs were fixed and new featurs implemented. Please download it and try.

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: http://en.wikipedia.org/wiki/Pure_function

For more details on truth table see: http://en.wikipedia.org/wiki/Truth_table

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.