0% found this document useful (0 votes)
103 views

Ch04 Fundamentals of Logic

Uploaded by

Dupree Cleveland
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Ch04 Fundamentals of Logic

Uploaded by

Dupree Cleveland
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

®

Because learning changes everything.

Programmable
Logic
Controllers
Frank D.
Petruzella

Sixth Edition

© McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 4
Fundamentals
of Logic

Access the text alternative for slide images.

© McGraw Hill LLC 2


Section 4.1

The Binary Concept

© McGraw Hill LLC 3


The Binary Concept
Binary refers to the idea that many things can be
thought of as existing in only one of two states.

The binary states


are 1 and 0

The 1 and 0 can represent:


ON or OFF
Open or Closed
True or False
High or Low

© McGraw Hill LLC 4


Logic Gate
A logic gate is a circuit with several inputs but
only one output that is activated by particular
combinations of input conditions.
Logical AND Gate

The high beam light of an automobile is programmed


to be turned on only when the light switch AND the
high beam switch are closed.
Access the text alternative for slide images.

© McGraw Hill LLC 5


The dome light of an automobile is programmed to
be turned on whenever the passenger door switch
OR the driver door switch is activated.

Logical OR Gate

Access the text alternative for slide images.

© McGraw Hill LLC 6


Section 4.2

AND, OR, and NOT Functions

© McGraw Hill LLC 7


AND Function A
The AND Function
An AND gate is a
device with two or
more inputs and
one output.

Access the text alternative for slide images.

© McGraw Hill LLC 8


AND Function B
The AND Function

• If all inputs are 1,


the output will be 1.

• If any input is 0, the


output will be 0.
Access the text alternative for slide images.

© McGraw Hill LLC 9


AND Function C
The AND Function

© McGraw Hill LLC Access the text alternative for slide images.
10
OR Function A
The OR Function
An OR gate can have
any number of inputs
but only one output.

Access the text alternative for slide images.

© McGraw Hill LLC 11


OR Function B
The OR Function

• If one or more inputs are


1, the output is 1.

• If all inputs are 0, the


output will be 0.
Access the text alternative for slide images.

© McGraw Hill LLC 12


OR Function C
The OR Function

Truth table
SW- A SW- B Light
Open (0) Open (0) Off (0)
Open (0) Closed (1) On (1)
Closed (1) Open (0) On (1)
Closed (1) Closed (1) On (1)
Access the text alternative for slide images.

© McGraw Hill LLC 13


NOT Function A
The NOT Function
The NOT function can
have only one input.

Access the text alternative for slide images.

© McGraw Hill LLC 14


NOT Function B
The NOT Function

The result of the NOT operation is always


the inverse of the input, and the NOT
function is, therefore, called an inverter.
Access the text alternative for slide images.
© McGraw Hill LLC 15
NOT Function C
The NOT Function

The NOT function can be


performed on a contact
input simply by using a
normally closed instead of a
normally open contact.

Truth table
Pushbutton Light
Not pressed (0) On (1)
Pressed (1) Off (0)

© McGraw Hill LLC 16


NOT Function D
The NOT Function
NOT function used in conjunction with an AND
gate on a low pressure indicator circuit.

Truth table
Pressure Pressure
switch Power indicator
0 1 1
1 1 0

Access the text alternative for slide images.

© McGraw Hill LLC 17


The NAND Function

An AND gate with an


inverted output is
called a NAND gate.

Access the text alternative for slide images.

© McGraw Hill LLC 18


The NOR Function

A OR gate with an
inverted output is
called a NOR gate.

Access the text alternative for slide images.

© McGraw Hill LLC 19


The Exclusive-OR (XOR) Function

The exclusive-OR gate


is commonly used for
the comparison of two
binary numbers.
Access the text alternative for slide images.

© McGraw Hill LLC 20


Section 4.3

Boolean Algebra

© McGraw Hill LLC 21


Boolean algebra
The mathematical study of the binary number
system and logic is called Boolean algebra.

Boolean algebra is used to write combinations of


logic statements that are used to solve PLC
programming problems.
Access the text alternative for slide images.

© McGraw Hill LLC 22


Boolean algebra: AND, OR, NOT
Boolean algebra as related to AND, OR, and NOT
functions.

Access the text alternative for slide images.

© McGraw Hill LLC 23


Logical statements
Logic operators used form logical statements.

Access the text alternative for slide images.

© McGraw Hill LLC 24


Boolean equations

Logic
operators
used to
form
Boolean
equations.

Access the text alternative for slide images.

© McGraw Hill LLC 25


Laws of Boolean algebra
Some laws of Boolean algebra are similar to
those of ordinary algebra.
COMMUTATIVE LAW
A+B=B+A
AB= B A

ASSOCIATIVE LAW
( A + B) + C = A + ( B + C )
(A  B )  C = A  ( B  C )

DISTRIBUTIVE LAW
This law holds true only A  ( B + C ) = ( A  B) + ( A  C )
in Boolean algebra A + ( B  C ) = ( A + B)  ( A + C )
© McGraw Hill LLC 26
Section 4.4

Developing Logic Gate


Circuits from Boolean
Expressions

