2. 2
CMSC 250
Introduction
Logic gates are the basic components in digital
electronics.
These gates are used to create digital circuits right
from simple to complex logic circuit and even
complex integrated circuits.
Complex microprocessor or microcontroller ICs are
constructed using many logic gates.
Logic gates are the fundamental building blocks of all
digital systems including computers.
It has one or more inputs and one output with some
logical relationship between them.
Logic gate accepts binary signals i.e. True or False,
ON or OFF, 1 or 0 and have an ability to make
decisions
3. 3
CMSC 250
Introduction
The state of the output is decided by the input states.
All logic gates implements some Boolean function
which correlates output with input through some
logical operation.
Logic gates are mainly designed with the electronic
switches using diodes and transistors.
4. 4
CMSC 250
NOT gate
NOT gate has one-input and one-output.
It is a logic circuit whose output is always the
complement of the input.
The NOT gate is popularly known as inverter. It
performs logical inversion or complementation.
The logic symbol and the Truth table:
R=~P
5. 5
CMSC 250
AND gate
AND gate is a logic circuit having two or more inputs
and one output.
The AND gate performs logical multiplication.
The output of an AND gate is HIGH only when all of
its inputs are in the HIGH state. In all other cases, the
output is LOW. For AND gate, Y = A.B
The logic symbol and the truth table:
6. 6
CMSC 250
OR Gate
An OR gate is a logic circuit with two or more inputs
and one output.
The OR gate performs logical addition.
The output of an OR gate is HIGH only when all of its
inputs are in the HIGH state. In all other cases, the
output is LOW. For OR gate, Y = A + B.
Logic symbol and truth table:
7. 7
CMSC 250
NAND gate
NAND gate is combination of AND and NOT gates.
The NAND gate provides AND functions with inverted
output.
The output of a NAND gate is a logic ‘0’ when all its
inputs are a logic ‘1’. For all other input combinations,
the output is a logic ‘1’.
NAND gate operation is logically expressed as P | Q
≡ ∼(P ∧ Q)
Symbol logic and truth table:
8. 8
CMSC 250
NOR gate
NOR gate is combination of OR and NOT gates.
The NOR gate provides OR function with inverted
output.
The output of a NOR gate is a logic ‘1’ when all its
inputs are logic ‘0’. For all other input combinations,
the output is a logic ‘0’.
NOR gate operation is logically expressed as P ↓ Q ≡
∼(P ∨ Q). the logic symbol and truth table:
9. 9
CMSC 250
XOR (Exclusive OR) gate
An XOR gate is a two inputs and one output logic
circuit.
The output of an XOR gate is at logic ‘1’ when the
inputs are dissimilar and at logic ‘0’ when the inputs
are similar.
The logic equation for two input XOR gate is given by
X = A⊕B=A'B + AB’
10. 10
CMSC 250
XNOR gate
XNOR is obtained by the combination of NOT and
XOR gates.
XNOR gate has a two inputs and one output.
The output of an XNOR gate is at logic ‘1’ when the
inputs are similar and at logic ‘0’ when the inputs are
dissimilar.
The following is the Boolean expression of the XNOR
gate: Y = A ⊙ B= AB + A'B'
11. 11
CMSC 250
Universal Logic Gates
Any Boolean / logic expression can be realized using
the AND, OR, and NOT gates.
From these three primary gates, two derived gates
NAND and NOR are usually realized.
It is possible to construct basic gates namely NOT,
AND, OR using combination of NAND gates or a
combination of NOR gates.
For this reason NAND and NOR gates are called as
universal logic gates.
21. 21
CMSC 250
Constructing Circuits for Boolean
Expressions
Construct circuits for the following Boolean
expressions.
a. (∼P ∧ Q) ∨ ∼Q
b. ((P ∧ Q) ∧ (R ∧ S)) ∧ T
22. 22
CMSC 250
Designing a Circuit for a Given
Input/Output Table
Design a circuit for the following input/output table:
(P ∧ Q ∧ R) ∨ (P∧ ∼Q ∧ R) ∨ (P∧ ∼Q∧ ∼R).