Skip to content
Computer ScienceCBSE Class 11 · Chapter 2

Boolean Logic Class 11: Logic Gates, Truth Tables, De Morgan's Laws and Circuits

Updated 14 October 2026 · Fact-checked

Boolean logic works with only two values, 1 (true) and 0 (false). In CBSE Class 11 Computer Science you learn the NOT, AND, OR, NAND, NOR and XOR operations and gates, build truth tables, prove and use De Morgan's two laws, and write the expression of a logic circuit or draw the circuit for an expression.

What Boolean Logic is about

Boolean Logic is in Unit I, Computer Systems and Organisation, which carries 10 of the 70 theory marks in the school annual exam together with Computer System and Encoding Schemes. The 2026-27 syllabus wording is short: "Boolean logic: NOT, AND, OR, NAND, NOR, XOR, truth tables and De Morgan's laws, Logic circuits".

The NCERT Class XI Computer Science book has no chapter on this topic, so this page is built from the syllabus wording alone and stays inside it. You need:

  • the six operations: what each does, its symbol in an expression, its gate symbol and its truth table
  • how to build a truth table for an expression of two or three variables (4 or 8 rows)
  • De Morgan's laws, how to prove them with a truth table, and how to use them to simplify or rewrite an expression
  • logic circuits: writing the Boolean expression of a circuit made of gates, drawing the circuit for a given expression, and finding its output for given inputs

Notation used here: A' means NOT A (also written with a bar over A or as ¬A), A·B or AB means A AND B, A + B means A OR B, and A ⊕ B means A XOR B. Python's not, and, or and ^ (on 0 and 1) let you check any truth table by program, as some examples below do.

Weightage: This chapter is part of Unit I, Computer Systems and Organisation, which carries 10 of the 70 theory marks in the school annual exam together with Computer System and Encoding Schemes and Number System.Source: CBSE Computer Science (083) syllabus 2026-27, Class XI distribution of marks, Unit I Computer Systems and Organisation

Key concepts

Boolean values and the NOT operation
NCERT section CBSE syllabus: Boolean logic (not in the NCERT book)

A Boolean variable can take only two values: 1 (true, on, high) or 0 (false, off, low). Digital circuits use these two states because a switch or transistor is either on or off. A logic gate is an electronic circuit that takes one or more Boolean inputs and gives one Boolean output.

NOT (inversion, complement) has one input and gives the opposite value: NOT 0 = 1, NOT 1 = 0. It is written A' (or with a bar over A). Its gate is called an inverter: a triangle with a small circle (the bubble) at its output. Applying NOT twice gives the original value: (A')' = A.

AA'
01
10

Worked example

A night lamp switches on when it is dark. A light sensor gives L = 1 in daylight and L = 0 in the dark. Write the lamp's output in terms of L and give its truth table.

Try it first, then show the solutionSolution
  1. The lamp must be on (1) exactly when L = 0, which is the opposite of L.
  2. So Lamp = L'.
  3. Truth table: L = 0 gives 1; L = 1 gives 0.

Answer: Lamp = L' (NOT L): 0 → 1, 1 → 0.

AND and OR
NCERT section CBSE syllabus: Boolean logic

AND (written A·B or AB) gives 1 only when all inputs are 1. It behaves like switches in series: current flows only if every switch is closed. OR (written A + B) gives 1 when at least one input is 1; it is 0 only when all inputs are 0. It behaves like switches in parallel. Note that in Boolean algebra 1 + 1 = 1, not 2.

ABA·BA + B
0000
0101
1001
1111

Gate shapes: AND has a flat input side and a round (D-shaped) output side; OR has a curved input side and a pointed output side. Both can have more than two inputs: a 3-input AND is 1 only for 111, a 3-input OR is 0 only for 000.

Worked example

A lift moves only if its door is closed (D = 1) and a floor button is pressed (F = 1). An emergency bell rings if button 1 (P) or button 2 (Q) is pressed. Write both expressions and the output for D = 1, F = 0, P = 0, Q = 1.

Try it first, then show the solutionSolution
  1. Both conditions needed: Move = D·F.
  2. Either button is enough: Bell = P + Q.
  3. Move = 1·0 = 0; Bell = 0 + 1 = 1.

Answer: Move = D·F = 0 (lift stays); Bell = P + Q = 1 (bell rings).

