Sie sind auf Seite 1von 17

Chapter 2

Boolean Logics and Logic Gates

Objectives: After completing this chapter, you should be able to:


• Understand the basic operation of Boolean theorems.
• Explain the operation of different logic gates such as AND, OR, NOT, XOR, and
NAND gates.
• Show the truth table of different logic gates.
• Distinguish between the different types of integrated circuits (ICs).
• Apply Boolean theorems to simplify Boolean function.
• Draw logic circuit for Boolean function.
• Show the truth table of Boolean function.
• Find the output function of a digital logic circuit.
• Distinguish between the SSI, MSI, LSI, and VLSI.

2.1 Introduction

Logic gates are made of transistors, and they are the basic components of integrated
circuit (IC). Logic gates are used for designing digital system; there are three basic
logic operations and they are called AND, OR, and NOT. The characteristic of a
digital system can be represented by a function or truth table. Boolean theorems are
used to simplify Boolean function in order to use fewer logic gates. Integrated
circuits are classified based on the number of gates that they contain, and they are
called SSI, MSI, LSI, and VLSI.

© Springer International Publishing AG 2018 29


A. Elahi, Computer Systems, https://doi.org/10.1007/978-3-319-66775-1_2
30 2 Boolean Logics and Logic Gates

2.2 Boolean Logics and Logic Gates

AND Logic The AND logic is denoted by a period “.,” but most of the time, the
period is left out. X.Y or XY is pronounced as X AND Y.

X AND Y ¼ Z, Z ¼ 1 if and only if X ¼ 1 and Y ¼ 1 otherwise Z ¼ 0:

The AND logic operation can be represented by the electrical circuit of Fig. 2.1.
Assume X and Y are switches and Z is the light; X ¼ 0, Y ¼ 0 means the
switches are open and the light being off means zero and the light on means one.
Then we can make a table; Table 2.1 shows the operation of Fig. 2.1.
Figure 2.2 shows a 2-input AND gate and Table 2.2 shows the truth table for the
AND gate. The output of the AND gate is one when both inputs are one.
OR Logic. The OR operation is represented by a plus sign, “þ” or a V, where “þ”
is the most popular symbol used. X þ Y is pronounced X OR Y.
X þ Y ¼ Z, Z ¼ 1 if X ¼ 1 OR Y ¼ 1 or both X ¼ 1 and Y ¼ 1:

The OR operation can be represented by the electrical circuit in Fig. 2.3. In


Fig. 2.3, the light is off when both switches are off, and the light is on when at least
one switch is closed. Figure 2.4 shows a 2-input OR gate and Table 2.3 shows truth
table for the 2-input OR gate.

Fig. 2.1 Representation of X Y


the AND operation

Light

Table 2.1 Operation of X Y Light


Fig. 2.1
Off Off Off
Off On Off
On Off Off
On On On

Fig. 2.2 2-input AND gate X


Z=XY
Y
2.2 Boolean Logics and Logic Gates 31

Table 2.2 AND gate truth X Y Z


table
0 0 0
0 1 0
1 0 0
1 1 1

Fig. 2.3 Electrical circuit X


representation of the OR Y
operation

Battery Light

Fig. 2.4 2-input OR gate


X
Z =X +Y
Y

Table 2.3 Truth table of the X Y Z


2-input OR gate
0 0 0
0 1 1
1 0 1
1 1 1

Fig. 2.5 NOT gate


X X

Table 2.4 Truth table for the X X0


NOT gate
0 1
1 0

NOT Logic The NOT logic performs a complement, meaning it converts a 1 to


0 and 0 to 1. Also called an inverter, the NOT X is represented by X0 or X. Figure 2.5
shows the NOT gate and Table 2.4 shows truth table for the NOT gate (inverter).
NAND Gate. Figure 2.6 shows 2-input NAND gate. The NAND gate can be made
from an AND gate and a NOT gate as shown in Fig. 2.7. Table 2.5 shows the truth
table of the 2-input NAND gate.
NOR Gate. Figure 2.8 shows a NOR logic gate. NOR gates are made of OR and
NOT gates. Table 2.6 shows the truth table of the 2-input NOR gate.
32 2 Boolean Logics and Logic Gates

