# How A Computer Works

## 1 Learning Objectives

By the end of the lesson…

• All Should Be able to complete the truth table for a NOT gate.
• All Should Be able to describe the function of a NOT gate as an inverter.
• Most Should Know that computer circuits are built from Transistors.
• Most Should Understand the term Boolean Logic (such as AND, OR and NOT).
• Most Should Be able to complete a truth table for a NOR,OR and XOR gate.
• Some Could Evaluate that the output from a gate depends on the pattern of transistors in its circuitry.
• Some Could Explain how a D Latch works in a circuit with two possible stable states.

## 2 Simplifying NAND gates

### Learn It

Let's look at other gates

• NAND gates are really useful, but it would be annoying to have to draw the transistors every time.
• Instead we use a symbol like the one shown below. You can click the buttons and compare it to the transistor version below it, to see that they are identical in function.

## 3 Combining NAND gates

• NAND gates are said to be universal logical gates because you can make all other types of logic gate out of them.
• We can take a single NAND gate like this one.
• And use it to make this
• This is called an AND gate.
• Here is an online gate builder which is a nice way to visualise what is happening.

## 4 Assessment

• Have a look at the below. This is the arrangement for a NOT gate, sometimes called an inverter.
• Construct a Truth table for the arrangement, showing input A output Q.
• Describe why the NOT gate is often called an Inverter?
A Q
0
1

## 5 Making other gates from NAND gates

• We've already seen one other gate that can be made using NAND gates - it was called an AND gate.
• Below is the diagram for the NAND gate arrangements for an AND gate again, and a simplified symbol for an AND gate that is commonly used.
• Hopefully you can see that the two are identical. When inputs A and B are on, output Q is on. When either or both A and B are off, Q is off.
• The AND gate has a very similar symbol to the NAND gate (it's just missing the little circle near the output) so make sure you don't get the two confused.
• The truth table for an AND gate looks like this
A B Q
0 0 0
1 0 0
0 1 0
1 1 1

• OR gate

• NOR gate

• XOR gate