NAND and NOR: the universal gates
NCERT section CBSE syllabus: Boolean logic

NAND is NOT-AND: (A·B)'. It gives 0 only when all inputs are 1, and 1 otherwise. NOR is NOT-OR: (A + B)'. It gives 1 only when all inputs are 0. Their gate symbols are the AND and OR shapes with a bubble at the output.

ABNAND (A·B)'NOR (A + B)'
0011
0110
1010
1100

NAND and NOR are called universal gates because NOT, AND and OR (and so any circuit) can be built from NAND gates alone, or from NOR gates alone:

  • NOT A = A NAND A = A NOR A (join both inputs)
  • A AND B = (A NAND B) NAND (A NAND B); A OR B = (A NAND A) NAND (B NAND B)
  • A OR B = (A NOR B) NOR (A NOR B); A AND B = (A NOR A) NOR (B NOR B)

Worked example

Show by truth table that joining both inputs of a NAND gate makes it a NOT gate.

Try it first, then show the solutionSolution
  1. With both inputs equal to A, the output is (A·A)'.
  2. A = 0: (0·0)' = 0' = 1.
  3. A = 1: (1·1)' = 1' = 0.
  4. The output is always the opposite of A.

Answer: A NAND A = A', so a NAND with joined inputs is an inverter.

XOR (exclusive OR)
NCERT section CBSE syllabus: Boolean logic

XOR (A ⊕ B) gives 1 when the inputs are different and 0 when they are the same. It differs from OR only in the last row: 1 ⊕ 1 = 0. In terms of the basic operations, A ⊕ B = A'B + AB', which reads 'A is 0 and B is 1, or A is 1 and B is 0'. Its gate is the OR shape with an extra curved line on the input side.

ABA ⊕ B
000
011
101
110

Useful facts: A ⊕ 0 = A, A ⊕ 1 = A', A ⊕ A = 0. For more inputs, XOR gives 1 when the number of 1s is odd, which is why it is used to make parity bits for error checking. In Python, a ^ b on 0 and 1 gives XOR.

Worked example

A staircase light has one switch at the bottom (A) and one at the top (B). Flipping either switch changes the light. With both switches down (0, 0) the light is off. Which gate gives the light's state?

Try it first, then show the solutionSolution
  1. (0,0): off. Flip one switch: (0,1) or (1,0): on.
  2. Flip the other as well: (1,1): off again.
  3. The light is on exactly when the switches differ: XOR.

Answer: Light = A ⊕ B (XOR).

Truth tables for expressions
NCERT section CBSE syllabus: truth tables

A truth table lists the output for every combination of inputs. With n variables there are 2^n rows: 4 rows for two variables, 8 for three. Write the input rows in binary counting order (000, 001, 010, ..., 111) so none is missed.

Method for an expression:
1. Make one column per input variable.
2. Add a column for each sub-expression in the order it is evaluated: brackets first, then NOT, then AND, then OR.
3. Fill the final column from the sub-expression columns.

Two expressions are equivalent if their final columns match in every row. This is how laws are proved by truth table.

Worked example

Draw the truth table of Y = (A + B)·C'.

Try it first, then show the solutionSolution
  1. Three variables, so 8 rows. Columns: A, B, C, A + B, C', Y.
  2. ABCA + BC'Y
    000010
    001000
    010111
    011100
    100111
    101100
    110111
    111100
  3. Y is 1 only where A + B = 1 and C = 0.

Answer: Y = 1 for ABC = 010, 100, 110; Y = 0 for the other five rows.

De Morgan's laws
NCERT section CBSE syllabus: De Morgan's laws

De Morgan's two laws say how NOT acts on a whole AND or OR:

  • First law: (A·B)' = A' + B'. The complement of a product is the sum of the complements.
  • Second law: (A + B)' = A'·B'. The complement of a sum is the product of the complements.

Rule to remember: break the bar, change the sign (AND becomes OR, OR becomes AND, each variable gets its own NOT). The laws extend to more variables: (A·B·C)' = A' + B' + C' and (A + B + C)' = A'·B'·C'.

In gate terms, the first law says a NAND gate is the same as an OR gate with bubbles on its inputs; the second says a NOR gate is the same as an AND gate with inverted inputs.

Proof of the first law by truth table:

ABA·B(A·B)'A'B'A' + B'
0001111
0101101
1001011
1110000

