58 Chapter 4 Fundamentals of Logic
the outcome and a symbol that represents the operation.
For the purpose of this discussion, the outcome or out-
put is called Y and the signal inputs are called A, B, C,
and so on. Also, binary 1 represents the presence of a
signal or the occurrence of some event, and binary 0
represents the absence of the signal or nonoccurrence
of the event.
The AND Function
The symbol drawn in Figure 4-3 is that of an AND gate.
An
AND gate is a device with two or more inputs and
one output. The AND gate output is 1 only if all in-
puts are 1. The AND truth table in Figure 4-3 shows
the resulting output from each of the possible input
combinations.
Logic gate truth tables show each possible input to the
gate or circuit and the resultant output depending upon the
combination of the input(s).
Since logic gates are digital ICs (Integrated Circuits)
their input and output signals can be in only one of two
possible digital states, i.e., logic 0 or logic 1. Thus, the
logic state of the output of a logic gate depends on the
logic states of each of its individual inputs. Figure 4-4
4.1 The Binary Concept
The PLC, like all digital equipment, operates on the bi-
nary principle. The term binary principle refers to the idea
that many things can be thought of as existing in only one
of two states. These states are 1 and 0. The 1 and 0 can
represent ON or OFF, open or closed, true or false, high or
low, or any other two conditions. The key to the speed and
accuracy with which binary information can be processed
is that there are only two states, each of which is distinctly
different. There is no in-between state so when informa-
tion is processed the outcome is either yes or no.
A logic gate is a circuit with several inputs but only
one output that is activated by particular combinations of
input conditions. The two-state binary concept, applied
to gates, can be the basis for making decisions. The high
beam automobile lighting circuit of Figure4-1 is an ex-
ample of a logical AND decision. For this application,
the high beam light can be turned on only when the light
switch AND the high beam switch are closed.
The dome light automobile circuit of Figure 4-2 is an
example of a logical OR decision. For this application, the
dome light will be turned on whenever the passenger door
switch OR the driver door switch is activated.
Logic is the ability to make decisions when one or
more different factors must be taken into account before
an action is taken. This is the basis for the operation of
the PLC, where it is required for a device to operate when
certain conditions have been met.
4.2 AND, OR, and NOT Functions
The operations performed by digital equipment are
based on three fundamental logic functions: AND, OR,
and NOT. Each function has a rule that will determine
Figure 4-1 The logical AND.
High beam
light
Light switch
High beam
switch
In
uts Out
ut
AND
Figure 4-2 The logical OR.
Dome light
Passenger
door switch
Driver
door switch
Inputs Output
AND
Figure 4-3 AND gate.
A
B
Output
Y
Two-input AND
gate symbol
Inputs
0
0
1
1
0
1
0
1
0
0
0
1
AB Y
Inputs
AND truth table
Output
Figure 4-4 AND logic gate digital signal states.
Truth table
0
0
1
1
A
0
1
0
1
B
0
0
0
1
Y
1
Output (Y ) 1
1
0
Output (Y ) 0
0
1
Output (Y ) 0
0
0
Output (Y ) 0
1
B
A
B
A
B
A
B
A
pet10882_ch04_057-070.indd 58pet10882_ch04_057-070.indd 58 7/23/10 9:12 PM7/23/10 9:12 PM