UMBC CMSC 313, Computer Organization & Assembly Language,

DigSim Information

DigSim is a Java applet that simulates simple digital circuits. DigSim was written by I. van Rienen and was released into the public domain (so it's free). The code is apparently not maintained by anyone anymore. In fact, the web page most often referenced as the place to get DigSim is no longer active.

There are several advantages of DigSim over B2Logic. First, DigSim is free. I also like the fact that the wires are colored to show which ones are high (red), which ones are low (green) and which ones are disconnected (gray). The disadvantages of DigSim compared to B2Logic are that DigSim has fewer features and it is harder to set up the system to allow the user to save a schematic (see below).

Start DigSim Now.


Running DigSim with Standard Examples

DigSim comes with a suite of standard examples. To run DigSim and play with these examples, all you need is a Java-enabled browser and point it at the start page for DigSim. Then, wait a few moments for the Java virtual machine to start up (actually could be quite long). You should get a new window with titled "Digital Simulator" ( like this). You should also see some new menu items either in a menu bar attached to the window or in the operating system's menu bar (this is OS dependent). Anyway, find the "File" menu and select "Open example". You should see a list of examples. Select one (e.g., "Flip Flop made with two NOR ports") and press "OK". DigSim should now load the circuit you selected (e.g. an SR flip flop). To start the simulation, press on the lightning symbol . Now you should be able to play with the circuit by pushing on switches, etc.


Using DigSim to Design Your Own Circuits

DigSim can also be used to design your own circuits. The catch is that most web browsers do not want to let a Java applet write to the disk. (This is usually a very good idea.) Two ways to work around this problem are listed below. It is a good idea to try saving before doing anything too complicated. If saving files is prohibited, you'd get a Java exception error of some kind.
  1. Convince your web browser that you really want to allow the DigSim Java applet to write to your disk. Some browsers will let the applet write to your disk if the applet is stored on the disk or executed from an appletviewer. You should download the entire DigSim package if you want to run the applet locally. I have not found consistent instructions (or correct instructions) on how to do this in most browsers.

  2. Another method is to dispense with the browser or applet viewer and run DigSim as a Java application. This requires a wrapper. I included one called "DummyAppletContext" in the DigSim package. The instructions to do this differ from system to system, depending on how Java applications are executed. The following instructions were tested on the Dell computers in the PC labs at UMBC.

    Linux/Unix: You have to be logged into the machine that you are sitting in front of. At UMBC, this usually means rebooting the machine into Linux. The exact steps for UMBC machines are:

    The digsim executable file (the one you invoked when you typed "./digsim") is just a shell script:

    #!/bin/csh -f java DummyAppletContext DigSim -width 300 -height 50 fileop true

    Alternatively, you can download the entire DigSim package (see download section below) on your own computer that is running some variation of Unix (e.g., Linux, MacOS X).

    Windows 2000: Java (not the plug-in for the web browsers) must be installed on the system for this to work. The following sequence was tested on the Dell computers at UMBC. If you are doing this from home, download the DigSim package (see download section below) and replace the directory below with the one where you unpacked DigSim.

    In either case, you should get the usual DigSim window, but now it's running as an application and not an applet so you should be able to save. Note that when you save, you will have to navigate in the save dialog back to your home directory. You will not be able to save files in ...chang/pub/cs313/digsim.

    X11 (a.k.a. X Windows) Another alternative is to run the Java application on a GL server and have the graphics displayed on your local machine which can be any machine running an X11 server. The advantage of this approach is that we know DigSim runs on the GL servers. The disadvantage is the communication lag over the network --- the graphical user interface will be very slow when the UMBC network is busy. Another disadvantage is that there will be difficulties if your X11 server is behind a firewall.

    There are ports of X11 for Linux, MacOS and Windows:

    Once you have the X11 server running on your local machine, you need to allow processes running on a GL server to put windows on your screen. In the console type:

       xhost + 
    This allows any machine on the internet access to your screen. You can be more particular and type
       xhost +linux1.gl.umbc.edu +linux2.gl.umbc.edu +linux3.umbc.edu 
    Now, log into linux.gl.umbc.edu (e.g., using ssh). You need to tell X11 clients where to place their windows. Suppose that the name of your machine is lassie.cs.umbc.edu, then you type:
       setenv DISPLAY lassie.cs.umbc.edu:0.0 
    Setting the DISPLAY environment variable is done in your GL shell, not your local shell. You can now type
       cd /afs/umbc.edu/users/c/h/chang/pub/cs313/digsim 
    and type "./digsim" as described above.

Downloading

The entire DigSim directory is available as:


Last Modified: 22 Jul 2024 11:29:40 EDT by Richard Chang
to Fall 2002 CMSC 313 Section Homepage