Fig. 2.6 2-input NAND X


gate XY
Y

Fig. 2.7 AND-NOT gates XY XY


X
used together to act as
NAND Y

Table 2.5 Truth table of the X Y XY


2-input NAND
0 0 1
0 1 1
1 0 1
1 1 0

Fig. 2.8 NOR gate


X
X+Y
Y

Table 2.6 Truth table for the X Y XþY


2-input NOR gate
0 0 1
0 1 0
1 0 0
1 1 0

Fig. 2.9 2-input XOR X


XY’ + X’Y
Y

Table 2.7 Truth table for L


X Y X Y
XOR gate
0 0 0
0 1 1
1 0 1
1 1 0

Exclusive OR L Gate Figure 2.9 shows an exclusive OR gate. Exclusive OR is


represented by and is labeled XOR. Table 2.7 shows the truth table for the XOR
gate.
M
X Y ¼ X0 Y þ XY0
2.3 Integrated Circuit (IC) Classifications 33

Fig. 2.10 Exclusive NOR


gate

Table 2.8 Truth table for X Y XʘY


exclusive NOR gate
0 0 1
0 1 0
1 0 0
1 1 1

Fig. 2.11 Tri-state device

Exclusive NOR Gate Figure 2.10 shows an exclusive NOR gate. Exclusive NOR
is represented by ʘ and labeled XNOR. Table 2.8 shows the truth table for the
exclusive NOR gate.
Tri-State Device
Figure 2.11 shows the diagram of a tri-state device; the control line controls the
operation of tri-state devices.
In Fig. 2.11, if the control line is set to zero, then there is no connection between
input and output (the output is high impedance). If the control line is set to one, then
output value is equal to the input value.
Multiple Inputs Logic Gates
Figure 2.12 shows 3-input AND gate with its truth table, Fig. 2.13 shows 3-input
OR gate with its truth table, Fig. 2.14 shows 3-input NOR gates with its truth table,
and Fig. 2.15 shows 3-input NAD gate with its corresponding table.

2.3 Integrated Circuit (IC) Classifications

A transistor is a basic component of integrated circuits (IC). Figure 2.16 shows a


transistor with an IC. Transistors act like a switch in integrated circuits. An
integrated circuit is made from a hundred to millions of transistors.
Integrated circuits are classified based on the number of the gates inside the IC
such as SSI, MSI, LSI, and VLSI.
34 2 Boolean Logics and Logic Gates

Fig. 2.12 3-input AND X Y Z F


gate and its truth table
0 0 0 0
X 0 0 1 0
0 1 0 0
Y F
0 1 1 0
Z 1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1

Fig. 2.13 3-input OR gate X Y Z F


and its truth table
0 0 0 0
X 0 0 1 1
0 1 0 1
Y F 0 1 1 1
Z 1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

Fig. 2.14 3-input NAND X Y Z F


gate and its truth table
0 0 0 1
X 0 0 1 1
Y 0 1 0 1
F
Z 0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0

Fig. 2.15 3-input NOR X Y Z F


gate and its truth table
0 0 0 1
X 0 0 1 0
Y 0 1 0 0
F
0 1 1 0
Z 1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 0

Small-Scale Integration (SSI) SSI refers to an IC that has less than 10 gates.
Figure 2.17 shows the inside of a 74HC08 (7408) IC, and Fig. 2.18 shows an image
of a 74HC08 IC.
2.3 Integrated Circuit (IC) Classifications 35

Fig. 2.16 Transistor (left),


IC (right)

Fig. 2.17 TTL 7408


14 13 12 11 10 9 8
2 input AND gate

1 2 3 4 5 6 7

Fig. 2.18 74LS08 pins

