Free resource

Logic gates, explained with the actual symbols

Paper I asks you to identify a gate from its symbol or complete its truth table. Paper II asks you to write or simplify a Boolean expression. Both come from the same seven gates below — learn the symbol and the one row that makes each gate distinct from its closest lookalike.

AND, OR, NOT වගේ logic gates වල truth table සහ symbols මෙතන සරලව පැහැදිලි කර ඇත.

Converting between number systems first? Binary, hex and two's complement, worked step by step.

  • AND gate

    Q = A · B

    AND ගේට්

    ABQ
    ABQ
    000
    010
    100
    111

    Output is 1 only when both inputs are 1.

    Drawn as a switches-in-series circuit almost every year — both switches must close for the lamp to light.

  • OR gate

    Q = A + B

    OR ගේට්

    ABQ
    ABQ
    000
    011
    101
    111

    Output is 1 when at least one input is 1.

    The switches-in-parallel circuit — either switch alone lights the lamp.

  • NOT gate

    Q = A′

    NOT ගේට්

    AQ
    AQ
    01
    10

    Output is the opposite of the single input — also called an inverter.

    The building block for every other inverted gate below — learn this one truth table cold.

  • NAND gate

    Q = (A · B)′

    NAND ගේට්

    ABQ
    ABQ
    001
    011
    101
    110

    AND, then inverted — output is 0 only when both inputs are 1.

    A NAND gate with its two inputs tied together behaves exactly like a NOT gate — a favourite short-answer question.

  • NOR gate

    Q = (A + B)′

    NOR ගේට්

    ABQ
    ABQ
    001
    010
    100
    110

    OR, then inverted — output is 1 only when both inputs are 0.

    Easy to mix up with NAND under exam pressure — check the ONE row that differs (both inputs 0) to tell them apart fast.

  • XOR gate

    Q = A ⊕ B

    XOR ගේට්

    ABQ
    ABQ
    000
    011
    101
    110

    Output is 1 when the two inputs differ.

    Looks like OR except for one row (1,1) — that row is exactly what distinguishes them, and it's a common trick question.

  • XNOR gate

    Q = (A ⊕ B)′

    XNOR ගේට්

    ABQ
    ABQ
    001
    010
    100
    111

    Output is 1 when the two inputs are the same.

    The "equality checker" gate — 1 out means A and B agree.

De Morgan's theorem, proved rather than stated

(A·B)′ is meant to behave exactly like A′+B′. Instead of taking that on faith, check every row of both truth tables side by side:

AB(A·B)′A′+B′Match?
0011
0111
1011
1100

Every row matches, so the two expressions are equivalent — which is exactly what an exam question asking you to "prove De Morgan's theorem using a truth table" wants to see. The mirror rule, (A+B)′ = A′·B′, is proved the same way.

Questions students ask

How many logic gates are there in the A/L ICT syllabus?

Seven basic gates: AND, OR, NOT, NAND, NOR, XOR and XNOR. NAND and NOR are sometimes called "universal gates" because either one alone can be wired up to build every other gate — a common structured-question angle.

What is the fastest way to tell NAND and NOR apart under exam pressure?

Check only the row where both inputs are 0. NOR outputs 1 there (nothing is on, so "neither" is true); NAND outputs 1 everywhere except when both inputs are 1. If you can't remember the whole table, that one row is enough to identify which gate you're looking at.

What's the difference between OR and XOR?

They agree on three of the four input rows and differ on exactly one: when both inputs are 1, OR outputs 1 but XOR outputs 0. XOR means "one or the other, but not both."

What is De Morgan's theorem, in plain terms?

It states that (A·B)′ = A′ + B′, and separately (A+B)′ = A′·B′ — in words, "NOT (A AND B)" behaves exactly like "(NOT A) OR (NOT B)", and "NOT (A OR B)" behaves like "(NOT A) AND (NOT B)". You can prove either version by building both truth tables and checking every row matches.

Find your weak units

Every unit has a free 10-question test, marked when you finish, with the reason for every answer and the topics to revise.

Take a free test