The columns (A·B)' and A' + B' are the same in all four rows, so the law holds.

Worked example

Use De Morgan's laws to simplify Y = (A' + B')'.

Try it first, then show the solutionSolution
  1. Break the outer bar and change + to ·: Y = (A')'·(B')'.
  2. A double NOT cancels: (A')' = A, (B')' = B.
  3. So Y = A·B.

Answer: Y = A·B (an AND gate).

Logic circuits: from circuit to expression and back
NCERT section CBSE syllabus: logic circuits

A logic circuit joins gates so that the output of one is the input of another. To write the expression of a circuit, label the output of every gate from the inputs towards the output, then combine. For example, if A and B go into an OR gate, and its output and C go into an AND gate, the output is Y = (A + B)·C.

To draw the circuit for an expression, work inside-out: draw a NOT gate for each complemented variable, then the AND gates for the products, then the OR gate that joins them. For Y = A'B + AB': two NOT gates make A' and B'; one AND gate takes A' and B, another takes A and B'; an OR gate joins the two AND outputs. (This circuit is an XOR built from basic gates.)

To find the output for given inputs, put the values into each gate in turn, or write the expression and evaluate it. A full truth table of the circuit is the safest way to see what it does.

Worked example

Inputs A and B go into a NOR gate. Its output and input C go into an AND gate, whose output goes through a NOT gate to give Y. Write Y and simplify it with De Morgan's laws.

Try it first, then show the solutionSolution
  1. NOR output: (A + B)'.
  2. AND output: (A + B)'·C.
  3. NOT output: Y = ((A + B)'·C)'.
  4. First law: Y = ((A + B)')' + C' = A + B + C'.

Answer: Y = ((A + B)'·C)' = A + B + C'. Y is 0 only when A = 0, B = 0 and C = 1.

Boolean Logic in real life

Each concept, met in an everyday situation. Read the situation, answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.

AND and OR in a security alarm

Suppose a home alarm is switched on (D = 1) by the owner when leaving, and has a window sensor W and a motion sensor M that give 1 when triggered.

Write an expression for the siren S so that it sounds only when the alarm is on and at least one sensor is triggered. Give S for D = 1, W = 0, M = 1 and for D = 0, W = 1, M = 1.

Try it first, then show the solutionSolution
  1. At least one sensor: W + M. Both this and D are needed: S = D·(W + M).
  2. D = 1, W = 0, M = 1: S = 1·(0 + 1) = 1.
  3. D = 0: S = 0·(1 + 1) = 0, whatever the sensors say.

Answer: S = D·(W + M); S = 1 in the first case and 0 in the second.

Memory hook: 'and' in the rule becomes ·, 'or' becomes +.

XOR for a two-way switch

Imagine a long corridor in a hostel with a switch at each end so that the light can be changed from either end.

Which Boolean operation makes this work, and what is the light's state if both switches are up (1, 1)?

Try it first, then show the solutionSolution
  1. Changing either switch must change the light, so the light depends on whether the switches differ.
  2. That is XOR: L = A ⊕ B; with (1, 1) the inputs are equal, so L = 0.

Answer: XOR; the light is off when both switches are up.

Memory hook: XOR: different gives 1, same gives 0.

De Morgan's law in everyday rules

Suppose a school notice says: 'It is not true that a student may bring a phone and use it in class.'

Rewrite the rule using De Morgan's first law, with P = brings a phone, U = uses it in class.

Try it first, then show the solutionSolution
  1. The rule is (P·U)'.
  2. De Morgan: (P·U)' = P' + U'.

Answer: Either the student does not bring a phone, or does not use it in class (or both).

Memory hook: 'Not both' means 'at least one is not'.

Topics in this chapter

Boolean Logic: syntax and key facts

Basic operations
NOT: A'; AND: A·B (1 only if both 1); OR: A + B (0 only if both 0)
1 + 1 = 1 in Boolean algebra.
Derived operations
NAND = (A·B)'; NOR = (A + B)'; XOR: A ⊕ B = A'B + AB'
XOR is 1 when the inputs differ; XNOR (A ⊕ B)' = AB + A'B' is 1 when they match.
De Morgan's laws
(A·B)' = A' + B'; (A + B)' = A'·B'
Break the bar, change the sign; works for any number of variables.
Rows in a truth table
n inputs → 2^n rows
2 inputs: 4 rows; 3 inputs: 8 rows.
Universal gates
A' = A NAND A = A NOR A; A·B = (A NAND B)'; A + B = (A NOR B)'
The complement of NAND is AND; of NOR is OR.
Useful identities
(A')' = A; A + A' = 1; A·A' = 0; A ⊕ A = 0; A ⊕ 1 = A'
Check any of them with a two-row or four-row truth table.

Boolean Logic: diagrams to practise

Practise each one on paper: draw it from the checklist, then tick off every label.

Symbols of the six logic gates

Draw the symbol and truth table of a NAND, NOR or XOR gate.

Draw

  1. NOT: a triangle pointing right with a small circle at its tip.
  2. AND: flat back, D-shaped front; OR: curved back, pointed front.
  3. NAND and NOR: the AND and OR shapes with a small circle (bubble) at the output.
  4. XOR: the OR shape with a second curved line just behind its curved back.

Label

  • Inputs A, B
  • Output Y
  • Bubble (inversion)

Watch out: Always label the inputs and the output and write the expression (such as Y = (A·B)') beside the gate.

Logic circuit for Y = A'B + AB'

Draw the logic circuit for a given expression.

Draw

  1. Two inputs A and B on the left, each split into two branches.
  2. A NOT gate on one branch of A and one on one branch of B.
  3. AND gate 1 taking A' and B; AND gate 2 taking A and B'.
  4. An OR gate taking the two AND outputs and giving Y.

Label

  • A, B
  • A', B'
  • A'B
  • AB'
  • Y = A'B + AB'

Watch out: Label the output wire of every gate with its sub-expression; it earns the method mark even if one gate is drawn imperfectly.

How the school exam asks Boolean Logic

The question patterns to expect, and the method that works for each.

Question typeHow it is askedMethod
Truth table of a gate or expression"Draw the truth table for (A + B)·C'" or "for a 3-input NAND gate" (2-3 marks).Write 2^n rows in counting order, add a column for every sub-expression, then the output.
Prove De Morgan's law"State and verify De Morgan's laws using truth tables" (3 marks).State both laws in symbols and words; draw one table per law with both sides as columns; point out the matching columns.
Circuit to expressionA diagram of 2-4 gates is given; write the Boolean expression of the output, sometimes with its value for given inputs (2 marks).Label the output of each gate from left to right; keep brackets where an OR output feeds an AND gate.
Expression to circuit"Draw the logic circuit for Y = AB' + A'C" (2-3 marks).NOT gates first, then AND gates for each term, then one OR gate; label every input and the output.
Identify the gate / universal gatesGiven a truth table or a word description, name the gate; show how NAND or NOR makes NOT, AND or OR (1-3 marks).Look at the rows where the output is 1 (or 0): only 11 → AND; only 00 → NOR; inputs differ → XOR.

Tricks to remember Boolean Logic

Short memory aids. Say each one aloud once, then use it on a question the same day.

  • AND = all, OR = any

    AND needs ALL inputs 1; OR needs ANY one input 1.

    Use it when: Filling truth tables quickly.

  • Bubble means NOT

    A small circle at a gate's output turns AND into NAND and OR into NOR.

    Use it when: Reading gate symbols.

  • Break the bar, change the sign

    When a long bar over a product or sum is split, · becomes + and + becomes ·.

    Use it when: Applying De Morgan's laws.

  • XOR = odd one out

    XOR is 1 when the number of 1s is odd; for two inputs, when they are different.

    Use it when: XOR tables and parity.

  • NAND and NOR are universal

    'N' gates can do aNything: join the inputs for NOT, add another for AND or OR.

    Use it when: Universal gate questions.

Boolean Logic: exam-level solved questions

Ordered from exam level to HOTS. Cover the solution, write your own, then compare step by step.

Example 1: Identify the gate · 1 mark · Short answerExam level

A two-input gate gives output 1 for inputs 00, 01 and 10, and 0 for 11. Name the gate and write its expression.

Try it first, then show the solutionSolution
  1. The output is 0 only when both inputs are 1: the complement of AND.

Answer: NAND gate: Y = (A·B)'.

Example 2: Truth table of a three-variable expression · 3 marks · Short answerHarder exam level

Draw the truth table of Y = (A·B)' + C and state how many rows give Y = 0.

Try it first, then show the solutionSolution
  1. ABCA·B(A·B)'Y
    000011
    001011
    010011
    011011
    100011
    101011
    110100
    111101
  2. Y is 0 only when (A·B)' = 0 and C = 0, that is A = 1, B = 1, C = 0.

Answer: Only one row (ABC = 110) gives Y = 0.

Example 3: Verify De Morgan's second law by program · 3 marks · Short answerHarder exam level

Write a Python program that prints a truth table with columns A, B, (A+B)' and A'.B' and say what the output proves.

Try it first, then show the solutionSolution
  1. print('A B LHS RHS')
    for a in (0, 1):
        for b in (0, 1):
            lhs = int(not (a or b))
            rhs = int((not a) and (not b))
            print(a, b, lhs, rhs)
  2. Rows: 00 gives 1 1; 01 gives 0 0; 10 gives 0 0; 11 gives 0 0.
  3. The LHS and RHS columns match in all four rows.

Answer: A B LHS RHS
0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0
This verifies (A + B)' = A'·B'.

Example 4: Circuit to expression with evaluation · 2 marks · Short answerHarder exam level

A and B feed a NAND gate. C passes through a NOT gate. The NAND output and C' feed an OR gate, whose output is Y. Write Y, simplify it and find Y for A = 1, B = 1, C = 1.

Try it first, then show the solutionSolution
  1. Y = (A·B)' + C'.
  2. By De Morgan's first law, (A·B)' = A' + B', so Y = A' + B' + C' = (A·B·C)'.
  3. A = B = C = 1: Y = (1·1·1)' = 0.

Answer: Y = (A·B)' + C' = (ABC)', which is a 3-input NAND; Y = 0 for 111.

Example 5: Majority voter · 3 marks · Short answerHOTS / competency

Three judges press a button (1 = pass, 0 = fail). A light L must glow when at least two judges press pass. Write L as a sum of products, give the rows where L = 1 and describe the circuit.

Try it first, then show the solutionSolution
  1. At least two of A, B, C are 1 means A and B, or B and C, or C and A: L = AB + BC + CA.
  2. Rows with L = 1: 011, 101, 110, 111.
  3. Circuit: three 2-input AND gates (AB, BC, CA) feeding one 3-input OR gate.

Answer: L = AB + BC + CA; L = 1 for 011, 101, 110 and 111.

Example 6: Complement of an expression · 2 marks · Short answerHarder exam level

Use De Morgan's laws to write the complement of Y = A'·B + C without any bar over a bracket.

Try it first, then show the solutionSolution
  1. Y' = (A'B + C)' = (A'B)'·C' by the second law.
  2. (A'B)' = (A')' + B' = A + B' by the first law.
  3. Y' = (A + B')·C'.

Answer: Y' = (A + B')·C'.

Example 7: Only NOR gates · 3 marks · Short answerHOTS / competency

Show how to make an OR gate and an AND gate using only NOR gates, and check the AND construction for A = 1, B = 0.

Try it first, then show the solutionSolution
  1. OR: one NOR gives (A + B)'; a second NOR with both inputs joined inverts it: ((A + B)')' = A + B.
  2. AND: NOR with joined inputs gives A' and another gives B'; a third NOR of A' and B' gives (A' + B')' = A·B (De Morgan).
  3. Check: A = 1, B = 0 gives A' = 0, B' = 1; (0 + 1)' = 0 = 1·0.

Answer: OR = two NORs in series; AND = NOR(NOR(A, A), NOR(B, B)). For A = 1, B = 0 the output is 0, as AND requires.

Example 8: Parity with XOR · 2 marks · Short answerHOTS / competency

P = A ⊕ B ⊕ C. Find P for the inputs 101 and 111, and say what P = 1 tells you about the number of 1s.

Try it first, then show the solutionSolution
  1. 101: 1 ⊕ 0 = 1, then 1 ⊕ 1 = 0.
  2. 111: 1 ⊕ 1 = 0, then 0 ⊕ 1 = 1.
  3. P is 1 exactly when the count of 1s is odd.

Answer: P(101) = 0, P(111) = 1; P = 1 means an odd number of inputs are 1.

Case-study practice (Section E style)

Read the situation, then answer every part. In a school exam set on the board pattern this is a 4-mark question split into 1 + 1 + 1 + 1 marks.

Automatic water pump controller

Suppose a society's water pump must be controlled by a logic circuit. Sensor L gives 1 when the overhead tank is low, sensor S gives 1 when the underground sump has water, and switch M gives 1 when the manual override is pressed. The pump P should run when the tank is low and the sump has water, or whenever the override is pressed, except that it must never run when the sump is empty (to protect the motor).

  1. (i) · 1 mark

    Write P without the 'except' condition.

    Answer

    Answer: P = L·S + M

    'and' becomes ·, 'or' becomes +.

  2. (ii) · 1 mark

    Add the condition that the pump never runs when the sump is empty and simplify.

    Answer

    Answer: P = (L·S + M)·S = L·S + M·S = S·(L + M)

    AND the whole expression with S; S·S = S.

  3. (iii) · 1 mark

    Find P for (L, S, M) = (1, 0, 1) and (0, 1, 1).

    Answer

    Answer: (1, 0, 1): P = 0·(1 + 1) = 0. (0, 1, 1): P = 1·(0 + 1) = 1.

    With the sump empty the override cannot start the pump.

  4. (iv) · 1 mark

    Describe the circuit for P = S·(L + M) and say how many gates it needs.

    Answer

    Answer: An OR gate with inputs L and M, and an AND gate with inputs S and the OR output: two gates.

    Factorising reduced the circuit from three gates (two AND, one OR) to two.

Where the marks are

How a typical answer is split into step marks. Show every step: a right final answer alone rarely earns full marks.

Draw the truth table of a NOR gate and write its Boolean expression. [2 marks] (2 marks)

StepMarks
Expression: Y = (A + B)'0.5
Four input rows 00, 01, 10, 110.5
Outputs 1, 0, 0, 01

State De Morgan's first law and verify it using a truth table. [3 marks] (3 marks)

StepMarks
Statement: (A·B)' = A' + B', the complement of a product equals the sum of the complements1
Table with columns A, B, A·B, (A·B)', A', B', A' + B' for all four rows1.5
Conclusion: the (A·B)' and A' + B' columns are identical, so the law is verified0.5

Draw the logic circuit for Y = (A + B')·C and draw its truth table. Hence find for which inputs Y = 1. Then rewrite Y' in a form without brackets using De Morgan's laws. [5 marks] (5 marks)

StepMarks
Circuit: NOT gate on B; OR gate taking A and B'; AND gate taking the OR output and C; output labelled Y1.5
Truth table of 8 rows with columns B', A + B', Y1.5
Y = 1 for ABC = 001, 101, 1111
Y' = ((A + B')·C)' = (A + B')' + C' = A'B + C'1

Show how a NOT gate and an AND gate can each be made using only NAND gates. [3 marks] (3 marks)

StepMarks
NOT: both inputs of one NAND joined to A gives (A·A)' = A'1
AND: first NAND gives (A·B)'; a second NAND used as an inverter gives ((A·B)')' = A·B1.5
Diagram or expressions labelled at each output0.5

Where students lose marks in Boolean Logic

The slips examiners see most often, and what to write instead.

  • Mistake: Writing 1 + 1 = 2 or 1 + 1 = 0 in an OR column

    In Boolean algebra OR of 1 and 1 is 1; 0 is the XOR result.

    Wrong working

    A = 1, B = 1: A + B = 0

    Right working

    A = 1, B = 1: A + B = 1 (and A ⊕ B = 0)

    Do this: OR is 0 only for all-zero inputs.

    Usually costs: 1 mark per table

  • Mistake: Applying De Morgan without changing the operator

    Only the operator change makes the law true; (A·B)' is not A'·B'.

    Wrong working

    (A·B)' = A'·B'

    Right working

    (A·B)' = A' + B'

    Do this: Break the bar AND change the sign; check with the row A = 1, B = 0.

    Usually costs: 1-2 marks

  • Mistake: Missing rows in a three-variable truth table

    Three variables need 8 rows; writing 4 or 6 leaves cases out.

    Wrong working

    Rows 000, 011, 101, 111 only

    Right working

    All 8 rows from 000 to 111 in counting order

    Do this: Count in binary from 0 to 2^n - 1.

    Usually costs: 1 mark

  • Mistake: Losing brackets when writing a circuit's expression

    An OR output feeding an AND gate must stay in brackets; without them the precedence changes the meaning.

    Wrong working

    OR(A, B) then AND with C: Y = A + B·C

    Right working

    Y = (A + B)·C

    Do this: Put each gate's output in brackets when it feeds another gate.

    Usually costs: 1 mark

  • Mistake: Confusing NOR with XOR, or NAND with NOT AND of each input

    NOR is the complement of OR; (A·B)' is different from A'·B'.

    Wrong working

    NOR table: 00→0, 01→1, 10→1, 11→0

    Right working

    NOR table: 00→1, 01→0, 10→0, 11→0

    Do this: Write the OR or AND column first, then complement it.

    Usually costs: 1 mark

NCERT exercise guide: Boolean Logic

What each exercise in the NCERT chapter tests, how to approach it, and a question of the same kind solved step by step. Questions here are written in our own words.

No NCERT exercise: Boolean logic is in the CBSE syllabus but not in the NCERT Class XI book

What it tests: Truth tables, De Morgan's laws and logic circuits as named in the 2026-27 syllabus.

How to approach it: Practise with the questions on this page and your school's worksheets; check every truth table row by row, or with a short Python loop.

Self-check by program (not an NCERT exercise)

Write a Python program that prints the truth table of Y = A'B + AB' and confirms that it equals A XOR B in every row.

Show the solutionSolution
  1. print('A B Y')
    ok = True
    for a in (0, 1):
        for b in (0, 1):
            y = int(((not a) and b) or (a and (not b)))
            print(a, b, y)
            if y != a ^ b:
                ok = False
    print('Same as XOR:', ok)
  2. int() turns the True/False result into 1/0; a ^ b is XOR on 0 and 1.

Answer: A B Y
0 0 0
0 1 1
1 0 1
1 1 0
Same as XOR: True

Practice questions on Boolean Logic

Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.

  1. Q1 · 1 mark · MCQExam level

    Which gate gives output 1 only when all its inputs are 0? (a) AND (b) NAND (c) NOR (d) XOR

    Hint

    Complement of OR.

    Answer

    (c) NOR

  2. Q2 · 2 marks · Short answerExam level

    Write the truth table of a 3-input AND gate.

    Hint

    8 rows.

    Answer

    Rows 000 to 110 give 0; only 111 gives 1.

  3. Q3 · 2 marks · Short answerExam level

    State both De Morgan's laws in words.

    Hint

    Complement of a product; complement of a sum.

    Answer

    The complement of a product equals the sum of the complements: (A·B)' = A' + B'. The complement of a sum equals the product of the complements: (A + B)' = A'·B'.

  4. Q4 · 1 mark · Very short answerHarder exam level

    Simplify (A' · B')' using De Morgan's law and name the single gate that gives it.

    Hint

    Break the bar.

    Answer

    (A')' + (B')' = A + B: an OR gate.

  5. Q5 · 3 marks · Short answerHarder exam level

    Draw the truth table of Y = A'B + BC and say in words when Y is 1.

    Hint

    Both terms need B = 1.

    Answer

    Y = 1 for ABC = 010, 011, 111; 0 otherwise. Y is 1 when B = 1 and either A = 0 or C = 1.

  6. Q6 · 2 marks · Short answerHarder exam level

    Predict the output:

    for a in (0, 1):
        for b in (0, 1):
            print(a ^ b, int(not (a and b)), end=' | ')
    Hint

    XOR and NAND.

    Answer

    0 1 | 1 1 | 1 1 | 0 0 |

  7. Q7 · 1 mark · MCQHarder exam level

    Assertion (A): A NAND gate can be used to build any logic circuit. Reason (R): NOT, AND and OR can all be made using only NAND gates. Choose (a) both true, R explains A (b) both true, R does not explain A (c) A true, R false (d) A false, R true.

    Hint

    Why is NAND universal?

    Answer

    (a)

  8. Q8 · 2 marks · Short answerHarder exam level

    Inputs A and B go to an XOR gate; its output and C go to an AND gate giving Y. Write Y and find all inputs for which Y = 1.

    Hint

    C must be 1 and A, B must differ.

    Answer

    Y = (A ⊕ B)·C; Y = 1 for ABC = 011 and 101.

  9. Q9 · 2 marks · Short answerHOTS / competency

    A car's warning beep W sounds if the engine is on (E) and either the seat belt is not fastened (B = 0) or a door is open (D = 1). Write W and find it for E = 1, B = 1, D = 0.

    Hint

    Not fastened means B'.

    Answer

    W = E·(B' + D); for 1, 1, 0: W = 1·(0 + 0) = 0, no beep.

  10. Q10 · 2 marks · Short answerHarder exam level

    Prove by truth table that A + A·B = A.

    Hint

    Two variables, four rows.

    Answer

    A·B column 0, 0, 0, 1; A + A·B column 0, 0, 1, 1, which equals the A column (0, 0, 1, 1). Proved.

  11. Q11 · 2 marks · Short answerHOTS / competency

    Is (A + B)' the same as A' + B'? Justify with one row of the truth table.

    Hint

    Try A = 1, B = 0.

    Answer

    No. For A = 1, B = 0: (A + B)' = 1' = 0 but A' + B' = 0 + 1 = 1. The correct law is (A + B)' = A'·B'.

  12. Q12 · 3 marks · Short answerHOTS / competency

    Draw the logic circuit for Y = (A + B)·(A·B)' and show that it behaves as an XOR gate.

    Hint

    Compare with the XOR table row by row.

    Answer

    Circuit: an OR gate on A, B; a NAND gate on A, B; an AND gate joining both outputs. Rows: 00: 0·1 = 0; 01: 1·1 = 1; 10: 1·1 = 1; 11: 1·0 = 0, which is the XOR table.

Test your recall

Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.

  1. 1.How many rows has the truth table of a 3-input gate?Show answer

    2^3 = 8.

  2. 2.For which inputs is a NAND gate's output 0?Show answer

    Only when all inputs are 1.

  3. 3.For which inputs is a NOR gate's output 1?Show answer

    Only when all inputs are 0.

  4. 4.State De Morgan's second law.Show answer

    (A + B)' = A'·B'.

  5. 5.What is 1 ⊕ 1?Show answer

    0.

  6. 6.Name the two universal gates.Show answer

    NAND and NOR.

  7. 7.What is (A')' equal to?Show answer

    A.

Best order to study it

  1. Boolean values 0 and 1; NOT and its truth table.
  2. AND and OR: tables, series and parallel switch pictures, gate shapes.
  3. NAND, NOR and XOR: tables and gate shapes with bubbles.
  4. Truth tables for two- and three-variable expressions.
  5. De Morgan's laws: statement, truth-table proof, use in rewriting.
  6. Logic circuits: circuit to expression, expression to circuit, output for given inputs.
  7. Universal gates: NOT, AND and OR from NAND or NOR alone.

Quick revision checklist

The night before the exam: can you do each of these without looking?

  • Boolean values: 1 (true) and 0 (false).
  • NOT flips; AND is 1 only for all 1s; OR is 0 only for all 0s.
  • NAND = NOT AND (0 only for all 1s); NOR = NOT OR (1 only for all 0s).
  • XOR is 1 when inputs differ: A ⊕ B = A'B + AB'.
  • n variables: 2^n rows in the truth table.
  • De Morgan: (A·B)' = A' + B'; (A + B)' = A'·B'.
  • NAND and NOR are universal gates.
  • Circuit to expression: label each gate's output, keep brackets.

Boolean Logic: frequently asked questions

Is Boolean logic in the NCERT Class 11 Computer Science book?

No. The CBSE 2026-27 syllabus lists Boolean logic (NOT, AND, OR, NAND, NOR, XOR, truth tables, De Morgan's laws and logic circuits) in Unit I, but the current NCERT Class XI Computer Science book has no chapter on it. This page follows the syllabus wording.

Is Boolean algebra simplification (K-maps, all the laws) in the syllabus?

The syllabus names only the six operations, truth tables, De Morgan's laws and logic circuits. Karnaugh maps and long algebraic simplification are not listed. Short rewrites with De Morgan's laws and simple identities such as (A')' = A are enough.

Is XNOR in the syllabus?

XNOR is not named in the 2026-27 syllabus list. It is simply the complement of XOR (1 when the inputs are equal), and is shown here only as a note.

How do I write NOT in an answer?

Any clear notation is fine: a bar over the variable, A' or ¬A. Use one notation consistently and keep brackets when the NOT covers a whole expression, such as (A + B)'.

Why are NAND and NOR called universal gates?

Because NOT, AND and OR can each be made from NAND gates alone (or from NOR gates alone), and every logic circuit is made of NOT, AND and OR. So any circuit can be built with one kind of gate.

Based on: CBSE Computer Science (083) syllabus, Class XI 2026-27