Integrated Circuit Pins Numbering Figure 2.18 shows a TTL 7408 IC; an IC
chip should be read with the notch on the left hand side. The labeling convention
starts with the left bottom pin under the notch and goes in a counterclockwise
direction.
The left bottom pin is pin #1.
The right bottom pin is pin #7.
The right upper pin is pin #8.
The left upper pin is pin #14.
As shown in Fig. 2.18, the IC number is 74LS08 where LS represents the
material IC was made with. Also on the IC, there is the letter M representing
Motorola which is the manufacturer of the IC, Intel uses the character “i,” and
Texas Instruments uses a map of Texas.
36 2 Boolean Logics and Logic Gates

Medium-Scale Integration (MSI). Refers to an IC that contains between 10 and


100 gates such as decoders and multiplexers.
Large-Scale Integration (LSI). Refers to an IC that contains between 100 and
1000 gates.
Very-Large-Scale Integration (VLSI). Refers to an IC that contains more than
1000 gates.

2.4 Boolean Algebra Theorems

Boolean theorems are used to simplify Boolean functions in order to use fewer
gates. Any variable such as X in binary can have a value of one or zero.
Theorem #1
XþX¼X

Proof: Select X as 0 then 0 þ 0 ¼ 0; select X ¼ 1 then 1 þ 1 ¼ 1 results:


X þ X ¼ X.
Theorem #2
Xþ1 ¼1

Proof: Select X ¼ 0 then 0 þ 1 ¼ 1; select X ¼ 1 then 1 þ 1 ¼ 1; both cases


result in 1 then X þ 1 ¼ 1.
Theorem #3
Xþ0 ¼ X

Proof: Select x ¼ 0 then 0 þ 0 ¼ 0; select X ¼ 1 then 1 þ 0 ¼ 1; the result is


whatever value X is.
Theorem #4
X þ X0 ¼ 1

Proof: Select X ¼ 0 then 0 þ 1 ¼ 1; select X ¼ 1 then 1 þ 0 ¼ 1; in both cases


the result is 1.
Theorem #5
X:X ¼ X

Proof: Select X ¼ 1 then 1.1 ¼ 1; select X ¼ 0 then 0.0 ¼ 0; therefore XX ¼ X.


2.4 Boolean Algebra Theorems 37

Table 2.9 The truth table for X(Y þ Z) ¼ XY þ XZ

Theorem #6
X:1 ¼ X

Proof: Select X ¼ 1 then 1.1 ¼ 1; select X ¼ 0 then 0.1 ¼ 0; therefore X.1 ¼ X.


Theorem #7

X:X0 ¼ 0

Proof: Select X ¼ 0 then 0.1 ¼ 0; select X ¼ 1 then 1.0 ¼ 0; both values of X


result in 0.
Theorem #8
0
ðX 0 Þ ¼ X

(00 )0 ¼ (1)0 ¼ 0, (10 )0 ¼ (0)0 ¼ 1 Whatever the value X has.


Distributive Theorem
XðY þ ZÞ ¼ XY þ XZ

In order to prove the above theorem, the truth table of both sides of the theorem
is generated as shown in Table 2.9 and shows both sides generate the same truth
table.
38 2 Boolean Logics and Logic Gates

Table 2.10 The truth table showing De Morgan’s Law

De Morgan’s Theorem I

ðX þ YÞ0 ¼ X0 Y0

In this theorem the OR between X and Y is negated and changes the OR


operation to the AND operation.
Proof: By making a truth table for both sides of the theorem, it shows that both
sides of the theorem generate the same truth table (Table 2.10).
De Morgan’s Theorem II

ðXYÞ0 ¼ X0 þ Y0

In this theorem the XY is complemented and changes it from an AND operation


to an OR operation with each component complemented.
Example: (WXYZ)0 ¼ W0 þ X0 þ Y0 þ Z0
If the truth table of both sides were generated, then it would show that both sides
have the same truth table result.
Commutative Law
XþY¼ YþX
XY ¼ YX

