Electric Logic
•Logical values can easily be expressed by electrical circuits.
•“True” or “1” can be defined as voltage on a wire while “False” or “0” can be defined as no voltage. We will use positive logic.
•Analog values can be anything while digital only has discrete values, 0 or 1 •Electrical devices called “gates” can implement the logical
Logic Gates & Symbols
Note that gates can have more than 2 inputs
Truth table of all gates:
AND gate
•The AND gate is an electronic circuit that gives a true output (1) only if all its inputs gives a true output (1) only if all its inputs are true. A dot (·) is used to show the AND operation i.e. A·B. Note that the dot is sometimes omitted i.e. AB
Inputs and Outputs
•The inputs can be considered as logical (true or false) values.
•You can also think of the inputs as voltage (true) or ground (false).
•The output of the gate will also be voltage (true) or ground (false).
Ladder logic in PLC for AND gate is shown below.It gives similar result as AND logic gate.
OR gate
•The OR gate is an electronic circuit that gives a true output (1) if one or more of its gives a true output (1) if one or more of its inputs are true. A plus (+) is used to show the OR operation.
Ladder logic in PLC for OR gate is shown below.It gives similar result as OR logic gate.
NOT gate
•The NOT gate is an electronic circuit that produces an inverted version of that produces an inverted version of the input at its output.
•It is also known as an inverter.
•If the input variable is A, the inverted output is known as NOT A.
•This is also shown as A', or Ā ,with a bar over the top A’
Ladder logic in PLC for NOT gate is shown below.It gives similar result as NOT logic gate.
NAND gate
•This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.
•The outputs of all NAND gates are true if any of the inputs are false.
•The symbol is an AND gate with a small circle on the output. The small circle represents inversion.
Ladder logic in PLC for NAND gate is shown below.It gives similar result as NAND logic gate.
NOR gate
•This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate.
•The outputs of all NOR gates are false if any of the inputs are true.
•The symbol is an OR gate with a small circle on the output. The small circle represents inversion represents inversion.
Ladder logic in PLC for NOR gate is shown below.It gives similar result as NOR logic gate.
EX-OR gate
•The 'Exclusive-OR' gate is a circuit which will give a true output if either, but not both, of its two inputs are true.
•An encircled plus sign ( ) is used to show the EX-OR operation.
Ladder logic in PLC for EX-OR gate is shown below.It gives similar result as EX-OR logic gate.
EX-NOR gate
•The 'Exclusive-NOR' gate circuit does the opposite to the EX-NOR gate.
•It will give a false output if either, but not both, of its two inputs are true.
•The symbol is an EX-NOR gate with a small circle on the output small circle on the output.
•The small circle represents inversion.
•Logic gates representation using the Truth table.
Ladder logic in PLC for EX-NOR gate is shown below.It gives similar result as EX-NOR logic gate.
Logical Equivalence
•Circuits are logically equivalent if they produce the same truth table output. Similarly we can make many Logic using Logical gates as shown below.
Four input AND gate is shown below:
Two input,Three input and Four input OR gates are shown below: