2. Basic Logic Gates
Logic gates constitute the foundation blocks for digital logic. Let us start by reviewing
these gates and their truth tables:
1. AND Gate
An AND Gate has two or more inputs and produces one output as follows: output = 1 if
all of the inputs are high, output = 0 if one or more of the inputs are low [1].
An OR gate also has two or more inputs and produces one output as follows: output = 1
if one or more inputs are high, output = 0 if all inputs are low [1]:
3. 2. OR Gate:
An OR gate also has two or more inputs and produces one output as follows:
output = 1 if one or more inputs are high, output = 0 if all inputs are low [1]:
4. 3.NOT Gate:
The inverter gate has one input and produces one output as follows: output
=1 if input is low, output = 0 if input is high [1].
4. The NAND gate has two or more inputs and produces one output as follows:
output = 0 if all the inputs are high, output = 1 if any of the inputs are low [1]
5. 5. NOR Gate:
The NOR gate has two or more inputs and produces one output as follows:
output = 1 if all inputs are low, output = 0 if any of the inputs is high [1].
6. EX-OR Gate: The Exclusive-OR gate always has two inputs only and
produces one output as follows: output = 1 when inputs are not similar,
output = 0 when inputs are the same [1].
6. 7. EX-NOR Gate:
The Exclusive-NOR gate always has two inputs only and produces one
output as follows: output = 1 when inputs are both high or are both low,
output = 0 when inputs are not similar [1].
7. Half Adder:
Adding two single-bit binary values X, Y produces a sum S bit and a carry out
C-out bit. This operation is called half addition and the circuit to realize it is
called a half adder.
TRUTH TABLE
X Y SUM CARRY
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
SYMBOL
8. S (X,Y) = (1,2)
S = X'Y + XY'
S = XY
CARRY(X,Y) = (3)
CARRY = XY
CIRCUIT
9. Full Adder
Full adder takes a three-bits input. Adding two single-bit binary values X, Y with a
carry input bit C-in produces a sum bit S and a carry out C-out bit.
Truth Table
X Y Z SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1