© McGraw Hill LLC 27


Y=AB+C
Logic gate circuit developed from the
Boolean expression Y = AB + C.
Gates required:
1 - AND gate with input A and B
1 - OR gate with input C and output from previous
AND gate

Access the text alternative for slide images.

© McGraw Hill LLC 28


Y=A(BC+D)
Logic gate circuit developed from the
Boolean expression Y = A (BC + D).
Gates required:
1 - AND gate with input B and C
1 - OR gate with inputs BC and D
1 - AND gate with inputs A and the output from
the OR gate

Access the text alternative for slide images.

© McGraw Hill LLC 29


Section 4.5

Producing the Boolean


Equation for a Given Logic
Gate Circuit

© McGraw Hill LLC 30


Logic Circuit A
Determining
the logic circuit
Boolean
equation

The output of the OR gate is A + B

The output of the inverter is D

Based on the input combination applied to the


AND gate the Boolean equation for the circuit
is Y = C D ( A + B )
Access the text alternative for slide images.

© McGraw Hill LLC 31


Logic Circuit B
Determining
the logic circuit
Boolean
equation

The output of AND gate 1 is AB

The output of AND gate 2 is AB

Based on the combination of inputs applied to the OR


gate the Boolean equation for the circuit is
Y = AB + AB
Access the text alternative for slide images.

© McGraw Hill LLC 32


Section 4.6

Hardwired Logic versus


Programmed Logic

© McGraw Hill LLC 33


Hardwired logic
The term hardwired logic refers to logic control
functions that are determined by the way devices
are electrically interconnected.
Hardwired motor
control program.
Hardwired
logic is fixed
and changeable
only by altering
the way devices
are electrically
interconnected.
Access the text alternative for slide images.

© McGraw Hill LLC 34


Programmable control
Programmable control is based on the basic
logic functions, which are programmable
and easily changed.
PLC programmed motor control program.

Access the text alternative for slide images.

© McGraw Hill LLC 35


Ladder Logic
The most common PLC programming language
is ladder logic.

A ladder logic program consists of several rungs, each of


which controls an output.
Each rung is a combination of input conditions
(symbols) connected from left to right, with the symbol
that represents the output at the far right.
Access the text alternative for slide images.

© McGraw Hill LLC 36


Schematic, program, and gate
Relationship between the relay ladder
schematic, the ladder logic program,
and the equivalent logic gate circuit.

Two limit switches connected in series and used to


control a solenoid valve.
© McGraw Hill LLC Access the text alternative for slide images.
37
Two limit switches connected in parallel
and used to control a solenoid valve.

Access the text alternative for slide images.

© McGraw Hill LLC 38


Two limit switches connected in parallel with
each other and in series with a pressure
switch to control a pilot light.

Access the text alternative for slide images.

© McGraw Hill LLC 39


Two limit switches connected in parallel with each
other and in series with two sets of flow switches
(in parallel), and used to control a pilot light.

Access the text alternative for slide images.

© McGraw Hill LLC 40


Two limit switches connected in series with
each other and in parallel with a third limit
switch, and used to control a warning horn.

Access the text alternative for slide images.

© McGraw Hill LLC 41


Two limit switches connected in series with each
other and in parallel with two other limit switches
(in series), and used to control a pilot light.

Access the text alternative for slide images.

© McGraw Hill LLC 42


One limit switch connected in series with a
normally closed pushbutton and used to
control a solenoid valve.

Access the text alternative for slide images.

© McGraw Hill LLC 43


The output lamp of this circuit is ON only when
pushbutton A or B is pressed, but not both.

Access the text alternative for slide images.

© McGraw Hill LLC 44


When either start button is depressed, the
motor runs. Either stop button stops the motor
when it is depressed.

Access the text alternative for slide images.

© McGraw Hill LLC 45


Section 4.7

Programming Word Level


Logic Instructions

© McGraw Hill LLC 46


Selecting Word Logic Instructions

. . . use this
If you want to . . . instruction.
Know when matching bits in two different AND
words are both ON
Know when one or both matching bits in two OR
different words are ON
Know when one or the other bit of matching XOR
bits in two different words is ON
Reverse the state of bits in a word NOT

© McGraw Hill LLC 47


Word-level
AND
instruction

This instruction tells the processor to perform an AND


operation on B3:5 and B3:7 and to store the result in
destination B3:10 when input device A is true.
Access the text alternative for slide images.

© McGraw Hill LLC 48


Word-level
OR
instruction

This instruction ORs the data in Source A, bit by bit,


with the data in Source B and stores the result at the
destination address.
Access the text alternative for slide images.

© McGraw Hill LLC 49


Word-level
XOR
instruction

Data from input I:1.0 are compared, bit by bit, with


data from input I:3.0. Any mismatches energize the
corresponding bit in word O:4.0.
Access the text alternative for slide images.

© McGraw Hill LLC 50


Word-level
NOT
operation.

The bit pattern in B3:10 is the result of the


instruction being true and is the inverse of the bit
pattern in B3:9.
Access the text alternative for slide images.

© McGraw Hill LLC 51


Because learning changes everything. ®

www.mheducation.com

© McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy