Chapter 2
Chapter 2
LOGIC GATES
Objectives
OR, AND, NOT, NAND, NOR, XOR and XNOR logic gates.
Logic expression.
Logic Circuits.
Truth Table.
9 Logic Gates
The basic building block of any digital circuit is a logic gate. OR, AND and NOT
gates are the most basic gates. All other gates can be constructed using these
three gates. Four other gates are NOR, NAND, XOR and XNOR gates.
A logic gate has at least one and only one output. Let A and B represent two
input variables listed on the left, and the output Y on the right. Logic gates
operate with binary numbers. A binary 0 will mean a Low voltage (+0 volt) and a
binary 1 will mean a High voltage (+5 volt). All possible input combinations for A
and B and the output Y are shown using a truth table.
2.2 OR Gate
The output of an OR gate is 1 if any of the inputs are 1. The parallel circuit
shows the idea of an OR gate. The output lamp Y will light when either or both of
the input switches are closed.
A
Y
B
The Boolean expression for an OR gate is 𝑌 = 𝐴 + 𝐵. Note that the plus (+) sign
means OR in Boolean algebra. It is read as A OR B equals Y. The OR truth table
can be expressed as follows:
0+0 = 0
0+1 = 1
1+0 = 1
1+1 = 1
3
A 3 input OR logic gate will have 2 = 8 input combinations. The input variables
are A, B and C. Note that if any of the inputs are 1, the output will be 1.
10 Logic Gates
Y=A+B+C Y=A+B+C+D
The output of an AND gate is 1 if all of the inputs are 1. The serial circuit shows
the idea of an AND gate. The output lamp Y will light when both of the input
switches are closed.
The Boolean expression for an AND gate is 𝑌 = 𝐴 ⋅ 𝐵. Note that the dot ( ) sign
means AND in Boolean algebra. It is read as A AND B equals Y. The dot sign is
generally omitted, so that the expression becomes 𝑌 = 𝐴𝐵. The AND truth table
can be expressed as follows:
0.0 = 0
0.1 = 0
1.0 = 0
1.1 = 1
11 Logic Gates
The NOT gate has only 1 input. It is also called an inverter. The NOT gate
produces an output that is the opposite of the input. If the input is 0, the output
is 1. If the input is 1, the output is 0. Thus, the NOT gate inverts, or complement
the input. The Boolean expression is 𝑌 = 𝐴 , read as ‘A inverted’, ‘A bar’ or ‘A
NOT’.
NAND gate means ‘NOT AND’. It is actually an AND gate followed by an inverter.
In other words, the output of an AND gate is inverted to form a NAND gate. The
NAND gate symbol is an AND gate with an invert bubble at the output. The
Boolean expression is 𝑌 = 𝐴𝐵 .
Logic gates are combined to form a new logic function. This logic circuit is also
known as combinational logic circuit. The output of the circuit is determined by
the Boolean expression. Suppose you are given a Boolean expression 𝑌 = 𝐴 + 𝐵𝐶
The output of 𝐵 is connected as an input to AND gate with C and produce the
output 𝐵𝐶 that become the input to OR gate along with A to produce the output
Y. The truth table is shown below.
13 Logic Gates
2.10 Exercises
a. b.
c. d.
e. f.
g. h.
i. j.
14 Logic Gates
3. Write the Boolean expressions and derive the truth tables for the following
logic circuits:
A
a. 0V
B
0V
C Y
0V
b. A
0V
B
0V Y
C
0V
D
0V
c. A
0V
B
0V
Y
C
0V
15 Logic Gates
a.
b.
c.
d.
e.
f.
g.
h.
5. Draw the logic circuits and derive the truth tables for the following Boolean
expressions:
a. Y A.B(C D)
b. Y ( A B)(C D).C
d. 𝑌 = (𝐴 + 𝐵) 𝐵. 𝐶
e. 𝑌 = (𝐴 + 𝐵)(𝐵 + 𝐶)
f. Y AB ( A C )
g. 𝑌 = 𝐴𝐵⨁𝐶
h. 𝑌 = 𝐴⨁𝐵⨁𝐶