PYQ Vault

HSC Physics · Semiconductor Devices

Logic Gates

What a logic gate, a truth table and a Boolean expression are, the basic NOT, OR and AND gates, and the NAND, NOR and X-OR gates built from them.

Why this matters

12 questions. Seven were set in board papers: name the gate that is high when at least one input is high (2019), write the Boolean expression of the X-OR gate (2022), name the gate whose expression is Y = NOT (A + B) (2023), what a logic gate is (2024), the gate that is high when both inputs are high (2025), define a logic gate and say why a NOT gate is called an inverter (2025), and the Boolean equation of the NOR gate (2026). The textbook adds truth tables, Boolean expressions and the uses of logic gates.

Concept 1 of 3: Logic gate, truth table and Boolean expression

A digital circuit deals with only two levels: low (0) and high (1). A logic gate looks at its inputs and decides whether its single output is 0 or 1 by a fixed rule. A truth table lists that decision for every possible input, and a Boolean expression says the same rule in one line of algebra.

Definition

  • Analog signal: varies continuously, like a sine wave. Digital signal: has only two values, low (0, about 0 V) and high (1, about +5 V), like a square wave.
  • Logic gate: a digital circuit with one or more inputs but only one output, which follows a definite logical relationship between input and output. Gates are so called because they control the flow of signal or information.
  • Truth table: lists all possible combinations of the inputs with the output for each. A gate with nn inputs has 2n2^n rows.
  • Boolean expression: the mathematical statement that gives the relationship between the inputs and the output of a gate.
  • The five common gates are NOT, AND, OR, NAND and NOR; the X-OR gate is also in the book.
  • Uses: logic gates are the building blocks of digital circuits; they take logical decisions. The X-OR gate compares two logic levels in computational circuits. NAND and NOR are universal gates: any gate can be built from NAND gates alone or from NOR gates alone.
TermMeaning
Logic gateA digital circuit with one or more inputs and only one output, following a definite logical relationship between themQ
Board 2024 asked what a logic gate is, and 2025 asked you to define it.
Truth tableAll possible combinations of the inputs, with the output for each
Boolean expressionThe mathematical statement relating the output of a gate to its inputs
Digital signalA signal with only two values: low (0) and high (1)
Universal gateA gate from which any gate can be built: NAND or NOR
Practise this concept3 quick reps

A gate that lets current flow one way

Allowing current in one direction only describes a diode. A logic gate makes a logical decision: its output is high or low according to its inputs.

Concept 2 of 3: The NOT, OR and AND gates

Read each gate as a sentence. NOT says 'the opposite of the input'. OR says 'high if A or B (or both) is high'. AND says 'high only if A and B are both high'. Every other gate is one of these followed by a NOT.

Definition

  • NOT gate: one input, one output. Input 0 gives 1; input 1 gives 0. It produces a negated version of its input, which is why it is called an inverter. Y=X‾Y = \overline{X}.
  • OR gate: two or more inputs. The output is 1 when either input or both are 1; it is 0 only when all inputs are 0. Logical addition: Y=A+BY = A + B. Outputs for AB = 00, 01, 10, 11: 0, 1, 1, 1.
  • AND gate: two or more inputs. The output is 1 only when all inputs are 1. Logical multiplication: Y=A⋅BY = A \cdot B. Outputs for AB = 00, 01, 10, 11: 0, 0, 0, 1.
  • For a definition question, give the symbol, the truth table and the Boolean expression together.

Boolean expressions

NOT: Y=X‾,OR: Y=A+B,AND: Y=A⋅B\text{NOT: } Y = \overline{X}, \qquad \text{OR: } Y = A + B, \qquad \text{AND: } Y = A \cdot B

Worked example

Inputs A = 1 and B = 0 are applied to an OR gate and to an AND gate. Find each output. The output of the AND gate is then fed to a NOT gate; find its output.
Practise this conceptself-check · 3 quick reps

The same idea in a real exam question:

Maharashtra HSC Class 12 · 2025 · Q. 1(vii)Easy

Example 2 · Semiconductor Devices · Logic Gates

