Logic Gates and Digital Electronics
Premium Physics notes covering binary numbers, Boolean algebra, logic gates, synchronized timing diagrams, universal gates, logic circuits, numericals and exam-style questions.
Need Personal Guidance?
If any topic in Semiconductor Electronics, Logic Gates or Digital Electronics is not clear, students may contact Kumar Sir for one-to-one online Physics classes.
1. Binary Number System
Digital electronics uses two stable states represented by 0 and 1. A binary digit is called a bit. A group of bits can represent numbers, instructions and logical states.
Decimal and Binary Systems
| System | Base | Digits | Place Values |
|---|---|---|---|
| Decimal | 10 | 0 to 9 | 100, 101, 102 |
| Binary | 2 | 0 and 1 | 20, 21, 22 |
Worked Conversions
Decimal to binary: Divide by 2 repeatedly and read remainders from bottom to top.
Example: (13)10 = (1101)2.
Binary to decimal: Multiply each bit by its place value.
Example: (11010)2 = 16 + 8 + 0 + 2 + 0 = (26)10.
Binary Addition and Subtraction
| Operation | Rule | Example |
|---|---|---|
| Addition | 0+0=0, 0+1=1, 1+1=10, 1+1+1=11 | 1011 + 0011 = 1110 |
| Subtraction | 0-0=0, 1-0=1, 1-1=0, 10-1=1 with borrow | 1010 - 0011 = 0111 |
Worked Example 1
Question: Convert (45)10 into binary.
Solution: 45 = 32 + 8 + 4 + 1 = 25 + 23 + 22 + 20.
Final Answer: (45)10 = (101101)2.
Exam Tip: Check by adding place values again.
Worked Example 2
Question: Add (1011)2 and (0110)2.
Solution: 1011 + 0110 = 10001.
Final Answer: (10001)2.
Exam Tip: Remember 1 + 1 gives 0 with carry 1.
2. Boolean Algebra
Boolean algebra deals with variables that can take only two values: 0 or 1. These values can represent OFF/ON, LOW/HIGH or FALSE/TRUE.
OR Operation
Output is 1 if at least one input is 1.
AND Operation
Output is 1 only if all inputs are 1.
NOT Operation
Output is the complement of input.
Important Boolean Laws
| Law | OR Form | AND Form |
|---|---|---|
| Identity | A + 0 = A | A.1 = A |
| Null | A + 1 = 1 | A.0 = 0 |
| Idempotent | A + A = A | A.A = A |
| Complement | A + Ā = 1 | A.Ā = 0 |
| Commutative | A + B = B + A | A.B = B.A |
| Associative | A + (B + C) = (A + B) + C | A.(B.C) = (A.B).C |
| Distributive | A + B.C = (A + B).(A + C) | A.(B + C) = A.B + A.C |
De Morgan's Theorems
Solved Problem
Question: Simplify A + A.B.
Solution: A + A.B = A(1 + B) = A.1 = A.
Final Answer: A.
Gate Symbols, Expressions and Truth Tables
Logic gates are electronic circuits that perform Boolean operations. The following sections show correct symbols, Boolean expressions, truth tables and timing diagrams.
3. OR Gate
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Real-life logic: A room light turns ON if switch A or switch B is ON.
PYQ-style: Draw the truth table of an OR gate and state its Boolean expression.
4. AND Gate
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logic: Output is HIGH only when both inputs are HIGH.
Numerical: If A = 1 and B = 0, then Y = 0.
5. NOT Gate
| A | Y |
|---|---|
| 0 | 1 |
| 1 | 0 |
Logic: The NOT gate inverts the input signal.
PYQ-style: A NOT gate changes HIGH to LOW and LOW to HIGH.
6. NAND Gate
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logic: NAND output is LOW only when both inputs are HIGH.
7. NOR Gate
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Logic: NOR output is HIGH only when both inputs are LOW.
8. XOR Gate
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logic: Output is HIGH when inputs are different.
9. XNOR Gate
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logic: Output is HIGH when inputs are the same.
10. Universal Gates
NAND and NOR gates are called universal gates because any basic logic gate can be made using only NAND gates or only NOR gates.
NAND Gate as Universal Gate
NOT using NAND
A NAND A = Ā.
AND using NAND
((A.B)̄)̄ = A.B.
OR using NAND
A + B = (Ā.B̄)̄.
NOR Gate as Universal Gate
NOT using NOR
A NOR A = Ā.
OR using NOR
((A+B)̄)̄ = A+B.
AND using NOR
A.B = (Ā + B̄)̄.
11. Logic Circuits
Logic circuit analysis means finding the output expression and truth table for a combination of gates.
Example Circuit
Output Determination
Top gate output = A.B.
Bottom gate output = A + B.
Final output = (A.B).(A + B).
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Numericals, PYQs and Case Studies
CBSE Style: Truth Table
Question: Write the truth table for Y = Ā + B.
Solution: Evaluate Ā first, then OR with B.
| A | B | Ā | Y |
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 |
Exam Tip: Do complement columns first.
NEET Style: Gate Identification
Question: A two-input gate gives output 1 only when both inputs are 0. Identify the gate.
Solution: This is the truth table of NOR gate.
Final Answer: NOR gate.
Exam Tip: “Only 00 gives 1” means NOR.
JEE Main Style: Simplification
Question: Simplify Y = A.B + A.B̄.
Solution: Y = A(B + B̄) = A.1 = A.
Final Answer: Y = A.
Exam Tip: Use B + B̄ = 1.
JEE Advanced Style: XOR
Question: For XOR gate, output is 1 for which input combinations?
Solution: XOR output is 1 when inputs are unequal.
Final Answer: 01 and 10.
Exam Tip: XOR is an inequality detector.
IB Physics Style: Digital Control
Question: A safety system works only when door is closed and power key is ON. Which gate represents this?
Solution: Both conditions must be true simultaneously.
Final Answer: AND gate.
Exam Tip: “Both must happen” means AND.
IGCSE Style: Binary Conversion
Question: Convert (10101)2 to decimal.
Solution: 1×16 + 0×8 + 1×4 + 0×2 + 1×1 = 21.
Final Answer: (21)10.
Exam Tip: Write place values above bits.
Assertion Reason Questions
Assertion: NAND gate is called a universal gate. Reason: NOT, AND and OR gates can be made using only NAND gates.
Answer: Both assertion and reason are true, and reason correctly explains assertion.
Assertion: XOR gate output is 1 when both inputs are 1. Reason: XOR output is 1 when inputs are different.
Answer: Assertion is false, reason is true.
Case Study
A water tank alarm has two sensors A and B. The alarm should ring when either sensor detects overflow.
Question: Which gate should be used? Write its truth table.
Solution: Use OR gate because alarm must ring if A or B is 1.
Final Answer: OR gate; Y = A + B.
Quick Revision Section
Formula Sheet
- OR: Y = A + B.
- AND: Y = A.B.
- NOT: Y = Ā.
- NAND: Y = (A.B)̄.
- NOR: Y = (A + B)̄.
- XOR: Y = Ā.B + A.B̄.
- XNOR: Y = A.B + Ā.B̄.
Most Important Exam Points
- NAND and NOR are universal gates.
- XOR output is HIGH for unlike inputs.
- XNOR output is HIGH for like inputs.
- De Morgan's theorems connect NAND and NOR operations.
- Timing diagrams must be read interval by interval.
Boolean Laws
| Law | Result |
|---|---|
| Identity | A + 0 = A, A.1 = A |
| Null | A + 1 = 1, A.0 = 0 |
| Idempotent | A + A = A, A.A = A |
| Complement | A + Ā = 1, A.Ā = 0 |
De Morgan's Theorems
- (A + B)̄ = Ā.B̄
- (A.B)̄ = Ā + B̄
- Break the bar and change the operation.
Gate Symbols Summary
| Gate | Expression |
|---|---|
| OR | A + B |
| AND | A.B |
| NOT | Ā |
| NAND | (A.B)̄ |
| NOR | (A + B)̄ |
| XOR | Ā.B + A.B̄ |
| XNOR | A.B + Ā.B̄ |
Truth Table Summary
| A | B | OR | AND | NAND | NOR | XOR | XNOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Need Personal Guidance?
If any topic in Semiconductor Electronics, Logic Gates or Digital Electronics is not clear, students may contact Kumar Sir for one-to-one online Physics classes.
Logic Gates PYQs with Solutions
Previous-year logic gate questions redrawn with clean circuit diagrams, truth tables, waveform analysis, step-by-step solutions, final answers and exam tips.
Need Personal Guidance?
If any topic in Semiconductor Electronics, Logic Gates or Digital Electronics is not clear, students may contact Kumar Sir for one-to-one online Physics classes.
Based on Logic Gates
Which symbol represents NAND gate ?
Solution
A NAND operation is an AND operation followed by NOT operation.
Option (a) shows an AND gate followed by an inverter, so it represents NAND.
Final Answer: (a)
Exam Tip: NAND = NOT of AND, so look for AND output inversion.
When the inputs of a two input logic gate are 0 and 0, the output is 1. When the inputs are 1 and 0 the output is 0. The logic gate is of the type
Solution
For NOR gate, Y = A + B.
If A = 0, B = 0, then Y = 0 + 0 = 1.
If A = 1, B = 0, then Y = 1 + 0 = 0.
Final Answer: (c) NOR
Exam Tip: NOR output is high only for input pair 00.
Which of the following gates can be served as a building block for any digital circuit ?
Solution
NAND is a universal gate. NOT, AND and OR gates can be constructed using only NAND gates.
Final Answer: (d) NAND
Exam Tip: NAND and NOR are universal gates.
The gate for which output is high, if atleast one input is low ?
Solution
For NAND gate, output is low only when all inputs are high.
Therefore, if at least one input is low, output becomes high.
Final Answer: (a) NAND
Exam Tip: NAND gives 0 only for 11.
The following logic circuit represents
Solution
The first gate is AND, so its output is X.Y.
This output is then passed through NOT gate.
Therefore O = X.Y, which is NAND.
Final Answer: (c) NAND gate with output O = X.Y
Exam Tip: AND followed by NOT is NAND.
A logic gate circuit has two inputs A and B and output Y. The voltage waveforms of A, B and Y are shown below :
The logic gate circuit is
Solution
Compare intervals where Y is high.
Y becomes high only when A is high and B is also high.
This is the behaviour of AND gate.
Final Answer: (a) AND gate
Exam Tip: In waveform questions, mark common high intervals of A and B.
Identify the logic operation carried out by the following circuit :
Solution
Each first NAND gate has tied inputs, so X = Ā and Y = B̄.
The final gate is AND, so Z = X.Y = Ā.B̄.
Using De Morgan's theorem, Ā.B̄ = A + B, which is NOR.
Final Answer: (a) NOR
Exam Tip: NAND with both inputs joined behaves as NOT.
Identify the logic operation carried out.
Solution
The first two NAND gates act as NOT gates: outputs are Ā and B̄.
The final gate is NOR, so Y = Ā + B̄.
By De Morgan's theorem, Ā + B̄ = A.B.
Final Answer: (b) AND
Exam Tip: Apply De Morgan after identifying the final NOR gate.
The combination of gates shown below yields
Solution
The first two NAND gates have tied inputs, so they produce Ā and B̄.
The final gate is NAND: X = Ā.B̄.
Using De Morgan's theorem, X = A + B.
Final Answer: (b) OR gate
Exam Tip: NAND-NAND arrangement often converts to OR by De Morgan's theorem.
In the following logic circuit the sequence of the inputs A, B are (0, 0), (0, 1), (1, 0) and (1, 1). The output Y for this sequence will be
Solution
Upper gate gives P = A.B. Lower gate gives Q = A + B.
Final gate is NAND, so Y = P.Q = (A.B)(A + B).
Since (A.B)(A + B) = A.B, Y = A.B.
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Final Answer: (d) 1, 1, 1, 0
Exam Tip: First name intermediate outputs P and Q, then substitute.
Find the truth table for the function Y of A and B represented in the following figure :
(a)
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
(b)
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
(c)
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
(d)
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Solution
The upper gate gives A.B. The lower branch gives B̄ using NOT gate.
The final gate is OR, so Y = A.B + B̄.
Using A.B + B̄ = A + B̄.
| A | B | B̄ | A.B | Y |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
Final Answer: (d)
Exam Tip: When one input splits into NOT and another gate, write branch outputs first.
The following logic gate is equivalent to
Solution
The first two NAND gates with tied inputs give Ā and B̄.
The middle NAND gives Ā.B̄ = A + B.
The last NAND has tied inputs, so it acts as NOT gate.
Therefore Y = A + B, which is NOR.
Final Answer: (c) NOR Gate
Exam Tip: A tied-input NAND at the end inverts the previous output.
