On this page
Boolean logic is the part of Class 11 computer science that looks most like maths, and it rewards the same habits: be systematic, check every case, and do not trust a rule until you have tested it. This post covers what the syllabus lists, defines every gate with its truth table, works through a full example and De Morgan's laws, and shows how to check your tables in Python.
What does the Class 11 syllabus include?
The CBSE Computer Science curriculum for Class XI (2026-27) lists, under Unit 1 Computer Systems and Organisation: "Boolean logic: NOT, AND, OR, NAND, NOR, XOR, truth tables and De Morgan's laws, Logic circuits". Unit 1 carries 10 of the 70 theory marks, along with number systems and encoding. The current NCERT Class 11 textbook does not have a section on Boolean logic, so use your teacher's notes and the support material the curriculum points to on the CBSE website. Number systems sit in the same unit; see our guide to number systems and binary for CBSE.
What do the six gates do?
Boolean values are 1 (true) and 0 (false). In the usual notation, A·B means A AND B, A + B means A OR B, and A' (or A with a bar) means NOT A.
NOT: flips the input. NOT 0 = 1, NOT 1 = 0.
AND: 1 only when both inputs are 1.
OR: 1 when at least one input is 1.
NAND: NOT of AND. 0 only when both inputs are 1.
NOR: NOT of OR. 1 only when both inputs are 0.
XOR: 1 when the inputs differ.
For inputs (A, B) in the order 00, 01, 10, 11:
AND gives 0, 0, 0, 1
OR gives 0, 1, 1, 1
NAND gives 1, 1, 1, 0
NOR gives 1, 0, 0, 0
XOR gives 0, 1, 1, 0
How do you build a truth table?
With n inputs there are 2ⁿ combinations, so 2 inputs need 4 rows and 3 inputs need 8. List them in binary counting order, 000 to 111, so you never miss one. Then add one column for each part of the expression, working from the inside out.
Example. Build the truth table for X = A·B' + C.
Write the 8 rows for A, B and C.
Add a column for B'.
Add a column for A·B'. It is 1 only when A = 1 and B = 0.
Add the final column, OR with C.
Reading the rows ABC from 000 to 111, X is 0, 1, 0, 1, 1, 1, 0, 1. So X = 0 in exactly three rows: 000, 010 and 110. In each of those C = 0, and A·B' is 0 because A is 0 or B is 1.
What are De Morgan's laws?
NOT(A·B) = A' + B'
NOT(A + B) = A'·B'
In words: to negate an AND, negate each part and change AND to OR; to negate an OR, negate each part and change OR to AND.
Proof by truth table. For the first law, the left side is the NAND column: 1, 1, 1, 0. On the right, A' is 1, 1, 0, 0 and B' is 1, 0, 1, 0, so A' + B' is 1, 1, 1, 0. The columns match in every row, which proves the law. Do the same for the second law: NOR gives 1, 0, 0, 0, and A'·B' also gives 1, 0, 0, 0.
Using it. Simplify NOT(A·B + C). Apply the second law to the OR first: NOT(A·B)·C'. Then the first law to the AND: (A' + B')·C'. We checked all 8 rows and the two sides agree.
Everyday language follows the same rule. "It is not true that I have a pen and a pencil" means "I lack a pen or I lack a pencil".
How do logic circuits connect to this?
A logic circuit is a drawing of an expression, with one gate symbol for each operation. To draw A·B' + C, feed B into a NOT gate, feed A and the NOT output into an AND gate, then feed that and C into an OR gate. To go the other way, from a circuit to an expression, write the output of each gate in order from the inputs.
The link between switching circuits and logic is old. Claude Shannon's 1938 paper, A symbolic analysis of relay and switching circuits, gave a mathematical way to analyse relay circuits and to find ones that use the fewest contacts.
How can you check a truth table in Python?
Python's and, or and not work on True and False, and its ^ operator is XOR on integers.
from itertools import product
for A, B, C in product([0, 1], repeat=3):
X = (A and not B) or C
print(A, B, C, int(X))This prints the eight rows of the example above in order. The Python documentation on Boolean operations adds a detail worth knowing: and and or are short-circuit operators, so x or y does not look at y at all if x is already true.
What mistakes cost marks?
Too few rows. Three inputs always need 8.
NAND and NOR swapped. NAND is 0 only for 11; NOR is 1 only for 00.
XOR treated as OR. For 11, OR gives 1 but XOR gives 0.
De Morgan half applied. Negating the parts but keeping AND as AND.
Missing brackets. A'·B' is not the same as (A·B)'.
A practice routine for Boolean logic
Self-testing beats rereading: Roediger and Karpicke found that students who took recall tests remembered more a week later than students who restudied.
Day 1: Write all six gate tables from memory, then check them.
Day 2: Build truth tables for three 3-input expressions and check each with the Python loop.
Day 4: Prove both De Morgan laws by truth table, and simplify two expressions with them.
Day 7: Draw a logic circuit for each expression from Day 2.
When a rule seems arbitrary, the Fermi Concept Library covers every concept in mathematics and computing, each with its own lesson.
Start now: write the truth table for NOT(A + B) and compare it with A'·B', row by row.



