Logic gates are at the heart of digital electronics. In digital electronics, we need to know nothing about electricity, other than the difference between on (1) and off (0).
Digital electronics is widely used in telecommunications, computers, and sound recording. All digital devices are based on these simple building blocks. In a digital camera, there are millions of these gates.
The simplest of all the logic gates is the NOT gate. Notice that when we write the name of a logic gate, we always write it in UPPER CASE letters. Truth tables summarise the output condition for a variety of input conditions.
For the NOT gate the truth table looks like this:
INPUT |
OUTPUT |
0 |
1 |
1 |
0 |
The NOT gate is often called an inverter. It is made from a single transistor that acts as a switch.
When there is a high voltage at V_{in}, there is a current through the bias resistor. The voltage on the base of the transistor is 0.6 V so that it turns the transistor on. This turns on the current through the load resistor. As the conducting transistor has a very low resistance, we can say that the voltage at V_{out} is very close to zero. Therefore we can say that the transistor has an inverting function.
For the AND gate the truth table looks like this:
A |
B |
OUTPUT |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
1 |
We can show the AND gate as a simple circuit of two switches in series. When both switches are closed, the bulb lights up.
The AND gate performs the same task as arithmetical multiplication.
For the OR gate the truth table looks like this:
A |
B |
OUTPUT |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
The OR gate is the logical equivalent to arithmetical addition.
The OR gate can be made from two parallel switches.
The light bulb lights up when either of the switches is closed OR both.
Note that we do not get double brightness when both switches are on.
For the EX-OR gate the truth table looks like this:
A |
B |
OUTPUT |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
The exclusive OR (EX-OR) will only return a high output is either one or the other input is high, but not both.
For the NAND gate the truth table looks like this:
A |
B |
OUTPUT |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
The NAND gate gets its name from the contraction of NOT and AND. The small circle on the output line tells us that it has an inverting function. NAND gates are particularly easy to make, and other gates are actually made up of combinations of NAND gates. We will look at this later.
For the NOR gate the truth table looks like this:
A |
B |
OUTPUT |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
Logic gates are processor systems. The inputs would be the outputs of two other subsystems, for example a light sensing subsystem and a heat sensing subsystem.
The output of a logic gate provides too little current to drive much more than an LED, even when it is at logic state 1. Therefore it has to be fed into a driver subsystem in order for an output device such as a relay and or a motor to work.
In real world electronics, the logic gates need a voltage of about 5 V to work. Any signal above about 3.5 V is considered to be HIGH. Anything below 3.5 V is LOW. However you need to be careful, because a LOW output (0 in theory) might give a voltage that is more than enough to turn on a transistor.
The output of one logic gate can be connected to the input of another. The example is a simple system using a NAND gate with a NOT gate.
You should find that it's the same as an AND gate
Now try something a little more complex:
It is more economical to make circuits from just one kind of chip and many circuits are made up of just NAND gates. Let us look how:
The two inputs of a NAND gate connected together make the NAND gate into a NOT gate.
In this circuit below the output of a NAND gate is inverted by the NOT gate to produce the output of an AND gate.
We can show this in a truth table:
A |
B |
C |
Q |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
Look at this circuit:
Boolean algebra was invented by George Boole (1815 - 1864).
In digital electronics it does the same job as a truth table, but with symbols. A Boolean expression tells us what condition will give an output of 1.
For a NOT gate the Boolean expression is:
The symbol Ā is pronounced “A-bar”, and means that the state Q is opposite to the state Q. So the statement says “Q is equal to NOT A”.
This means that the output Q is a 1 when A is a 0.
The truth table associated with the statement is:
INPUT |
OUTPUT |
0 |
1 |
1 |
0 |
For an AND gate the Boolean expression is:
The dot between the A and the B mean that both A AND B have to be 1 for Q to be 1. The expression is pronounced, “Q equals A dot B”. The equivalent truth table is:
A |
B |
Q |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
1 |
For the OR gate the Boolean expression is:
This is pronounced, “Q is equal to A OR B” and the truth table is:
A |
B |
Q |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
We looked at this example using truth tables. Now we are going to analyse it using Boolean algebra.
Analyse this circuit using the questions.
Analyse this circuit using the questions.
Step 1
Step 2
Step 3
Step 4
Now you will need to look at some rules that will help you to simplify the expression you have just worked out:
T4 (Identity Law) |
A.A = A |
T4 |
A + A = A |
T4 |
A = A (“NOT NOT A”) |
T7 |
A.0 = 0 |
T7 |
A + 0 = A |
T8 |
A + 1 = 1 |
T9 |
A.Ā = 0 |
T9 |
A + Ā = 1 |
Step 5
The rules help us to simplify a lot of more complex expressions.
We can build a circuit using a Boolean expression, which we will look at now.
A |
B |
OUTPUT |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
A reminder of the rules:
Boolean Algebra
States what the inputs must be for an output to be 1;
Can simplify the design of circuits;
Has rules to simplify long expressions.