JEE Physics • Electronic Devices • Digital Electronics
By: eduPhysics Team Published: 2 December 2026 Reading time: ≈ 15 min Level: JEE Main / Class 12
Introduction: How Do Machines “Decide”?
Your phone unlocks with a fingerprint, a lift refuses to move while its door is open, and a calculator adds 7 + 5 in a blink. Behind every one of these decisions are tiny circuits called logic gates. Each gate looks at one or more inputs that are either ON or OFF and produces a single output according to a simple rule.
In the JEE Main syllabus, logic gates sit inside the Electronic Devices unit, which lists the OR, AND, NOT, NAND and NOR gates. XOR and XNOR are not listed separately, but they appear in half-adder and parity questions, so we cover them too. (Always check the latest official syllabus for changes.)
Key takeaways
- A logic gate is a digital circuit with one or more inputs and exactly one output (0 or 1).
- There are 3 basic gates (AND, OR, NOT) and 2 universal gates (NAND, NOR). XOR and XNOR are derived gates.
- A truth table lists the output for every input combination; n inputs give 2ⁿ rows.
NAND or NOR alone can build any other gate, a favourite JEE concept.
In this post: What is a logic gate? • The 7 gates with symbols and truth tables • Universal gates • Boolean algebra and De Morgan’s laws • Applications • 8 solved JEE numericals • Mistakes to avoid • Practice set • FAQs
1. What Are Logic Gates?
A logic gate is an electronic circuit that performs a logical operation on binary inputs. Inputs and outputs can only be in one of two states:
| Binary value | Voltage level (typical) | Meaning |
| 1 | HIGH (about +5 V in TTL logic) | ON, TRUE, YES |
| 0 | LOW (about 0 V) | OFF, FALSE, NO |
This convention (HIGH = 1, LOW = 0) is called positive logic and is what JEE questions assume. The mathematics behind gates is Boolean algebra, developed by George Boole, where the only numbers are 0 and 1.
What is a truth table?
A truth table lists every possible combination of inputs and the output the gate gives for each one. A gate with n inputs has 2ⁿ rows: 2 inputs → 4 rows, 3 inputs → 8 rows, 4 inputs → 16 rows. Once you master the truth table of a gate, you can answer almost any question on it.
2. The Seven Logic Gates: Symbols and Truth Tables
Here is the full family at a glance. Notice that a small circle (bubble) at the output always means “invert”. That one idea links NAND to AND, NOR to OR and XNOR to XOR.

Figure 1: The seven logic gates and their Boolean expressions
2.1 AND Gate: “all inputs must be 1”

- Boolean expression: Y = A · B (read as “A AND B”)
- Rule: The output is 1 only when every input is 1.
- Real-life picture: Two switches in series with a bulb. The bulb glows only if both switches are ON.
- Maths link: It behaves exactly like binary multiplication (0·0 = 0, 0·1 = 0, 1·0 = 0, 1·1 = 1).
- Common IC: 7408 (quad 2-input AND).
| A | B | Y |
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
2.2 OR Gate: “at least one input is 1”

- Boolean expression: Y = A + B (read as “A OR B”)
- Rule: The output is 1 when any one or more inputs are 1.
- Real-life picture: Two switches in parallel with a bulb. Either switch lights it.
- Careful: In Boolean algebra 1 + 1 = 1, not 2.
- Common IC: 7432 (quad 2-input OR).
| A | B | Y |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
2.3 NOT Gate (Inverter): “flip it”

- Boolean expression: Y = A′ (read as “NOT A” or “A bar”)
- Rule: The output is always the opposite of the input. It is the only basic gate with a single input.
- Hardware link: A transistor in common-emitter configuration works as a NOT gate: HIGH at the base gives LOW at the collector.
- Common IC: 7404 (hex inverter).
| A (input) | Y (output) |
| 0 | 1 |
| 1 | 0 |
2.4 NAND Gate: “NOT AND” (universal gate)

- Boolean expression: Y = (A · B)′ = A′ + B′
- Rule: The output is 0 only when all inputs are 1. In every other case it is 1.
- Why it matters: NAND is a universal gate; any circuit can be built from NAND gates alone.
- Common IC: 7400 (quad 2-input NAND).
| A | B | Y |
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
2.5 NOR Gate: “NOT OR” (universal gate)

- Boolean expression: Y = (A + B)′ = A′ · B′
- Rule: The output is 1 only when all inputs are 0.
- Why it matters: NOR is also a universal gate.
- Common IC: 7402 (quad 2-input NOR).
| A | B | Y |
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
2.6 XOR Gate: “exclusive OR / inputs differ”

- Boolean expression: Y = A ⊕ B = A′B + AB′
- Rule: The output is 1 when the inputs are different. For many inputs it is 1 when the number of 1s is odd.
- Difference from OR: For A = B = 1, OR gives 1 but XOR gives 0.
- Used in: adders, parity generators, error detection.
- Common IC: 7486 (quad 2-input XOR).
| A | B | Y |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
2.7 XNOR Gate: “exclusive NOR / inputs match”

