Skip to 0 minutes and 1 secondIn this step, we're going to recap some of the logic gates we have already made and look at all the other gates. You should be familiar, by now, with the basic NAND gate and its truth table. In the last step, we also tied the two inputs of a NAND gate together. In this configuration, when the switch was turned on, the lamp turned off, and vice versa. This set up is also known as a NOT gate, which has this symbol. In the video, we also went over the construction of an AND gate and showed you that truth table. You also independently put some NAND gates together and worked out the truth table, that should have come out like this.

Skip to 0 minutes and 39 secondsThis is actually called an OR gate. Another type of gate we can make is called an XOR gate. It can be assembled from four NAND gates, like this. This is the symbol for an XOR gate, and here is its truth table. Any of the basic gates can be combined with a NOT gate to reverse the output. An "N" is then placed with the name of the gate, and a small circle added to the output end of the symbol. So when an AND gate is combined with a NOT gate, it produces a NAND gate, which you're already familiar with.

Skip to 1 minute and 16 secondsAn OR gate and a NOT gate produces a NOR gate, and an XOR gate with a NOT gate produces an XNOR gate. So here's a summary of all the logic gates with their NAND equivalents, and also their truth tables. There is a downloadable PDF of this summary at the bottom of this step.

Skip to 1 minute and 39 secondsIn the next step, there's going to be a quiz on truth tables and logic gates, so it might be worth spending a little time reviewing the previous steps in this week to ensure that you can answer all the quiz questions.

All the other gates

In this step we’re going to recap some of the logic gates we have already met, and look at all the other gates.

You should be familiar by now with the basic NAND gate and its truth table.

A NAND gate symbol (a symbol that looks like an extended D with a small circle just outside the D, touching its right-most point) and truth table (A table with three columns, labelled "Input A", "Input B" and "Output". The first row reads 0 0 1, the second 1 0 1. The third row reads 0 1 1 and the final row 1 1 0).

In the last step we also tied to the two inputs of a NAND gate together to make what is called a NOT gate, which has its own symbol. The diagram below shows again how it is made from a NAND gate, and then shows the symbol for a NOT gate.

A triangle pointing right, with a small circle outside the triangle on its rightmost tip. A larger circle to the right is connected to this small circle by a horizontal line. Another circle to the left is connected to the leftmost edge of the triangle by a horizontal line.

In the video, we also went over the construction of an AND gate and showed you its truth table. Here they are again, with the symbol for an AND gate.

On the left, two NAND gates with the output from the first gate connected to the input of the second gate. In the middle, an AND gate symbol with is the same as the NAND gate symbol except it does not have the small circle.  On the right, a truth table with three columns, labelled "Input A", "Input B" and "Output". The first row reads 0 0 0, the second 1 0 0. The third row reads 0 1 0 and the final row 1 1 1).

You also independently put some NAND gates together in the configuration below, and worked out its truth table. This is called an OR gate and also has its own symbol.

On the left, three NAND gates arranged so that the outputs of two of the NAND gates form the input for the third. The two "input" NAND gates each have their two inputs connected together, so there are only two inputs in total to the circuit. In the middle, the OR gate symbol. This is like a D with the left-most straight line turned into a curve that goes further in to the D, and the right-most part of the D change to be a point. Two inputs come into this from the left and one output goes out to the right, all represented as circles connected to the rest of the symbol with horizontal lines. On the right, a truth table with three columns, labelled "Input A", "Input B" and "Output". The first row reads 0 0 0, the second 1 0 1. The third row reads 0 1 1 and the final row 1 1 1

Another type of gate we can make is called an XOR gate (‘eXclusive OR’). Its output is 1 when one, but not both, of its inputs is 1. It can be assembled from four NAND gates like this and has the symbol shown:

On the left, four NAND gates in a circuit. One of them leads to the output. Each of the inputs to this NAND gate is an ouput from one of two other equivalent NAND gates. These each have one input from the input to the circuit, and the other from a fourth NAND gate. This fourth NAND gate takes one input from each input to the circuit. In the middle, the XOR symbol which is the OR symbol with an extra curved line on the left hand side, parallel to the edge of the shape of the OR gate. On the right, a truth table with three columns, labelled "Input A", "Input B" and "Output". The first row reads 0 0 0, the second 0 1 1. The third row reads 1 0 11 and the final row 1 1 0.

Any of the basic gates can be combined with a NOT gate to reverse the output. When this happens, the new gate created has an N inserted into the name, and the symbol has a small circle added to the front.

So when an AND gate is combined with a NOT gate, it produces a NAND gate – which you are already familiar with. An OR gate and a NOT gate produces a NOR gate. And an XOR gate with a NOT gate produces an XNOR gate.

Representations of the NAND, NOR and XNOR gate symbols, which are the same as the AND, OR and XOR gate symbols, except with the addition of a small circle between the main shape and the output, touching the right-most part of the main shape.

There is a downloadable PDF of the summary of all the gates and their NAND equivalents at the bottom of this step.

In a later step there’s going to be a quiz on truth tables and logic gates, so it might be worth spending a little time reviewing the previous steps from this week, to ensure that you can answer all the questions.

Share this video:

This video is from the free online course:

How Computers Work: Demystifying Computation

Raspberry Pi Foundation