CS Home THS Home District Page Acceptable Use Policy

Logic Gates

Logic gates perform a boolean operation - they process signals which represent true or false. Normally the positive supply voltage +Vs represents true or 1 and 0V represents false or 0. Other terms which are used for the true and false states are On and Off, and Hi and Lo.There are many different type of gates but for this disucssion we will look at 5: AND - both input conditions must be true for output to be true, OR - either input condition can be true for output to be true, NOT - simply inverts the input, NAND - an AND gate with an inverter, and NOR - an Or gate with an inverter.

Inputs and outputs

Gates have two or more inputs, except a NOT gate which has only one input. All gates have only one output. Usually the letters A, B, C and so on are used to label inputs, and Q is used to label the output. On this page the inputs are shown on the left and the output on the right.

AND gate with inputs and output labelled

The inverting circle (o)

Some gate symbols have a circle on their output which means that their function includes inverting of the output. It is equivalent to feeding the output through a NOT gate. For example the NAND ( N ot AND ) gate symbol shown on the right is the same as an AND gate symbol but with the addition of an inverting circle on the output.

NAND gate showing inverting circle

Truth tables

A truth table is a good way to show the function of a logic gate. It shows the output states for every possible combination of input states. The symbols 0 (false) and 1 (true) are usually used in truth tables. The example truth table on the right shows the inputs and output of an AND gate.

Input A Input B Output Q
0
0
0
0
1
0
1
0
0
1
1
1

NOT gate (inverter)

The output Q is true when the input A is NOT true, the output is the inverse of the input: Q = NOT A
A NOT gate can only have one input. A NOT gate is also called an inverter.
traditional NOT gate symbol
Input A Output Q
0
1
1
0
Traditional symbol Truth Table

AND gate

The output Q is true if input A AND input B are both true: Q = A AND B
An AND gate can have two or more inputs, its output is true if all inputs are true.
traditional AND gate symbol
Input A Input B Output Q
0
0
0
0
1
0
1
0
0
1
1
1
Traditional symbol Truth Table

NAND gate (NAND = N ot AND )

This is an AND gate with the output inverted, as shown by the 'o' on the output.
The output is true if input A AND input B are NOT both true: Q = NOT (A AND B)
A NAND gate can have two or more inputs, its output is true if NOT all inputs are true.
traditional NAND gate symbol
Input A Input B Output Q
0
0
1
0
1
1
1
0
1
1
1
0
Traditional symbol
Truth Table

OR gate

The output Q is true if input A OR input B is true (or both of them are true): Q = A OR B
An OR gate can have two or more inputs, its output is true if at least one input is true.
traditional OR gate symbol
Input A Input B Output Q
0
0
0
0
1
1
1
0
1
1
1
1
Traditional symbol
Truth Table

NOR gate (NOR = N ot OR )

This is an OR gate with the output inverted, as shown by the 'o' on the output.
The output Q is true if NOT inputs A OR B are true: Q = NOT (A OR B)
A NOR gate can have two or more inputs, its output is true if no inputs are true.
traditional NOR gate symbol
Input A Input B Output Q
0
0
1
0
1
0
1
0
0
1
1
0
Traditional symbol
Truth Table
 
 
 Home
 Previous
Next