- Boolean expression: Y = (A ⊕ B)′ = AB + A′B′
- Rule: The output is 1 when the inputs are the same, so it acts as an equality detector.
- Used in: digital comparators and digital locks.
| A | B | Y |
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Combined truth table (revision sheet)
| A | B | AND | OR | NAND | NOR | XOR | XNOR |
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Memory tricks
- AND = “all 1s give 1”. OR = “any 1 gives 1”. NAND / NOR = flip the AND / OR column.
- XOR = “odd number of 1s”. XNOR = flip of XOR (“same inputs give 1”).
Look at the last row (1, 1) first: AND 1, OR 1, NAND 0, NOR 0, XOR 0, XNOR 1.
3. Universal Gates: NAND and NOR
A gate is called universal if every other gate (and so any digital circuit) can be built using only that gate. NAND and NOR are universal. This is why chip manufacturers like to use them: one type of gate, mass-produced, builds everything.

Figure 2: Building NOT, AND and OR from NAND gates
How it works:
- NOT from NAND: join both inputs, so Y = (A·A)′ = A′.
- AND from NAND: a NAND followed by a NAND-as-NOT, so Y = ((A·B)′)′ = A·B.
- OR from NAND: invert each input first, then NAND them: Y = (A′·B′)′ = A + B (by De Morgan).
Number of gates needed (a favourite JEE fact):
| Gate to build | Using NAND only | Using NOR only |
| NOT | 1 | 1 |
| AND | 2 | 3 |
| OR | 3 | 2 |
| XOR | 4 | 5 |
4. Boolean Algebra and De Morgan’s Theorems
Boolean laws let you simplify a complicated circuit into a smaller one with fewer gates. These are the ones you need for JEE:
| Law | AND form | OR form |
| Identity | A · 1 = A | A + 0 = A |
| Null (dominance) | A · 0 = 0 | A + 1 = 1 |
| Idempotent | A · A = A | A + A = A |
| Complement | A · A′ = 0 | A + A′ = 1 |
| Commutative | A · B = B · A | A + B = B + A |
| Distributive | A(B + C) = AB + AC | A + BC = (A + B)(A + C) |
| Absorption | A(A + B) = A | A + AB = A |
| Useful extra | A(A′ + B) = AB | A + A′B = A + B |
| Double negation | (A′)′ = A | (same) |
De Morgan’s theorems
(A · B)′ = A′ + B′ and (A + B)′ = A′ · B′ Memory rule: “Break the bar, change the sign.” Split the long bar into separate bars and swap AND ↔ OR. This is exactly why a NAND gate is the same as an OR gate with inverted inputs.
5. Applications of Logic Gates
Logic gates are everywhere. Here are the applications you should be able to explain in an exam answer or interview:
- Computers and microprocessors: the arithmetic logic unit (ALU) is millions of gates working together.
- Arithmetic circuits: half adders and full adders use XOR and AND gates to add binary numbers.
- Memory: two cross-connected NOR (or NAND) gates form an SR latch, the seed of flip-flops and RAM.
- Security and safety systems: burglar alarms (OR of sensors), seat-belt warnings, lift door interlocks (AND).
- Control systems: traffic-light controllers, washing machines, automatic doors, industrial automation.
- Error detection: XOR gates generate and check parity bits in data transmission.
- Comparators and digital locks: XNOR gates tell whether two bits are equal.
- Everyday gadgets: calculators, digital watches, smartphones, TV remotes.
Example 1: The half adder
A half adder adds two single bits A and B. It gives a Sum (XOR of the inputs) and a Carry (AND of the inputs).

Figure 3: Half adder = XOR gate (Sum) + AND gate (Carry)
| A | B | Sum = A ⊕ B | Carry = A · B |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Check: 1 + 1 in binary is 10, so Sum = 0 and Carry = 1. ✔
Example 2: A burglar alarm
The siren should sound if either the door or the window sensor trips and the system is armed: Y = (A + B) · S. One OR gate and one AND gate solve the problem.

Figure 4: A burglar alarm built from an OR gate and an AND gate
6. JEE-Style Numericals with Solutions
Try each problem on your own first, then read the solution. They are graded from Easy to Hard in the style of JEE Main questions.
Question 1 [Easy]
A logic gate has the truth table below. Identify the gate and write its Boolean expression.
| A | B | Y |
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Solution
The output is 0 only when both inputs are 1. That is the signature of a NAND gate.Answer: NAND gate, Y = (A · B)′ = A′ + B′.
Question 2 [Easy]
Both inputs of a NAND gate are joined together and connected to A = 1. What is the output? Which gate does this arrangement act as?
Solution
Y = (A · A)′ = A′. For A = 1: Y = 1′ = 0.Answer: Output = 0; the arrangement works as a NOT gate.
Question 3 [Medium]
Simplify Y = (A + B)(A + B′) and state what the output depends on.
Solution
Expand: Y = A·A + A·B′ + B·A + B·B′
Use A·A = A and B·B′ = 0: Y = A + AB′ + AB = A + A(B′ + B) = A + A·1 = A + A = AAnswer: Y = A. The output follows A alone and is independent of B.
Question 4 [Medium]
In the circuit shown, a NAND gate (inputs A, B) feeds one input of a NOR gate whose other input is C. For which values of A, B and C is the output Y = 1?

