Page 34 - Touhpad Ai
P. 34
Logic gates are usually built using transistors and are found inside integrated circuits (ICs). They are used in building
blocks such as counters, processors, and memory circuits. A logic gate takes digital signals (0 or 1) as inputs and produces
one output based on a logical rule.
1 means True 0 means False
You can think of a logic gate like a light switch: based on the inputs, the output
will either turn ON (1) or OFF (0). When many logic gates are combined, they
can perform complex tasks like arithmetic operations, decision-making,
and data processing.
Most logic gates have two inputs and one output, but some can have more
inputs.
Basic Logic Gates
There are seven types of basic gate and each type of gate behaves differently. Let us study each in detail:
AND Gate
The AND gate gives an output of 1 (True) only if all its inputs are 1. If any input is 0, the output is 0.
The following figure shows the circuit symbol and truth table of the AND gate:
Truth Table of AND Gate
Input 1 Input 2 Output
0 0 0
0 1 0
1 0 0
1 1 1
The above figure shows the circuit symbol and logic combinations for an AND gate. Let us understand through an example.
"I will go out to play if it’s sunny AND I finish my homework."
OR Gate
The OR gate gives an output of 1 (True) if any one or more inputs are 1. Output is 0 only if all inputs are 0.
The following figure shows the circuit symbol and truth table of the OR gate:
Truth Table of OR Gate
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 1
Let us understand through an example. Your teacher says, “You will get a chocolate if you submit your homework or
answer a question in class.”
XOR Gate
The XOR gate, also called Exclusive OR, gives an output of 1 only when the two inputs are different. If both inputs are the
same—either 0 and 0 or 1 and 1—the output will be 0.
32 Touchpad Artificial Intelligence - XI

