A logic gate is a fundamental building block of a digital circuit. It is an electronic device that performs a logical operation based on the principles of Boolean algebra.
A logic gate takes one or more binary inputs (values of 0 or 1, representing false or true) and produces a single binary output based on a specific logical rule. The basic types of logic gates are:
AND (outputs 1 only if all inputs are 1)
OR (outputs 1 if any input is 1)
NOT (inverts the input; 1 becomes 0, 0 becomes 1)
These gates are combined to create more complex circuits that perform calculations and other operations inside a computer.