Figure 5: NAND → NOR combination
Solution
Let P = (A·B)′. Then Y = (P + C)′.
Y = 1 needs P + C = 0, so P = 0 and C = 0.
P = 0 means (A·B)′ = 0, so A·B = 1, so A = B = 1.Answer: A = 1, B = 1, C = 0 (the only combination).
Question 5 [Medium]
The input waveforms A and B shown are applied to a NOR gate. In which time intervals is the output HIGH?
Solution
A NOR gate gives 1 only when both inputs are 0. Check each interval:
| t1 | t2 | t3 | t4 | t5 | t6 | t7 | t8 | |
| A | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| B | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 |
| Y | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 |

Figure 7: Output Y is HIGH only in t4 and t7Answer: The output is HIGH in intervals t4 and t7.
Question 6 [Medium]
Show that (A · B)′ + A is always equal to 1, whatever the values of A and B.
Solution
Apply De Morgan: (A·B)′ = A′ + B′.
So the expression becomes A′ + B′ + A = (A + A′) + B′ = 1 + B′ = 1.Answer: The output is permanently HIGH (a constant 1).
Question 7 [Hard]
What is the minimum number of NAND gates needed to build an XOR gate? Draw the circuit and prove that it works.
| Solution Use four NAND gates: N1 = (A·B)′, N2 = (A·N1)′, N3 = (B·N1)′ and Y = (N2·N3)′. |
Question 8 [Hard]
For a half adder with A = 1 and B = 1, find the Sum and the Carry. Which binary addition does this represent?
Solution
Sum = A ⊕ B = 1 ⊕ 1 = 0. Carry = A · B = 1 · 1 = 1.Answer: Sum = 0, Carry = 1, which is the binary addition 1 + 1 = 10₂ (decimal 2).
7. Common Mistakes and Exam Tips
Mistakes to avoid
- Writing 1 + 1 = 2 in Boolean algebra. It is 1.
- Confusing NAND with “AND of inverted inputs”. NAND inverts the output of an AND.
- Mixing up OR and XOR in the (1, 1) case: OR gives 1, XOR gives 0.
- Forgetting that NOR is HIGH only when all inputs are LOW.
- Applying De Morgan’s law and forgetting to swap the sign (· ↔ +).
Score-boosting tips
- Substitute all four input combinations. It takes 30 seconds and catches errors.
- Memorise the gate counts: NAND: NOT 1, AND 2, OR 3, XOR 4. NOR: NOT 1, OR 2, AND 3.
- For waveform questions, draw vertical lines at every change and fill in the truth table interval by interval.
- Simplify with De Morgan and absorption before evaluating long expressions.
8. Quick Revision Cheat-Sheet
| Gate | Expression | Output is 1 when… | Universal? |
| AND | A · B | all inputs are 1 | No |
| OR | A + B | at least one input is 1 | No |
| NOT | A′ | the input is 0 | No |
| NAND | (A · B)′ | at least one input is 0 | Yes |
| NOR | (A + B)′ | all inputs are 0 | Yes |
| XOR | A ⊕ B | inputs are different (odd number of 1s) | No |
| XNOR | (A ⊕ B)′ | inputs are the same | No |
9. Practice Questions
Solve these without looking at the notes. The answers are given right below.
Q1. Which gate gives a HIGH output only when its two inputs are different?
Q2. What is the output of Y = (A + B)′ when A = 0 and B = 0?
Q3. What is the minimum number of NOR gates needed to make an OR gate?
Q4. Simplify Y = A + A′B + A′B′.
Q5. How many rows are there in the truth table of a 4-input gate?
Q6. Both inputs of a NAND gate are connected to HIGH. What is the output?
Answer key1. XOR 2. 1 3. 2 (NOR followed by a NOR used as NOT) 4. 1 [A + A′(B + B′) = A + A′ = 1] 5. 2⁴ = 16 6. (1·1)′ = 0
The Electronic Devices unit lists the OR, AND, NOT, NAND and NOR gates. XOR and XNOR are useful derived gates that often appear in adder and parity questions. Always confirm with the latest official syllabus.
Because each of them alone can be wired to produce NOT, AND and OR, and therefore any other digital circuit.
They differ only when both inputs are 1. OR gives 1, but XOR gives 0 because the inputs are not different.
2ⁿ rows for n inputs. Two inputs give 4 rows and three inputs give 8 rows.

Leave a Reply