Logic Gates
Logic Gates
A logic gate is a physical model of a Boolean function, that is, it performs a logical operation on one or
more logic inputs and produces a single logic output. Logic gates are primarily implemented
electronically using diodes or transistors, but can also be constructed using electromagnetic relays (relay
logic), fluidic logic, pneumatic logic etc.
All other types of Boolean logic gates (i.e., AND, OR, NOT, XOR, XNOR) can be created from a suitable
network of NAND gates. Similarly all gates can be created from a network of NOR gates. Historically,
NAND gates were easier to construct from MOS technology and thus NAND gates served as the first
pillar of Boolean logic in electronic computation. For an input of 2 variables, there are 16 possible
boolean algebraic functions. These 16 functions are enumerated below, together with their outputs for
each combination of inputs variables.
AND
INPUT OUTPUT
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
OR A + B
INPUT OUTPUT
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
NOT
INPUT OUTPUT
A NOT A
0 1
1 0
NAND
INPUT OUTPUT
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
NOR
INPUT OUTPUT
A B A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
XOR INPUT OUTPUT
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
INPUT OUTPUT
A B A XNOR B
XNOR or
0 0 1
0 1 0
1 0 0
1 1 1
A 0 0 1 1
INPUT Meaning
B 0 1 0 1
A AND B 0 0 0 1 Output is true if and only if (iff) both A and B are true.