Digital Truth is an application that allows you to feed in a digital boolean equation and have the output displayed or written to a file (application version only). It was initally a text based application but I managed to get it somewhat GUI (Graphical User Interface). The program is written entirely in Java so it was possible to write both the program as both an applet and applications. The applications will be up shortly as I am concentrateing mainly on the applet as most computers can run applets.

Through the applet, you can check Logical Equivalence (see note), display equation truth tables, check if an equation is a tautology, or see if an equation is inconsistent.

NOTE: To the applet, logical equivalance is represented by the same output for the function. For example, AB is logically equivalent to CD, according to the applet. This is because it has the same output in its truth table. Thus, for this example, AB could be replaced by CD if, for example, A = C and B = D. While this may not be entirely true according to some minds on the subject, I think it gives more information then saying no because the variables don't match. When I get time, I will have the applet show you an example of what variables should match.

If you are new to Truth Tables, I have found a web page that seems to give a pretty good overview on Truth Tables. To check it out, goto How to use Truth Tables.

Attention Mac Users: You must use MJR (preferably 2.1.4 or better). This means that you will either have to use Apple Applet Runner (recommended) or Microsoft IE (with the Java virtual machine set to MJR). Netscape 4.7 (Mac) or less (and maybe later versions) seem to have a problem. At this time, Netscape uses its own Java virtual machine and unfortunately is not quite handling ActionListeners (which I decided to switch to using in DigitalLogic). If you experience problems with the GUI, some MJR versions view the GUI a little different. For now, if you have problems, use Apple Applet Runner and expand it to full screen.

Right now, if you print the truth table, it will only print the first page. When I get time, I will put the code in for it to print multiple pages. But it shouldn't bother you if you don't use too many variables. The entire table will display to the screen though.

The format of the equations are as follows:

  1. Capital Letters are variables. The domain is A through Z.

  2. Logical OR is represented by placing a + between variables
    (or with Parentheses see 5).

    For Example:
    To perform A OR B, you input:
    A+B

  3. Logical AND is represented by placing variables side by side
    (or with Parentheses see 5).

    For Example:
    To Perform A AND B, you input:
    AB


  4. XOR can be represented by placing a lower case x between variables
    (or with Parentheses see 5).

    For Example:
    To Perform A XOR B, you input:
    AxB


  5. Parentheses can be used to seperate subexpressions. The domain is ( and ).

    For Example:
    To perform A OR B all ORed with C, you input:
    (A+B)+C
    To perform A OR B all ANDed with C, you input:
    (A+B)C
    To perform A OR B ANDed with C XOR D, you input:
    (A+B)(CxD)


  6. Logical NOT can be performed using the ' character.

    For Example:
    To perform NOT A, you input:
    A'
    To perform NOT(A OR B), you input:
    (A+B)'
The Logical Equivalence requires that you fill in both equation areas. This only makes sense as you need two equations to test for logical equivalence. The truth table function will allow you to fill in one field or both at the same time. It doesn't matter what order. For the Tautology and Inconsistent functions, it will read only the equations in the first text field. It will return an error in the event that the first equation field is empty.

The following are two examples of how it works. The output was taken from the text based program. The outputs for the applications and applets are graphical (see the applet for an example).

Typing the Equation:

(A+B+C)'

Will result in the output:

Truth Table for Equation: (A+B+C)'
A | B | C | Output
------------------
0 | 0 | 0 | 1
0 | 0 | 1 | 0
0 | 1 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 0 | 0
1 | 0 | 1 | 0
1 | 1 | 0 | 0
1 | 1 | 1 | 0

Typing the Equation:

AxBC

Will result in the output:

Truth Table for Equation: AxBC
A | B | C | Output
------------------
0 | 0 | 0 | 0
0 | 0 | 1 | 0
0 | 1 | 0 | 0
0 | 1 | 1 | 1
1 | 0 | 0 | 0
1 | 0 | 1 | 1
1 | 1 | 0 | 0
1 | 1 | 1 | 0

NOTE: The above output may have not been what you expect. That is because the program reads the function from left to right. Therefore, what you may have expected should have been typed:

Ax(BC)


Thus, you will get the A XORed with the (BC) and not the AxB first and then ANDed with the C. This the above truth table is for:

(AxB)C


And now, what you've all been waiting for...
THE APPLET!!


PLEASE NOTE: This applet has been tested with Sun's AppletViewer (UNIX/PC), Netscape Communicator 4.6/4.7 (PC), Internet Explorer 5 (PC)/4.5 (MAC), and Apple Applet Runner (Mac). If you have problems printing in IE, use Netcape for PC, AppletViewer (PC/UNIX) or Apple Applet Runner (Mac).

ALSO: I am going to put up a page very shortly with just the applet so that you can print just the truth table if you like. That way, you don't have to print all of this web page every time you want to save a table.


As always, feel free to email me if you have any questions or problems.

FastCounter by bCentral
1