
| Contents for this page | Related topics | |
|---|---|---|
|
Introduction Logic circuits Logical operators Logic gates Additional questions |
Active circuit elements Transistors |
Data Glossary |
| Learning Outcomes | ||
| After studying this section, you will be familiar with the basic principles underlying (a) logic gates, and (b) logic circuits. | ||
Logic circuits generally process information obtained from an input sensor (such as a heat sensor), and activate an output device (an alarm bell, for example) (More examples). Shown diagramatically,
|
In a digital circuit, parts of the circuit are in one of two states: they are either ON or OFF. A high voltage (say about 5 V) may be applied to a device, switching it on, and if that voltage drops to near zero, the device is then switched off. We can thus put every connection in a digital circuit into the states 1 or 0, meaning, current flows through the connection or it does not. The simple circuit segments shown on the left illustrate this. |
Consider a statement like: "IF it is Saturday AND it is a fine day THEN I will go surfing". There are two conditions followed by an action resulting from these conditions. We can assign values to the conditions and the action. Let us say that
If the statement "it is Saturday" is TRUE, we give it a value of 1. If it is FALSE, we give it a value 0.
If the statement "it is a fine day" is TRUE, we give it a value of 1, and if it is FALSE, we give it a value 0.
If "I will go surfing" is TRUE, we give it a value 1, if not, we give it a value 0.
Then, we must have some notation to express these statements. We make use of so-called TRUTH TABLES. We will call the conditions INPUTS, and the resulting action OUTPUT.
| NOT | AND | OR | XOR | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Input A |
Output Z |
Input A |
Input B |
Output Z |
Input A |
Input B |
Output Z |
Input A |
Input B |
Output Z |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | ||
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | ||
NOT, AND, OR and XOR (
) are called LOGICAL OPERATORS. Thus we see that if (it is Saturday = 1) AND (it is a fine day = 1) then (I will go surfing = 1). (See also the truth tables for NAND, NOR and NXOR.)
These truth tables can be summarised as follows. It is not a bad idea to try and remember this!
| Logic Gate | Function |
|---|---|
| NOT | Output always opposite to input |
| AND | Output is 1 only when all inputs are 1 |
| OR | Output is 1 unless all inputs are 0 |
| XOR | Output is 1 only when inputs are different |
| NAND | Output is 1 unless all inputs are 1 |
| NOR | Output is 1 only when all inputs are 0 |
| NXOR | Output is 1 when all inputs are equal |
A LOGIC GATE is an decision-making electronic component that has two or more inputs and one output. Depending on the combination of the values of the inputs, the output will be 0 or 1.
Transitors and diodes are used to process the results of logical operators, and are given special symbols to use in circuit diagrams:

In digital circuits (so named because they operate on the basis of inputs that involve the digits 0 and 1), logic gates are used in combination, as shown in the worked example below.
NAND, NOR and NXOR are operators that give the inverse of AND, OR and XOR:
| NAND | NOR | NXOR | ||||||
|---|---|---|---|---|---|---|---|---|
| Input A |
Input B |
Output Z |
Input A |
Input B |
Output Z |
Input A |
Input B |
Output Z |
| 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 |
The table below shows an (incomplete) list of the types of sensors, processors and output devices that may find a place in digital logic circuits:
| Input sensor | Processor | Output device |
|---|---|---|
| On-off switch Heat sensor Light sensor Humidity sensor Magnetic sensor Time switches Pressure sensors pH sensors |
Diodes Transistors Logic gates |
Buzzers Bells Sirens LEDs Light bulbs |