Logic gates are the basic building blocks of digital circuits and perform logical operations. The main logic gates are AND, OR, and NOT. An AND gate outputs 1 only if all its inputs are 1. An OR gate outputs 1 if any of its inputs are 1. A NOT gate inverts its single input. Logic gates are constructed from diodes, transistors, and resistors on a silicon chip and their inputs and outputs represent either 1 or 0, true or false. Combination gates like NAND and NOR are derived from basic logic gates and their truth tables define the output for all possible input combinations.