
Theory of logic gates:
 AND – The output is "true" when both inputs are "true." Otherwise, the output is "false."
 OR – The output is "true" if either or both of the inputs are "true." If both inputs are "false," then the output is "false."
 NOT – It has only one input. It reverses the logic state.
 NAND – The output is "false" if both inputs are "true." Otherwise, the output is "true."
 NOR – Its output is "true" if both inputs are "false." Otherwise, the output is "false."
 XOR – The output is "true" if either, but not both, of the inputs are "true." The output is "false" if both inputs are "false" or if both inputs are "true." Another way of looking at this circuit is to observe that the output is 1 if the inputs are different, but 0 if the inputs are the same.
 XNOR – Its output is "true" if the inputs are the same, and "false" if the inputs are different.
 Using combinations of logic gates, complex operations can be performed. in practice, there is a limit to the number of gates that can be packed into one Integrated Circuit (I.C. or Chip). As IC technology advances – chips are becoming more and more tiny.
Example of a logic Diagram:
 
