Page 84 - Programmable Logic Controllers, Fifth Edition
P. 84
Truth table
Inputs Output A AND AB A OR A + B
B B
A B Y
A
Inputs Y 0 0 0
B Output 0 1 1 A A
1 0 1 NAND AB NOR A + B
1 1 0
B B
Figure 4.14 The XOR gate symbol and truth table.
A NOT A
The Exclusive-OR (XOR) Function Figure 4-16 Logic operators used singly to form logical
An often-used combination of gates is the exclusive-OR statements.
(XOR) function. The XOR gate symbol and truth table are
shown in Figure 4-14. The output of this circuit is HIGH the NOT operation. The Boolean equations are used to
only when one input or the other is HIGH, but not both. express the mathematical function of the logic gate.
The exclusive-OR gate is commonly used for the com- PLC digital systems may be designed using Boolean al-
parison of two binary numbers. gebra. Circuit functions are represented by Boolean equa-
tions. Figure 4-16 illustrates how logic operators AND,
NAND, OR, NOR, and NOT are used singly to form logi-
4.3 Boolean Algebra cal statements. Figure 4-17 illustrates how basic logic op-
erators are used in combination to form Boolean equations.
The mathematical study of the binary number system An understanding of the technique of writing simpli-
and logic is called Boolean algebra. The purpose of this fied Boolean equations for complex logical statements is
algebra is to provide a simple way of writing complicated a useful tool when creating PLC control programs. Some
combinations of logic statements. There are many appli- laws of Boolean algebra are different from those of ordi-
cations where Boolean algebra could be applied to solv- nary algebra. These three basic laws illustrate the close
ing PLC programming problems. comparison between Boolean algebra and ordinary alge-
Figure 4-15 summarizes the basic operators of Bool- bra, as well as one major difference between the two:
ean algebra as they relate to the basic AND, OR, and
NOT functions. Inputs are represented by capital letters
A, B, C, and so on, and the output by a capital Y. The COMMUTATIVE LAW
dot (•), or no symbol, represents the AND operation,
an addition sign (+) represents the OR operation, the A + B = B + A
circle with an addition sign ∙ represents the exclusive- A ⋅ B = B ⋅ A
__
OR operation, and a bar over the letter A represents
Logic symbol Logic statement Boolean equation Boolean notations
A Y is 1 if Y = A • B Symbol Meaning
Y or • and
B A and B are 1 Y = AB
+ or
A Y is 1 if – not
Y A or B is 1 Y = A + B
B ° invert
= result in
Y is 1 if A is 0
A Y Y = A
Y is 0 if A is 1
Figure 4-15 Boolean algebra as related to AND, OR, and NOT functions.
Fundamentals of Logic Chapter 4 65
pet73842_ch04_061-073.indd 65 03/11/15 3:52 PM