
Digital circuits are made up of digital switches called gates. Logic gateslogic gate
circuit component which takes several inputs, compares them with each other, and provides a single output based on a logical function such as AND, OR or NOT. control outputs depending on whether the switches are on or off. A logic gate's behaviour can be described using the terms AND, OR and NOT - or combinations of these.
Programmable interface controllers (PICs) are automated logic gates - digital control devices which can be programmed to behave in preset ways given certain inputs.
Logic gates are at the heart of digital electronics.
A single digital signal can be either ON or OFF, but if there is more than one signal, there are more than two possible states. For example, if there are two signals present there are four possible combinations - ON/ON, ON/OFF, OFF/ON and OFF/OFF - and each combination will produce a different outcome. This is a logic gate.
The graphic shows an AND gate with 2 inputs, both of which can be either ON (represented by 1) or OFF (represented by 0). Because this is an AND gate, both inputs must be ON for there to be an output. The table on the right shows all the possible combinations of inputs and outputs (with the output ON state represented by a 1).

Diagram showing an AND gate with possible outcomes
Now look at an OR gate with the same inputs. An OR gate allows the output to be ON as long as either A or B are ON. The table on the right - called a truth table - shows all the possible inputs and outputs

An OR gate
There are six types of primitive (basic) logic gates that are used in the design of logic systems. The output of the gates is as follows:
The activity allows you to select input states for different logic gates. The truth table shows the possible outcomes for each gate.