How logic gates work: AND OR NOT NAND NOR XOR

How logic gates work: AND OR NOT NAND NOR XOR

Logic gates are the fundamental building blocks for all digital circuits including devices like cellphones, laptops and of course PLCs.  Sometimes, in PLC programs, we use logic gates explicitly but they are always there behind the scenes in every function. The gates perform basic logical functions like AND. (Are both signals "ON"?)

In the program the logic gate outputs will go on or off based on combination of digital signals coming to the inputs. The logic gates are based on boolean algebra (on or off). Most logic gates need two or more input signals and will have one output signal. The output signal of a logic gate can go to another logic gate or an external output signal.

Every logic gate in the program will be in ON or OFF state. The binary conditions are often referred to as false or true. In Zeliosoft its referred to ON or OFF. OFF represents 0 (or 0v), and ON represents 1 (or 24v). Depending on the type of logic gate being used and the combination of inputs, the binary (boolean) output will differ. A logic gate can be thought of as a switch.

zelio-laptop

AND Gates

The AND Gate is used to compare multiple binary (ON or OFF) signals. For the AND Gate to be ON, all the connected signals need to be ON.

If one signal is OFF then the AND gate output signal will be OFF.

AND OFF ON
AND ON ON
AND OFF OFF
AND ON OFF

OR Gates

The OR Gate is used to compare multiple binary (ON or OFF) signals. For the OR Gate to be ON one of the signals connected most be ON.

When all the signals are OFF the OR Gates will be OFF.

 

OR OFF ON
OR ON ON
OR OFF OFF
OR ON OFF

NOT Gates

The NOT Gate is used to convert signals from ON to OFF or from OFF to ON.  The output signal is the opposite of the input signal.

 

NOT OFF
NOT ON

NAND Gates

NAND Gates are a combination of AND Gate and NOT Gate.

The signals are first compared in the AND Gate and after converted to the opposite.

 

NAND OFF ON
NAND ON ON
NAND OFF OFF
NAND ON OFF

NOR Gates

NOR Gates are a combination of OR Gate and NOT Gate.

The signals are first compared in the OR Gate and after converted to the opposite.

NOR OFF ON
NOR ON ON
NOR OFF OFF
NOR ON OFF

XOR Gates

XOR Gate are exclusive OR Gates.

They are similar to OR. For the output to be ON an input must be ON, but not both inputs.

Only if just one input is ON, the output is ON.

 

XOR OFF ON
XOR ON ON
XOR OFF OFF
XOR ON OFF

Simulation zeliosoft

Try the logic yourself. You can use the simulation in Zeliosoft or the PLCtrainingKIT.

To make sure the website can provide free lessons now and in the future. We try to lower are cost by using ads on are website.

Logo PLCtrainingKIT.nl v4 zonder achtergrond PNG
Tax (BTW) NL863412622B01 KvK nr.  84851120
Cookie Policy | Privacy Policy | Terms of Services
  • Youtube

  • Trijnesstraat 9, 5809 AR Leunen The Netherlands

  • Linkedin

  • +31 6 15 67 06 65

  • Instagram

  • info@plctrainingkit.nl

Translate »
Scroll to Top