Logic Gates
Logic Gates
A logic gate is a building block of a digital circuit. Most logic gates have two inputs and one output and
are based on Boolean algebra. At any given moment, every terminal is in one of the
two binary conditions false (high) or true (low). False represents 0, and true represents 1. Depending
on the type of logic gate being used and the combination of inputs, the binary output will differ. A
logic gate can be thought of like a light switch, wherein one position the output is off—0, and in
another, it is on—1. Logic gates are commonly used in integrated circuits (IC).
AND gate
An AND gate can have two or more inputs, its output is true if all inputs are true. The output Q is
true if input A AND input B are both true: Q = A • B
0 0 0
0 1 0
1 0 0
1 1 1
Logical symbol
1
OR gate
An OR gate can have two or more inputs, its output is true if at least one input is true.
The output Q is true if input A OR input B is true (or both of them are true): Q = A + B
0 0 0
0 1 1
1 0 1
1 1 1
Logical symbol
0 1
1 0
Logical symbol
2
Universal gates
NAND gate
This is an AND gate with the output inverted, as shown by the 'o' on the symbol output. A NAND
gate can have two or more inputs, its output is true if NOT all inputs are true. The output Q is true if
input A AND input B are NOT both true: Q = 𝐴 . 𝐵
0 0 1
0 1 1
1 0 1
1 1 0
Logical symbol
NOR gate
This is an OR gate with the output inverted, as shown by the 'o' on the symbol output. A NOR gate
can have two or more inputs, its output is true if no inputs are true. The output Q is true if NOT
inputs A OR B are true: Q = 𝐴 + 𝐵
0 0 1
0 1 0
1 0 0
1 1 0
3
Logical symbol
Exclusive gates
EX-OR gate
EXclusive-OR. This is like an OR gate but excluding both inputs being true. The output is true if
inputs A and B are DIFFERENT. EX-OR gates can only have 2 inputs.
The output Q is true if either input A is true OR input B is true, but not when both of them are
true: Q = A ⊕ B
0 0 0
0 1 1
1 0 1
1 1 0
Logical symbol
4
EX-NOR gate
EXclusive-NOR. This is an EX-OR gate with the output inverted, as shown by the 'o' on the symbol
output. EX-NOR gates can only have 2 inputs. The output Q is true if inputs A and B are
the SAME (both true or both false): Q = 𝐴 ⊕ 𝐵
0 0 1
0 1 0
1 0 0
1 1 1
Logical symbol
5
NOR Gate Operations