Using Logisim to Build Half & Full Adders

Instructor: Muhammad Wannous

Muhammad has been teaching Computer Sci. and Eng. and has a Ph.D. degree in Computer Sci. and Electrical Eng.

This lesson introduces Logisim, an educational software tool that students in computer engineering classes can use for designing and experimenting with digital circuits. We cover the installation steps and a number of useful examples.

Logisim in Brief

Logisim is a simulator software that can be used for designing and testing logic circuits through a graphical user interface. The simulator is written in Java and you will need Java Run-time Environment (JRE) 5 (or higher) to run it on your computer. Logisim is free to download and use; it is released under the GNU Public License.

Logisim Installation

Logisim runs on Windows, Linux, and Mac operating systems. The installation is simple and doesn't require much effort to complete. To set Logisim up, follow the following steps:

  • Verify that JRE is installed on your machine (visit this page to get the instructions to download, set up, and verify Java installation.)
  • Download Logisim from this page. The download page offers 2 types of files:
    • A generic .jar file that can be run on any platform. You have to choose this file if your machine was running any flavor of Linux OS.
    • An OS-dependent file (.exe in the case of Windows and .tar.gz in the case of MacOS.)
  • Verify that you can run the file you downloaded by either
    • Running the following command in the terminal/command prompt java -jar logisim-XX.jar if you have downloaded the .jar file. Replace XX with the version of Logsim you have downloaded.
    • Double-clicking on the OS-dependent file. MacOS users might experience a situation where the OS requires a specific piece of software provided by Apple to run Logisim. Go ahead and get the extra software.

That's all; you're set to go.

Logisim Interface

Logisim interface is shown in Figure-1. The space below the menu bar is divided into 4 parts called the explorer pane, the toolbar, the attribute table, and the canvas.


Figure-1: Logisim Interface
Logisim Interface


The toolbar contains a number of tools and components that are frequently used. Among them are two special components for the circuit input and output. The input has one pin on the right side (east) and the output has one pin on the left side (west). The canvas is the drawing pane where the circuit components are placed and wired together. Each component has a number of attributes (type, number of inputs…etc.) and they appear in the attribute table when the component is selected (Note the attributes of the AND gate placed in the image in Figure-1.) Finally, the explorer pane has our project information in addition to libraries of a wide range of components. Each component normally has a number of input/output pins that appear as colored points on the border of the component

To draw a circuit in the canvas:

  • Place the components from the toolbar or the libraries in the explorer pane.
    • Select the component by clicking on it.
    • Move the mouse pointer to the location you want to place it in the canvas.
    • Click the mouse left-button.
  • Wire the pins
    • Place the mouse pointer on the first pin and then click and hold the mouse left-button.
    • Move the pointer to the second pin.
    • Release the mouse left-button.

Examples

Example-1, Half Adder

The half-adder is a digital circuit that adds 2 bits (A and B) generating 2 bits at the output for the sum (S) and carry (C). Its truth table is shown in Table-1

Table-1

A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

S = A XOR B

C = A AND B

Start Logisim and complete the following steps to draw a half-adder circuit:

  • (optional) Save the circuit so that your further saves can be easier.
  • Insert 2 inputs into the canvas.
    • Label the inputs (A & B) by setting the attribute 'Label' in the attribute table.
    • Note that both inputs have now 0s inside their green spots. These are the current bit value of the input.


Figure-2: Adding 2 inputs to the half-adder circuit
Adding 2 inputs to the half-adder


  • Insert one XOR gate and one AND gate into the canvas.
    • The two gates are located inside the 'Gates' library in the explorer pane.
    • Change the 'Number of Inputs' in the attribute table to 2.


Figure-3: Adding one XOR and one AND gates to the half-adder circuit
Adding one XOR and one AND to the half-adder circuit


  • Insert 2 outputs in the canvas
    • Label the outputs (S & C).
    • Note that both outputs have X inside the dots. X indicates an invalid value for the output.


Figure-4: Adding 2 outputs to the half-adder circuit
Adding 2 outputs to the half-adder circuit


  • Connect the inputs to the XOR gate.
  • Connect the inputs to the AND gate.
    • Start the connection on the AND gate input and finish it on the wire reaching the designated input.
  • Connect the outputs to the gates.


Figure-5: Wiring the components
Wiring the components


Note that the X mark was replaced by 0 in the circuit outputs. These are the output values of S and C corresponding to the current input values of A and B (currently 0 and 0 respectively.)

  • Try other input values and see how the outputs change.
    • Select the poke tool
    • Place the pointer finger on the input and click the mouse.


Figure-6: Chaning the input values and verifying the values in the output
Chaning the input values and verifying the values in the output


Example-2, Full Adder

We will use the half-adder circuit to construct a full-adder, a circuit that can add 3 bits. We can consider the third bit to be a carry from addition of 2 less significant bits (Cin).

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support