# Logic Gate Simulator

A free, simple, online logic gate simulator. Investigate the behaviour of AND, OR, NOT, NAND, NOR and XOR gates. Select gates from the dropdown list and click "add node" to add more gates. Drag from the hollow circles to the solid circles to make connections. Right click connections to delete them. See below for more detailed instructions.

The demo above allows you to create sequences of logic gates to see how they behave when connected to various inputs and outputs. Initially, you are presented with a simple on/off input and an output. To connect them, click and drag from the hollow circle on the right side of the on/off switch, and release the mouse when you are over the solid circle on the left side of the "output" block.

For each of the logic gates, outputs are hollow circles, and inputs are solid circles. Our "on/off" switch and "output block" aren't actually logic gates, but they are required because they give us the 1s and 0s needed to see how the gates behave. Click the on/off switch and see what happens. It turns yellow. This is our way of differentiating between 0 (off) and 1 (on).

To add a new logic gate, or an additional input or output block, choose from the dropdown menu and then click "add node". The new node will be placed in the top left hand corner, and you can drag it to your desired position. To delete nodes, click the small cross in the top right corner of its enclosing box. To remove connections, you can click on the input (solid circle) and drag away and release, or alternatively you can right click anywhere on the connection.

If you need more space, click on the "Full screen mode" button which will increase the size of the workspace to fill the size of the window. Additionally, you can rename an output by double clicking on its label.

#### NOT Gate

The NOT gate is also known as an inverter because the output is the exact opposite of the input. It has one input and one output. The two possibilities are written out in the table below. Tables listing all logical possibilities like this are known as truth tables.

InputOutput
01
10

#### AND Gate

The AND gate has two inputs and one output. The output is 1 if both inputs are 1, and for all other cases the output is 0.

Input 1Input 2Output
000
100
010
111

#### NAND Gate

The NAND gate behaves in the opposite fashion to an AND gate. You can think of it as an AND gate followed immediately by a NOT gate. Its output is 0 when the two inputs are 1, and for all other cases, its output is 1. The name NAND comes from joining NOT and AND. The symbol for NAND is the same as that for AND except for the addition of a small circle on the right side.

Input 1Input 2Output
001
101
011
110

#### OR Gate

The OR gate has two inputs and one output. If at least one of the inputs is 1, then the output will be 1. If neither input is 1, the output will be 0.

Input 1Input 2Output
000
101
011
111

#### NOR Gate

Just as the NAND gate could be thought of as an AND followed by a NOT, a NOR can be thought of as an OR also followed by a NOT.

Input 1Input 2Output
001
100
010
110

#### XOR Gate

With an OR gate, if both inputs were 1, the output was 1. However, with an XOR, (exclusive OR), if both inputs are 1, the output is 0. For all other scenarios, the XOR behaves the same as the OR.

Input 1Input 2Output
000
101
011
110