🔀 Data & Logic

Boolean Logic & Logic Gates

बूलियन तर्क और लॉजिक गेट

⏱ 3 hr4 topicsInteractive
🎯 By the end: You can state the truth table of every basic gate, build expressions from circuits (and vice versa), and apply De Morgan's laws.

If number systems are how a computer stores data, Boolean logic is how it thinks. Named after mathematician George Boole, it deals with just two values — true (1) and false (0) — combined by simple rules called logic gates. Stack millions of these tiny gates together and you get a CPU. Flip the switches in the simulator below and you'll understand them faster than any table can teach you.

1True, false and the basic gates

A logic gate takes one or two inputs (each 0 or 1) and produces one output (0 or 1). A truth table lists the output for every possible combination of inputs. The three you build everything from:

  • NOT (inverter) — one input; it flips it. NOT 0 = 1, NOT 1 = 0. Written A' or ̄A.
  • AND — output is 1 only if both inputs are 1. Written A . B. Think "both".
  • OR — output is 1 if at least one input is 1. Written A + B. Think "either".
ABA AND BA OR B
0000
0101
1001
1111
Memory hook: AND is strict — it needs all inputs true (like multiplication: 1×1=1, anything×0=0). OR is generous — any true input is enough (like addition that caps at 1).
Key points
  • NOT flips its single input; AND outputs 1 only when both inputs are 1; OR outputs 1 if any input is 1.
  • AND is written A.B (like multiply); OR is written A+B (like add).
  • A truth table lists the output for every input combination.

2The derived gates: NAND, NOR, XOR, XNOR

Four more gates are built from the basic three:

  • NAND = NOT AND — the opposite of AND (1 unless both inputs are 1).
  • NOR = NOT OR — the opposite of OR (1 only when both inputs are 0).
  • XOR (exclusive OR) — 1 when the inputs are different. Think "one or the other, but not both".
  • XNOR — the opposite of XOR — 1 when the inputs are the same.
Why NAND and NOR matter: they are called universal gates because you can build any other gate using only NANDs (or only NORs). Real chips are often made almost entirely of NAND gates for this reason.

Don't memorise all seven tables cold — use the simulator in the next section. Flip A and B, switch the gate, and the table teaches itself.

Key points
  • NAND = NOT AND; NOR = NOT OR (the inverted basic gates).
  • XOR outputs 1 when inputs differ; XNOR outputs 1 when they're the same.
  • NAND and NOR are 'universal' — any gate can be built from them alone.

3Flip the switches — the Logic Gate Simulator

Pick a gate, then toggle inputs A and B. The output lights up and the current row of the truth table is highlighted. Work through all seven gates — by the time you've flipped every switch, you'll know the tables without trying.

Logic Gate Simulator

Output 0
Key points
  • Toggle the inputs and the output updates instantly — the truth table builds itself.
  • Compare AND vs NAND, and OR vs NOR, to see how NOT simply flips the output.
  • XOR and XNOR are mirror images: 'different' vs 'same'.

4Circuits and De Morgan's laws

You'll need to move between three forms: a Boolean expression, a logic circuit diagram, and a truth table. Reading an expression like (A . B) + C', you build the circuit gate by gate; reading a circuit, you write the expression.

De Morgan's Laws

Two rules let you simplify and rearrange expressions. They're a CBSE favourite:

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

In words: break the bar, change the sign. When you split a NOT over a bracket, AND becomes OR and OR becomes AND, and each variable gets its own NOT.

You can prove either law by building a truth table for both sides and showing the output columns match for all four input combinations — exactly the kind of verification the exam asks for.

Toggle the inputs below and switch between the two laws — the proof line and truth table show both sides are always equal.

De Morgan's Law Visualizer

Key points
  • Convert freely between expression, circuit diagram and truth table.
  • De Morgan: (A.B)' = A'+B' and (A+B)' = A'.B' — 'break the bar, change the sign'.
  • Prove a Boolean law by matching the output columns of a truth table for all input combinations.

★ Practical: be the chip

Using the simulator to check yourself:

  1. Write the truth table for NAND from memory, then verify it on the simulator.
  2. For A=1, B=0, work out the output of XOR, then NOR, then NAND.
  3. Apply De Morgan's law to simplify (A + B)' and confirm with a truth table.
  4. Describe the circuit for the expression (A . B) + C in words (which gates feed which).

Ready for the chapter test?

Answer 5 questions. Score 60% or more to mark this chapter complete.

Start the test →

💡 Log in to save your progress and earn the certificate.