Study Guide
Boolean Logic and Logic Gates, CBSE Class 11 CS
Complete guide to Boolean logic and logic gates for CBSE Class 11 CS. Covers AND, OR, NOT, NAND, NOR, XOR gates, truth tables, and Boolean algebra laws.
Boolean logic and logic gates form the foundation of how computers process information. This chapter is important in CBSE Class 11 Computer Science and carries good marks in the exam. This guide covers all gates, truth tables, Boolean algebra laws, and simplification techniques.
What is Boolean Logic?
Boolean logic is a branch of mathematics that deals with values that are either True (1) or False (0). It was developed by George Boole in the 1850s and forms the basis of digital electronics and computer circuits.
In Boolean logic:
- 1 represents True / High / ON
- 0 represents False / Low / OFF
Basic Boolean Operations
There are three fundamental Boolean operations:
| Operation | Symbol | Python Operator | Description |
|---|---|---|---|
| AND | . or ^ | and |
True only when ALL inputs are True |
| OR | + or v | or |
True when ANY input is True |
| NOT | ' or ~ | not |
Inverts the value |
Logic Gates
A logic gate is an electronic circuit that performs a Boolean operation. Each gate takes one or more inputs and produces one output.
1. AND Gate
The AND gate produces output 1 only when all inputs are 1.
Boolean expression: Y = A . B (or Y = A AND B)
Truth Table:
| A | B | Y = A . B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Real-life analogy: Two switches in series, both must be ON for the light to turn on.
2. OR Gate
The OR gate produces output 1 when any input is 1.
Boolean expression: Y = A + B (or Y = A OR B)
Truth Table:
| A | B | Y = A + B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Real-life analogy: Two switches in parallel, either switch being ON turns the light on.
3. NOT Gate (Inverter)
The NOT gate has one input and inverts it.
Boolean expression: Y = A' (or Y = NOT A)
Truth Table:
| A | Y = A' |
|---|---|
| 0 | 1 |
| 1 | 0 |
4. NAND Gate (NOT AND)
The NAND gate is an AND gate followed by a NOT gate. Output is 0 only when all inputs are 1.
Boolean expression: Y = (A . B)'
Truth Table:
| A | B | Y = (A . B)' |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Exam tip: NAND is called a Universal Gate because any other gate can be built using only NAND gates.
5. NOR Gate (NOT OR)
The NOR gate is an OR gate followed by a NOT gate. Output is 1 only when all inputs are 0.
Boolean expression: Y = (A + B)'
Truth Table:
| A | B | Y = (A + B)' |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
NOR is also a Universal Gate.
6. XOR Gate (Exclusive OR)
The XOR gate produces output 1 when inputs are different.
Boolean expression: Y = A XOR B = A'B + AB'
Truth Table:
| A | B | Y = A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
7. XNOR Gate (Exclusive NOR)
The XNOR gate produces output 1 when inputs are the same.
Boolean expression: Y = (A XOR B)' = AB + A'B'
Truth Table:
| A | B | Y = A XNOR B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Summary of All Gates
| Gate | Expression | Output is 1 when... |
|---|---|---|
| AND | A . B | Both A and B are 1 |
| OR | A + B | Either A or B (or both) is 1 |
| NOT | A' | A is 0 |
| NAND | (A . B)' | NOT all inputs are 1 |
| NOR | (A + B)' | All inputs are 0 |
| XOR | A XOR B | Inputs are different |
| XNOR | (A XOR B)' | Inputs are same |
Boolean Algebra Laws
Basic Laws
| Law | AND Form | OR Form |
|---|---|---|
| Identity | A . 1 = A | A + 0 = A |
| Null/Annulment | A . 0 = 0 | A + 1 = 1 |
| Idempotent | A . A = A | A + A = A |
| Complement | A . A' = 0 | A + A' = 1 |
| Double Negation | (A')' = A | (A')' = A |
Commutative Law
The order of operands does not matter:
- A . B = B . A, A + B = B + A
Associative Law
The grouping of operands does not matter:
- (A . B) . C = A . (B . C)
- (A + B) + C = A + (B + C)
Distributive Law
- A . (B + C) = A.B + A.C, A + (B . C) = (A + B) . (A + C)
Absorption Law
- A + A.B = A, A . (A + B) = A
De Morgan's Theorems
These are very important for simplification:
First Theorem: (A . B)' = A' + B'
The complement of AND equals the OR of complements.
Second Theorem: (A + B)' = A' . B'
The complement of OR equals the AND of complements.
Verification of De Morgan's First Theorem:
| A | B | A.B | (A.B)' | A' | B' | A'+B' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
(A.B)' and A'+B' have the same values, so the theorem is verified.
Boolean Expression Simplification
Example 1: Simplify A + A.B
A + A.B
= A.(1 + B) [Distributive law]
= A.1 [1 + B = 1, Annulment law]
= A [Identity law]
Example 2: Simplify A.B + A.B'
A.B + A.B'
= A.(B + B') [Distributive law]
= A.1 [B + B' = 1, Complement law]
= A [Identity law]
Example 3: Simplify (A + B).(A + B')
(A + B).(A + B')
= A.A + A.B' + B.A + B.B' [Expanding]
= A + A.B' + A.B + 0 [A.A = A, B.B' = 0]
= A + A.(B' + B) [Distributive law]
= A + A.1 [B' + B = 1]
= A + A [Identity]
= A [Idempotent]
Example 4: Simplify using De Morgan's theorem: (A.B + C)'
(A.B + C)'
= (A.B)' . C' [De Morgan's second theorem]
= (A' + B') . C' [De Morgan's first theorem]
= A'.C' + B'.C' [Distributive law]
Logic Gates in Python
You can verify Boolean operations using Python:
# AND operation
a = True
b = False
print("AND:", a and b) # Output: False
# OR operation
print("OR:", a or b) # Output: True
# NOT operation
print("NOT a:", not a) # Output: False
# Using 0 and 1
x = 1
y = 0
print("AND:", x & y) # Output: 0
print("OR:", x | y) # Output: 1
print("XOR:", x ^ y) # Output: 1
print("NOT x:", ~x & 1) # Output: 0
AND: False
OR: True
NOT a: False
AND: 0
OR: 1
XOR: 1
NOT x: 0
Important Questions
Q1. Verify De Morgan's second theorem using a truth table.
| A | B | A+B | (A+B)' | A' | B' | A'.B' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Since (A+B)' and A'.B' have identical outputs, the theorem is verified.
Q2. Why are NAND and NOR called universal gates?
NAND and NOR are called universal gates because any other logic gate (AND, OR, NOT, XOR, XNOR) can be constructed using only NAND gates or only NOR gates. This makes them versatile and widely used in circuit design.
Q3. Simplify: A'B + AB' + AB
A'B + AB' + AB
= A'B + A(B' + B) [Taking A common]
= A'B + A.1 [B' + B = 1]
= A'B + A [Identity]
= A + A'B [Commutative]
= A + B [Absorption: A + A'B = A + B]
Quick Revision
- Boolean values: 1 (True) and 0 (False)
- AND = all inputs 1; OR = any input 1; NOT = invert
- NAND and NOR are universal gates
- XOR = different inputs give 1; XNOR = same inputs give 1
- De Morgan's: (A.B)' = A'+B' and (A+B)' = A'.B'
- Absorption: A + AB = A and A(A+B) = A
- Complement: A + A' = 1 and A.A' = 0, Practice simplification using Boolean laws, it is always asked in exams
Want to learn more?
Explore free chapter-wise notes with quizzes and code playground
Prefer watching over reading?
Subscribe for free.