Associative Law
XðYZÞ ¼ ðXYÞZ
X þ ðY þ ZÞ ¼ ðX þ YÞ þ Z

More Theorems
The following are useful theorems:
2.5 Boolean Function 39

(a) X þ X0 Y ¼ X þ Y
(b) X0 þ XY ¼ X0 þ Y
(c) X þ X0 Y0 ¼ X þ Y0
(d) X0 þ XY0 ¼ X0 þ Y0
Example: Simplify the Following Functions
(a) F(X, Y, Z) ¼ XY0 Z þ XY0 Z0 þ XY
F(X, Y, Z) ¼ XY0 (Z þ Z0 ) þ YZ where Z þ Z0 ¼ 1 then
F(X, Y, Z) ¼ XY0 þ XY ¼ X(Y þ Y0 ) ¼ X
(b) F(X, Y, Z) ¼ (X0 þ Y) (X þ Y0 ) ¼ X0 X þ X0 Y0 þ XY þ YY0 where X0 X and
YY0 are zero then F(X, Y, Z) ¼ X0 Y0 þ XY

2.5 Boolean Function

Boolean function is represented by algebraic expression which is made of binary


variables such as X, Y, and Z and logic operations between variables such as AND,
OR, and NOT.
F(X, Y, Z) ¼ X þ YZ is a Boolean function.
Figure 2.19 shows the logic circuit for function F where X, Y, and Z are the
inputs and F is the output; Table 2.11 shows the truth table of the function F.
The truth table shows the characteristics of function F; the function F ¼ 1 when
the inputs to the circuit are 100 or 101 or 110 or 111.

Fig. 2.19 Logic circuit for X


a function F(X, Y, F(X,Y,Z) = X + YZ
Z) ¼ X þ YZ
Y
Z

Table 2.11 The truth table X Y Z YZ X þ YZ


for function F(X, Y,
Z) ¼ X þ YZ 0 0 0 0 0
0 0 1 0 0
0 1 0 0 0
0 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
40 2 Boolean Logics and Logic Gates

Complement of a Function
In order to complement a function, both sides of the function must be
complemented.
Example: Complement the following function:

FðX; Y; ZÞ ¼ XY þ Y0 Z

Complementing both sides of the function F(X, Y, Z) results in the following:

F0 ðX; Y; ZÞ ¼ ðXY þ Y0 Z Þ0 using De Morgan’ s theorem:


F0 ðX; Y; ZÞ ¼ ðXYÞ0 ðY0 ZÞ0
F0 ðX; Y; ZÞ ¼ ðX0 þ Y0 ÞðY þ Z0 Þ

Example: Find the complement of the following function:

FðX; Y; ZÞ ¼ ðX0 þ Y0 ÞðY þ Z0 Þ

Complement both sides of the function:


0
F0 ðX; Y; ZÞ ¼ ½ðX0 þ Y0 ÞðY þ Z0 Þ

Applying De Morgan’s theorem results

F0 ðX; Y; ZÞ ¼ ½ðX0 þ Y0 Þ 0 þ ½ðY þ Z0 Þ 0


F0 ðX; Y; ZÞ ¼ ½ðXYÞ þ ½ðY0 ZÞ
F0 ðX; Y; ZÞ ¼ ðXYÞ þ ðY0 ZÞ

2.6 Summary

• Boolean logic consists of the AND, OR, and NOT logics.


• The output of the 2-input AND gate is one when both inputs are one; otherwise
the output is zero.
• The output of the 2-input OR gate is one when at least one of the inputs is one;
otherwise the output is zero.
• NOT gate performs one’s complement.
• The integrated circuits (IC) are classified by SSI (small-scale integration), MSI
(medium-scale integration), LSI (large-scale integration), and very-large-scale
integration.
• A NAND gate is equivalent of the AND-NOT.
• A NOR gate is equivalent of the NOR-NOT.
• The 2-input XOR has output one when the inputs are not equal; otherwise the
output is zero.
2.6 Summary 41

