To understand truth tables, gates, logic circuits and the relationship between them.

The Circuit Simulator allows you to construct circuits using input switches and gates including AND, OR and NOT.

The following is a list of what we can do with the circuit simulator. Read each item in the list and try it out in the circuit simulator so that you will understand how it works.

**Inputs**

The inputs are from the wires that come from the switches. When you are creating a circuit you will first select the number of inputs that you want, either 1, 2 or 3.

The input value can be changed by clicking on a switch which toggles the switch between opened and closed.

From each switch two wires are provided. One is directly from the switch, and will have a 0 if the switch is open and a 1 if the switch is closed.

The other wire from each switch is run through a NOT gate to provide the negation of the input. So it will have a 1 if the switch is open and a 0 if the switch is closed.

We will be referring to the input switches as switch **a**, switch **b**, etc. Assign the switches these names from left to right.

Note that changing the number of inputs removes all gates.

**Add a Gate**

To add a gate to the circuit select a gate type from the operation menu and click on a location in the circuit where you want the gate placed.

Gates can't be placed on the input wires or on each other.

**Connect Gates**

To connect a gate to a wire or another gate click on that gate/wire and another gate/wire.

For 2 gates the output of the leftmost gate will be connected to the input of the rightmost gate.

Gates in the same column can't be connected and wires can't be connected to each other.

**Disconnect Gates**

To disconnect a gate, click on the gate/wire and another gate/wire.

**Remove a Gate**

To remove a gate select **delete gate** from the operation menu and click on that gate.

Truth tables allow us to show all of the possible inputs and corresponding outputs of a boolean algebra function.

Truth tables are drawn with *all* possibilities listed in order. The order comes from looking at the inputs as a binary number. For example, with two inputs the rows are:

a | b | Output |
---|---|---|

0 | 0 | � |

0 | 1 | � |

1 | 0 | � |

1 | 1 | � |

The number of inputs will tell us how many rows there are. If n is the number of inputs, then we have 2^{n} rows or possible outputs.

One of the fundamental logic gates is the AND gate.

Use the circuit simulator to create two input switches. Then create an AND gate. Connect both switches directly to the AND gate. For now don't use the wires that go through the NOT gate.

Copy the following truth table into your Lab Notebook:

a | b | Output |
---|---|---|

0 | 0 | � |

0 | 1 | � |

1 | 0 | � |

1 | 1 | � |

You can change the state of a switch by clicking on it. Set switch **a** to 1 and switch b to 0 and enter the Output in the truth table.

Note: switch **a** is the left switch; switch **b** is the right switch.

Record the output of the AND gate trying every possible input in the truth table.

Make sure that you understand how the switches control the input to the AND gate.

Looking at the completed truth table in your Lab Notebook write down in words what the AND gate does.

One of the fundamental logic gates is the OR gate.

Use the circuit simulator to create two input switches. Then create an OR gate. Connect both switches directly to the OR gate. For now don't use the wires that go through the NOT gate.

Copy the following truth table into your Lab Notebook:

a | b | Output |
---|---|---|

0 | 0 | � |

0 | 1 | � |

1 | 0 | � |

1 | 1 | � |

You can change the state of a switch by clicking on it. Set switch **a** to 1 and switch **b** to 0 and enter the Output in the truth table.

Record the output of the OR gate trying every possible input in the truth table.

Make sure that you understand how the switches control the input to the OR gate.

Looking at the completed truth table in your Lab Notebook write down in words what the OR gate does.

The last fundamental logic gate is the NOT gate.

Use the circuit simulator to create one input switch. Then create a NOT gate. Connect the switch directly to the NOT gate.

This is the only time in this Lab that you will need to create a NOT gate.

Copy the following truth table into your Lab Notebook:

a | Output |
---|---|

0 | � |

1 | � |

You can change the state of a switch by clicking on it. Set switch **a** to 1 and enter the Output in the truth table.

Record the output of the NOT gate trying every possible input in the truth table.

Make sure that you understand how the switch controls the input to the NOT gate.

Looking at the completed truth table in your Lab Notebook write down what the NOT gate does in words.

We need to create a circuit that produces a 1 *only* if the switches are set to 0 1 (switch **a** is 0 and switch **b** is 1).

Write down a two-input truth table (like we did for the OR gate).

To create this circuit in the simulator first create two input switches and one AND gate.

Switches can be connected to gates through the main wire or through a wire that goes through a NOT gate.

Using no other gates connect both switches to the AND gate in such a way that a switch setting of 0 1 (switch **a** is 0 and switch **b** is 1) produces a 1 at the output of the AND gate. Do not go on until you complete this. Draw the circuit in your lab notebook.

Without using the circuit simulator, predict what will happen, by filling in your truth table, when the switches are set to anything but 0 1, such as 0 0, 1 0, or 1 1.

Use the circuit simulator to verify your prediction. Record whether the results fit your prediction.

For each of the following circuits:

- Draw the truth table with the Output filled in
- Construct the circuit using two input switches and one AND gate.
- Verify that the circuit output matches the truth table Output exactly.
- Draw the circuit in your Lab Notebook

Create a new circuit that produces a 1 *only* if the switches are set to 0 0 (switch **a** is 0 and switch **b** is 0).

