There are many types of logic these are the 6 main ones
AND Gate
The AND gate will have an output (c) of 1 if both of the inputs (a,b) are also 1, otherwise the output will equal 0.
This can been shown in a truth table like this.
A B Q or C
0 1 0
0 0 0
1 1 1
1 0 0
OR Gate
The OR gate doesn't need both inputs to be 1 like the AND gate, but only needs one to equal 1 for the output to be 1. If both are 1 then the output remains at 1.
The truth table for an OR Gate is.
A B QorC
0 1 1
0 0 0
1 1 1
1 0 1
NOT Gate
A NOT Gate only has one input unlike other gates and its function is to change what ever the input is.
This is shown on its truth table
A Q
0 1
1 0
The reason why there is no B input is because there is only one input(A)
NAND Gate
The NAND is a mixture of the AND Gate and the NOT Gate. It gives opposite outputs of an AND Gate.
A B QorC
0 1 1
0 0 1
1 1 0
1 0 1
NOR Gate
The NOR Gate is a mixture of the OR Gate and the NOT Gate. It swaps every input around to receive the opposite outputs of an OR Gate.
A B QorC
0 1 0
0 0 1
1 1 0
1 0 1
XOR Gate
The XOR Gate is similar to the OR Gate but is exclusive, meaning that if both inputs are 1 te output is 0. But if 1 input is 0 then the input is 1.
A B Q or C
0 1 1
0 0 0
1 1 0
1 0 1