• The 2-input exclusive NOR (XNOR) is equivalent of the XOR-NOT.


• Chapter 3 will cover minterms and maxterms, apply K-map to simplify a
function, and use universal gates to draw logic circuit.
Problems
1. Show truth table for 4-input AND, OR, NOR, and NAD gates.
2. If A ¼ 11001011 and B ¼ 10101110, then what is the value of the following
operations:
(a) A AND B
(b) A OR B
3. If A ¼ 11001011 and B ¼ 10101110, what is the value of the following
operations (F in hex ¼ 1111):
(a) A NOT
(b) A XOR B
(c) A AND 0F
(d) A AND F0
4. Draw a logic circuit for the following functions:
(a) F(X, Y, Z) ¼ XY0 þ XZ0 þ YZ
(b) F(X, Y, Z) ¼ (X þ Y0 ) (X0 þ Z0 )(Y þ Z)
5. Use Boolean theorems to simplify the following expressions:
(a) XþXþX
(b) XY þ XY
(c) YYY
(d) X þ XY
(e) XY0 þ Y0
(f) (X þ Y)Y0
(g) (XY) þ (XY)0
(h) X0 Y0 þ XY
6. Simplify the following functions:
(a) F(X, Y, Z) ¼ XY þ X0 Y þ XZ
(b) F(X, Y, Z) ¼ (X þ Y) (X0 þ Y þ Z)
(c) F(X, Y, Z) ¼ XY0 Z þ XYZ þ Y0 Z
(d) F(X, Y, Z) ¼ XY þ X0 YZ
(e) F(X, Y, Z) ¼ X0 Y þ XYZ0
(f) F(X, Y, Z) ¼ (XY) þ (X þ Y þ Z)0 X þ YZ
(g) F(X, Y, Z) ¼ (XY)0 þ (X þ Y þ Z)0
7. Find the truth table for the following functions:
(a) F(X, Y, Z) ¼ XY0 þ YZ þ XZ0
(b) F(X, Y, Z) ¼ (X þ Y0 )(Y þ Z)(X0 þ Z0 )
42 2 Boolean Logics and Logic Gates

8. If A ¼ 10110110 and B ¼ 10110011, then find


(a) A NAND B
(b) A NOR B
(c) A XOR B
9. Find the output of the following gates:
(a)

(b)

(c)

(d)

(e)

1
2.6 Summary 43

10. Show the output of the following logic circuits:


(a)

A
B

A
C

(b)

A
B

B
C

(c)

A
B

B
C
44 2 Boolean Logics and Logic Gates

11. Find the output function of the following logic circuits:

A
A
B

B
C

B
C

A
B

C
A
C

B
C

12. Find the output function of the following logic circuit:

X
Y
Z

13. Draw a logic circuit and show the truth table for the following functions:
(a) F(X, Y) ¼ (XY)0 þ X(X þ Y0 )
(b) F(X, Y, Z) ¼ (X þ Y þ Z0 )0 (X0 þ Y0 )
(c) F(X, Y, Z) ¼ (X XOR Y) (X NOR Y0 )
(d) F(X, Y, Z) ¼ (X0 þ Y0 þ Z) (X þ Y)
2.6 Summary 45

14. Show truth table for each of the following functions:


(a) F(X, Y, Z) ¼ XY0 þ XZ0 þ YZ
(b) F(X, Y, Z) ¼ (X þ Y) (X þ Z0 )
(c) F(X, Y, Z) ¼ XY (Y þ Z0 )
15. Simplify the following functions:
(a) F(X, Y, Z) ¼ YZ þ (X þ Y)0 þ (XYZ)0
(b) F(X, Y, Z) ¼ (X þ Y þ Z)0 (X þ Y)
16. Draw Logic circuits for the following functions
(a) F(X, Y, Z) ¼ (X þ Y)0 þ YZ
(b) F(X, Y, Z) ¼ (XYZ)0 þ XZ þ YZ

Das könnte Ihnen auch gefallen