Simulate digital circuits with Logisim

Multiplex Connection

In multiplex cinemas, people walk in at a common entrance and take a seat in the desired theater. An n-bit multiplexer works similarly. However, encoders, which simulate the end of a movie night, wherein visitors come out of the individual cinemas and leave the building from a common exit, need a closer look.

The design of a parallel 1-bit multiplexer (Figure 8) begins in the Combinational Analysis window. To start, create the appropriate truth table and then click Build Circuit. In the window that opens, select the NAND gate and assign a name to the circuit. A NAND operator corresponds to an inverted AND operator. NAND gates are considered universal, because any logical function can be implemented by this type alone.

Figure 8: The 1-bit multiplexer logic circuit can only be implemented with the aid of NAND gates.

To create a multiplexer manually, open the Plexers library and drag a Multiplexer onto the canvas. For a 2-bit multiplexer, you need two data lines and one control bit, which you set in the Select Bits and Data Bits drop-downs, respectively, in the attribute table (Figure 9). This combination gives you four inputs (00, 01, 10, 11) numbered 0 through 3, another input for the selector (control) pin, and one output. After connecting pins to the inputs of the multiplexer, set the control signal – found on the bottom side of the multiplexer – to 2 bits in the attribute window, and then add an LED for the output, which is found under Input/Output | LED.

Figure 9: In this 2-bit multiplexer, the inputs are on the left side and the control pin is at the bottom. The output is an LED located to the right of the multiplexer.

Divide and Conquer

When programming, you reuse code by creating functions (subroutines, methods), and you do the same thing in Logisim by creating subcircuits.

To create a timed circuit, you can integrate the aptitude test, which in this case represents the logic, between two D flip-flops. To start, create a new circuit by calling up the context menu of the project folder with a right-click, choose Add Circuit, and give it a name. Drag two flip-flops to the canvas.

To insert the example subcircuit between the two D flip-flops, click once on the name of the subcircuit in the tree structure on the left. The mouse pointer changes to a block that represents the subcircuit, which you now add to the canvas and connect to the flip-flops (Figure 10).

Figure 10: Logisim displays a subcircuit as a block, to which you can add inputs and outputs.

The D flip-flop has only one output, which also needs to go to an input on the subcircuit, so you need to add two more input pins to the subcircuit. The subcircuit has two outputs, one of which you connect to the input of the second D flip-flop. The other output goes to the reset input (~R) of the second D flip-flop.

Testing

The most beautiful circuit is of little use if it doesn't work, so you should test your circuit before using it. To test logical circuits such as this aptitude test, choose the Poke (pointing finger) tool in the menubar. By clicking an input pin several times, you can change its value and observe the behavior of the outputs. Logisim color highlights active lines (i.e., those through which data bits are currently flowing) during the simulation.

Logisim has a special feature for time-controlled circuits: The Simulate | Ticks Enabled menu item automatically starts ticking the clock, so you only have to change the data inputs to observe the circuit's behavior.

Logisim also offers an export function that creates a drawing of the circuit under File | Export Image. In the resulting window, you select the desired image format and scaling.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Digital IC Simulation on Linux

    Designing field-programmable gate arrays is only half the job: The hardest part is the simulation, but Linux is the best place to tackle certain challenges.

  • Ubuntu 10.04 Restores Google Search

    The final version of Ubuntu Linux will restore Google as the default search engine in Firefox.

  • Qiskit

    Qiskit is an open source framework that aims to make quantum computing technology both understandable and ready for production.

  • GPIO on Linux Devices

    The general purpose input/output interface is not just for small-board computers anymore: You can use GPIO on your Linux desktop or laptop, too, through the USB port.

  • Mozilla Firefox Blocks Microsoft Add-Ons -- Temporarily

    Mozilla added Microsoft's .NET Framework Assistant to its add-ons blocklist over the weekend. The blocklist blocks programs with evident security vulnerabilities. Before the weekend was over, the app was stricken from the list again.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News