Professional Documents
Culture Documents
Chapter 7
Chapter 7
Logic Systems
Logic Gates: are the basic building blocks for digital
electronic circuits.
Digital vs Analog Waveforms
+5 +5
1 0 1
V V
Time Time
–5 –5
1
Boolean Algebra and Logical Operators
2
Logic Functions
AND Operation
Both inputs must be true for the output to be true.
3
OR operation
A coil is not energized until either Normally open switch A
or B is closed.
4
NOR Operation
There has to be an output neither A nor B has input.
That is, when there is input to either A or B output ceases.
5
NAND Operation
There is no output when both A and B have an
input.
6
Exclusive-OR (XOR) Operation
No output when the status of both the inputs is same.
In other words, No output when there is no input to both
A and B and when there is an input to both A and B
7
Combinational logic: is used for the combining
two or more basic logic gates to form a required
function.
A combinational circuit consists of logic gates whose
outputs, at any time, are determined by combining
the values of the inputs.
For n input variables, there are 2n possible binary
input combinations.
For each binary combination of the input variables,
there is one possible output.
8
Combinational logic…
Hence, a combinational circuit can be described by:
1. A truth table that lists the output values for each
combination of the input variables, or
2. m Boolean functions, one for each output
variable.
9
Sequential Logic
Where a system requires an output which depends
on the values the inputs, a sequential logic system is
required.
It has some form of memory.
Combinational
outputs Memory outputs
Combinational Memory
logic elements
External inputs
11
Combinational vs. Sequential Circuits
Combinational circuits are memory-less. Thus, the
output value depends ONLY on the current input
values.
Sequential circuits consist of combinational logic
as well as memory elements (used to store certain
circuit states). Outputs depend on BOTH current
input values and previous input values (kept in the
storage elements).
Memory element: a device which can remember
value indefinitely, or change value on command
from its inputs.
12
Flip -flop
The Flip-flop is the basic memory element which is
made up of an assembly of logic gates and sequential
logic device.
Flip-flops are memory elements that change state on
clock signals.
Memory Q
command element stored value
clock
Positive pulses
14
Timers/Counters
Timer: is a device that counts
the increments of time.
It is a special operand of PLC,
which represents a time delay
relay in a relay logic system.
It is possible to achieve time delays in the range of few
milliseconds to few hours.
Timers are represented by boxes in a ladder diagram.
When timer is receives an enable status, the timer
starts timing an activity. The timer compares its
current time with preset time.
15
Timer…
16
On-Delay Timer(TON)
When there is an I/P signal,
the O/P signal becomes on
with certain delay (Preset time).
But when the input signal is absent, the output signal
becomes off immediately.
The timer resets to zero when the input signal
becomes off (i.e., enabling inputs goes to a logic 0.)
Output is not observed until input
pulse width greater than the delay
time.
18
Equivalent PLC program
Switch S1is connected to input A, and the pilot lamp
(PL1) is connected to output B.
When the switch close, the
contact A closes and timer
T37 begins timing.
After 5 seconds, the timer
output becomes a logic 1,the
T37 contact closes, output B becomes a logic 1, and the
light turns on.
19
Retentive on-delay timer (TONR)
TONR functions just like TON . But does not reset (to zero)
when the input changes.
The timer must be reset with a RESET (R) instruction.
20
Retentive on-delay timer (TONR)…
Operation
21
Off-delay Timer
When the input signal become off the output signal
becomes ‘off’ with certain delay.
But when the input signal becomes on,
the output signal becomes on immediately.
23
Counters. . .
25
Count down counter (CTD)
26
Count UP/DOWN counter (CTUD)
27