Create a new circuit that produces a 1 *only* if the switches are set to 1 0 (switch **a** is 1 and switch **b** is 0).

Create a new circuit that produces a 1 *only* if the switches are set to 1 1 (switch **a** is 1 and switch **b** is 1).

We need a circuit for the following truth table:

a | b | Output |
---|---|---|

0 | 0 | 1 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

Using a single AND gate create a circuit for the first line of the truth table. This would be a circuit that only has an output of 1 if the input is 0 0. Draw your circuit in your lab notebook. Check your work by trying all the cases in the truth table.

Without clearing the circuit use *another* AND gate to create a circuit for the last line of the truth table. Draw your circuit in your lab notebook.

Create an OR gate and connect the outputs of the two AND gates to the inputs of the OR gate. Verify that it does have the same output as our original truth table by trying all the cases. Draw your new circuit in your lab notebook.

We need a circuit that has two outputs. The first output is given by the truth table:

a | b | Output |
---|---|---|

0 | 0 | 0 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

The second output is given by the truth table:

a | b | Output |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

We can combine these two separate truth tables into one:

a | b | Output 1 | Output 2 |
---|---|---|---|

0 | 0 | 0 | 0 |

0 | 1 | 0 | 1 |

1 | 0 | 0 | 1 |

1 | 1 | 1 | 0 |

Create a circuit for Output 1 Draw your circuit in your lab notebook. Check your work by trying all the cases in the truth table for Output 1. Don't get rid of your circuit for Output 1 yet.

Now, leaving the circuit that you created for Output 1 create a circuit for Output 2. Draw your circuit in your lab notebook. Check your work by trying all the cases in the truth table for the Output 2. Again, don't get rid of your circuits yet.

You have now created a circuit that is very useful. It isn't in your book, but your instructor might have shown it to you. Also, it is part of another mystery circuit.

Circuits get very complex very quickly. In order to work easily with more inputs we will need 3-input gates.

Use the circuit simulator to create three input switches. Then create a single 3-input AND gate. Connect all switches directly to the AND gate (don't use the wires from the input switches that go through the NOT gate).

Copy the following truth table into your Lab Notebook:

Three-Input AND Gate Truth Table

a | b | c | Output |
---|---|---|---|

0 | 0 | 0 | � |

0 | 0 | 1 | � |

0 | 1 | 0 | � |

0 | 1 | 1 | � |

1 | 0 | 0 | � |

1 | 0 | 1 | � |

1 | 1 | 0 | � |

1 | 1 | 1 | � |

Record in the truth table the output of the 3-input AND gate trying every possible input.

Make sure that you understand how the switches control the input to the 3-input AND gate.

Looking at the completed truth table in your Lab Notebook write down what the 3-input AND gate does in words.

Just by using 2-input AND gates create a circuit that has the same truth table as a 3-input AND gate. Hint: Use two of the 2-input AND gates. Connect the output of the first AND gate to one of the inputs of the second AND gate. Draw the circuit in your lab notebook.

Create a circuit for this 3-input truth table using only a single 3-input AND gate.

Simple 3-Input Circuit Truth Table

a | b | c | Output |
---|---|---|---|

0 | 0 | 0 | 0 |

0 | 0 | 1 | 0 |

0 | 1 | 0 | 1 |

0 | 1 | 1 | 0 |

1 | 0 | 0 | 0 |

1 | 0 | 1 | 0 |

1 | 1 | 0 | 0 |

1 | 1 | 1 | 0 |

Draw your resulting circuit in your Lab Notebook.

Of course we will also need a 3-input OR gate.

Use the circuit simulator to create three input switches. Then create a single 3-input OR gate. Connect all switches directly to the OR gate (don't use the wires from the input switches that go through the NOT gate).

Copy the following truth table into your Lab Notebook:

Three-Input OR Gate Truth Table

a | b | c | Output |
---|---|---|---|

0 | 0 | 0 | � |

0 | 0 | 1 | � |

0 | 1 | 0 | � |

0 | 1 | 1 | � |

1 | 0 | 0 | � |

1 | 0 | 1 | � |

1 | 1 | 0 | � |

1 | 1 | 1 | � |

Record the output in the truth table of the 3-input OR gate trying every possible input.

Make sure that you understand how the switches control the input to the 3-input OR gate.

Looking at the completed truth table in your Lab Notebook write down what the 3-input OR gate does in words.

We need a circuit for the following truth table:

Even Less Simple Circuit Truth Table

a | b | Output |
---|---|---|

0 | 0 | 1 |

0 | 1 | 0 |

1 | 0 | 1 |

1 | 1 | 1 |

Using a single AND gate create a circuit for the first line of the truth table. This would be a circuit that only has an output of 1 if the input is 0 0. Draw your circuit in your lab notebook. Check your work by trying all the cases in the truth table.

Without clearing the circuit use *another* AND gate to create a circuit for the second-to-last line of the truth table. Draw your circuit in your lab notebook.

Without clearing the circuit use yet *another* AND gate to create a circuit for the last line of the truth table. Draw your circuit in your lab notebook.

Create an OR gate and connect the outputs of the three AND gates to the inputs of this OR gate. Verify that it does have the same output as our original truth table by trying all the cases. Draw your new circuit in your lab notebook.