2025 A/L Physics Past Paper · Question 48 (English Medium)

A circuit of NAND gates only

Consider the logic gate circuit made of NAND gates only. What is the correct truth table of the circuit?

  1. (1) Table (1)
  2. (2) Table (2)
  3. (3) Table (3)
  4. (4) Table (4)
  5. (5) Table (5)
Answer and explanation

Answer: (2) Table (2)

What the question asks

This question is about a small logic circuit made only of NAND gates, with two inputs A and B and one output F.

A NAND gate is an AND gate followed by a NOT: it gives 0 only when both inputs are 1, and 1 at every other time.

The first gate has both of its inputs joined to A. So it turns A over and gives Ā.

What we must find: F for each of the four pairs of A and B, written as a truth table.

How we find it: follow the wires gate by gate. Then try the four input pairs one row at a time.

What each letter means:

AA, BB: the two inputs, each 00 or 11.

Aˉ\bar{A}: AA turned over, 11 when A=0A=0.

PP: the output of the top gate.

QQ: the output of the bottom gate.

FF: the output of the last gate.

Relevant theory

F = Ā Where Ā is the inversion of A

The logic operation of the NAND gate is the inverse of that of the AND gate. It will be

What is happening: a NAND gate with both inputs joined acts as a NOT gate, A.A‾=Aˉ\overline{A.A}=\bar{A}.

Every other gate here takes two different wires and gives 00 only when both are 11.

For example, a shop alarm with two switches, one at the front door and one at the back door. It stays quiet only when both switches are on (1 and 1). Any other time it rings.

That is a NAND gate: quiet (0) only for 1 and 1.

Now join both of its wires to the front switch alone. Switch on: quiet. Switch off: it rings. The alarm has become a NOT gate.

Reading the options

So F=BF=B.

First gate: AA and AA

Aˉ\bar{A}

Both inputs are the same wire, so it acts as a NOT gate.

Top gate: AA and BB

P=AB‾P=\overline{AB}

00 only when A=1A=1 and B=1B=1.

Bottom gate: Aˉ\bar{A} and BB

Q=AˉB‾Q=\overline{\bar{A}B}

00 only when A=0A=0 and B=1B=1.

Last gate: PP and QQ

F=PQ‾F=\overline{PQ}

F=1F=1 when PP or QQ is 00, that is, whenever B=1B=1.

Now try the four rows.

A=0A=0, B=0B=0: P=1P=1, Q=1Q=1, F=0F=0.

A=0A=0, B=1B=1: P=1P=1, Q=0Q=0, F=1F=1.

A=1A=1, B=0B=0: P=1P=1, Q=1Q=1, F=0F=0.

A=1A=1, B=1B=1: P=0P=0, Q=1Q=1, F=1F=1.

The column F reads 0, 1, 0, 1. That is table (2).

Why the other options fail

Table (1) is F=BˉF=\bar{B}: every value is upside down. It is what you get if you forget that the last gate is a NAND gate too, and so turns its result over once more.

Table (3) is F=ABF=AB: it keeps only the top path. At A=0A=0, B=1B=1 the bottom gate gets Aˉ=1\bar{A}=1 and B=1B=1, gives 00, and the last gate then gives F=1F=1, not 00.

Table (4) is AB‾\overline{AB}, the output of the top NAND gate alone. The circuit goes on through the last gate, and at A=0A=0, B=0B=0 that gives F=0F=0.

Table (5) gives F=1F=1 at A=1A=1, B=0B=0. There the top gate gets 11, 00 and gives 11, the bottom gate gets Aˉ=0\bar{A}=0, 00 and gives 11, so the last gate gives F=0F=0.

Conclusion

F=BF=B

The circuit gives F=BF=B: FF is 00, 11, 00, 11. The answer is (2).

A NAND gate with its two inputs joined is a NOT gate. Spot it first, then follow the wires one gate at a time.

Exam tip

தமிழ் · සිංහල