In its most basic form, a computer is a collection of powered and unpowered circuits and transistors. A logic gate is a series of transistors connected together to give one or more outputs, each output being based on the input or combination of inputs supplied to it.
Each type of gate can be represented either as a diagram, in algebraic form, or as a truth table.
Truth Table: The outputs for all conceivable combinations of inputs that may be applied to a logic gate or circuit are listed in a truth table. When we enter values into a truth table, we usually express them as 1 or 0, with 1 denoting True logic and 0 denoting False logic.
OR gates
An OR gate uses two inputs to generate one output. The output is 1 (TRUE) only if either or both of the inputs are 1 (TRUE).
OR gates are represented diagrammatically as:
A represents the first input. B represents the second input. Q represents the output.
An OR gate is represented in the truth table as below.
gates
A NOT gate uses just one input to generate one output. A NOT gate inverts the input - the output is 1 (TRUE) if the input is 0 (FALSE), and the output is 0 (FALSE) if the input is 1 (TRUE).
NOT gates are represented diagrammatically as:
The NOT gate has what appears to be a nose at the front. When using more complex gates, this nose is added to other gates to show they have been combined with the NOT gate.
A NOT gate is represented in the truth table below.
AND
AND gates
An AND gate uses two inputs to generate one output. The output is 1 (TRUE) only if both of the inputs are 1 (TRUE).
A represents the first input. B represents the second input. Q represents the output
A truth table shows, for each combination of inputs, what the output will be. Like logic gates, a 0 in the table represents FALSE, while 1 represents TRUE