Logic gates are the fundamental building blocks of circuits. Circuits are used to perform operations in a computer system. They are mainly used in the arithmetic logic unit known as ALU.
There are 5 main logic gates.
These logic gates take inputs and give a single output.
The AND gate gives as an output when all the inputs are . If there are any 's in the input, the AND gate gives as an output. Think of it as multiplication between and .
The OR gate gives as an output when at least one of the inputs is . If all inputs are , the output is . Think of it as addition between and .
NOT is a simple gate that takes in a single input and reverses its value. Whatever the input, this gate outputs the opposite (i.e., if is inputted, it gives as the output).
The NOR gate is opposite to the OR gate. It gives as an output whenever all inputs are (i.e., is not an input).
The NAND gate gives as an output when there is a single as an input. It gives as an output whenever all inputs are . NAND is opposite of AND.
Free Resources