The gate which produces high output, when its both inputs are high is –

Reading + as ordinary addition

In Boolean algebra 1+1=11 + 1 = 1 for an OR gate, not 2. The output can only be 0 or 1.

Swapping 'at least one' and 'both'

'High when at least one input is high' is the OR gate; 'high only when both inputs are high' is the AND gate. Read the condition twice before choosing.

Concept 3 of 3: The NAND, NOR and X-OR gates

NAND is AND turned upside down, and NOR is OR turned upside down: take the AND or OR output and invert it. X-OR is the 'are they different?' gate: high when the two inputs disagree, low when they agree.

Definition

  • NAND gate: an AND gate whose output is fed to a NOT gate. Its output is the opposite of AND: 0 only when both inputs are 1. Y=A⋅B‾Y = \overline{A \cdot B}. Outputs for AB = 00, 01, 10, 11: 1, 1, 1, 0.
  • NOR gate: an OR gate whose output is fed to a NOT gate. Its output is the opposite of OR: 1 only when both inputs are 0. Y=A+B‾Y = \overline{A + B}. Outputs: 1, 0, 0, 0.
  • X-OR (Exclusive-OR) gate: high only when its two inputs are at different logic levels (an odd number of 1s at the input). Y=A⊕B=AB‾+A‾BY = A \oplus B = A\overline{B} + \overline{A}B. Outputs: 0, 1, 1, 0.
  • NAND and NOR are universal gates.

NAND, NOR and X-OR

NAND: Y=A⋅B‾,NOR: Y=A+B‾,X-OR: Y=AB‾+A‾B\text{NAND: } Y = \overline{A \cdot B}, \qquad \text{NOR: } Y = \overline{A + B}, \qquad \text{X-OR: } Y = A\overline{B} + \overline{A}B

Worked example

Inputs A = 1 and B = 0 are applied in turn to a NAND gate, a NOR gate and an X-OR gate. Find each output.
Practise this conceptself-check · 3 quick reps

The same idea in a real exam question:

Maharashtra HSC Class 12 · 2022 · Q. 2(iv)Easy

Example 3 · Semiconductor Devices · Logic Gates

Write the Boolean expression for Exclusive-OR (X-OR) gate.

One bar or two

A+B‾\overline{A + B} has ONE bar over the whole sum: it is NOR. A‾+B‾\overline{A} + \overline{B}, with a bar over each letter, is a different expression.

X-OR with both inputs high

X-OR is high only when the inputs differ, so with both inputs 1 its output is 0. OR would give 1 there.

The book's wording for NAND and NOR

The textbook says NAND is formed by joining the output of a NOT gate to the input of an AND gate, but its truth table is that of an AND gate followed by a NOT gate. Write it that way: the AND (or OR) output goes into the NOT gate.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (2)

  • The NOT, OR and AND gates

    Boolean expressions

    NOT: Y=X‾,OR: Y=A+B,AND: Y=A⋅B\text{NOT: } Y = \overline{X}, \qquad \text{OR: } Y = A + B, \qquad \text{AND: } Y = A \cdot B
  • The NAND, NOR and X-OR gates

    NAND, NOR and X-OR

    NAND: Y=A⋅B‾,NOR: Y=A+B‾,X-OR: Y=AB‾+A‾B\text{NAND: } Y = \overline{A \cdot B}, \qquad \text{NOR: } Y = \overline{A + B}, \qquad \text{X-OR: } Y = A\overline{B} + \overline{A}B

Reference tables (1)

Logic gate, truth table and Boolean expression5 rows
TermMeaning
Logic gateA digital circuit with one or more inputs and only one output, following a definite logical relationship between themQ
Board 2024 asked what a logic gate is, and 2025 asked you to define it.
Truth tableAll possible combinations of the inputs, with the output for each
Boolean expressionThe mathematical statement relating the output of a gate to its inputs
Digital signalA signal with only two values: low (0) and high (1)
Universal gateA gate from which any gate can be built: NAND or NOR

Watch out for (6)

Test yourself on Semiconductor Devices

10 past MH HSC 12 questions from this chapter, timed at 15 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.