Skip to content
IGCSE·Tuition
Computer Science · Lessons

Interpret a simple logic circuit

A circuit diagram can look like a tangle of lines until you read it one gate at a time.

On this page
  1. What do the gates do?
  2. How to read a circuit
  3. Worked example
  4. The mistake to watch for
  5. Check yourself
  6. Where this leads next

A logic circuit is a Boolean expression drawn as gates joined by wires. To interpret it, read from the inputs towards the output, one gate at a time, and write down what comes out of each gate.

This lesson follows truth tables and belongs to the Boolean logic module. Here the circuit is described in words, so you can practise even without the diagram in front of you.

What do the gates do?

GateOutput is 1 when
NOTthe input is 0
ANDboth inputs are 1
ORat least one input is 1
NANDnot both inputs are 1 (AND, then NOT)
NORboth inputs are 0 (OR, then NOT)
XORthe two inputs are different

How to read a circuit

  1. Find the inputs on the left (A, B, C) and the output Q on the right.
  2. Label the output of each gate with a new letter, X, Y and so on.
  3. Write the expression for each label in terms of earlier values.
  4. Combine the labels to write Q in terms of the inputs.
  5. Test with a few input rows, or build the full table.

Worked example

A circuit has these parts. Inputs A and B go into an XOR gate whose output is X.

X and C go into an AND gate whose output is Y. Y goes into a NOT gate whose output is Q.

Expression: X = A XOR B, Y = X AND C, Q = NOT Y. So Q = NOT ((A XOR B) AND C).

Test A = 1, B = 0, C = 1: X = 1 XOR 0 = 1. Y = 1 AND 1 = 1. Q = NOT 1 = 0.

Test A = 1, B = 1, C = 1: X = 1 XOR 1 = 0. Y = 0 AND 1 = 0. Q = NOT 0 = 1.

The full table, in the order ABC:

ABCXYQ
000001
001001
010101
011110
100101
101110
110001
111001

Q is 0 only when C = 1 and A is different from B. That sentence is a useful plain-language description of what the circuit does.

The mistake to watch for

Students often treat XOR as OR.

Mistaken working for A = 1, B = 1, C = 1: X = 1 OR 1 = 1, Y = 1, Q = 0.

XOR of two equal inputs is 0, so X = 0, Y = 0 and Q = 1. The mistaken version gives the opposite output. Always check what happens when both inputs are 1, because that is the one row where OR and XOR disagree.

Check yourself

1. What is the output of a NAND gate when both inputs are 1?

Show answer

AND gives 1, then NOT flips it to 0.

2. What is the output of a NOR gate when both inputs are 0?

Show answer

OR gives 0, then NOT flips it to 1.

3. A and B go into a NOR gate with output X. X goes into a NOT gate with output Q. Write Q in terms of A and B, and say what it does.

Show answer

X = A NOR B = NOT (A OR B). Then Q = NOT X = NOT (NOT (A OR B)) = A OR B. Check: A = 0, B = 0 gives X = 1 and Q = 0. A = 1, B = 0 gives X = 0 and Q = 1. The two gates together behave as a single OR gate.

Where this leads next

Next, learn how to prove two expressions are the same in comparing equivalent expressions using cases. You can use the restricted pseudocode trace trainer for similar step-by-step tracing of algorithms, and the Boolean and number-representation lab for circuit-style checks.

If you can read circuits taught in class but freeze on a new one, a teacher can build a reading routine with you in online one-to-one Computer Science tuition.

Questions people ask

What is the difference between OR and XOR?

OR gives 1 when at least one input is 1, including when both are 1. XOR gives 1 only when exactly one input is 1, so XOR of 1 and 1 is 0. Many wrong circuit answers come from treating XOR as OR.

What do NAND and NOR mean?

NAND is AND followed by NOT, so it gives 0 only when both inputs are 1. NOR is OR followed by NOT, so it gives 1 only when both inputs are 0. Treat each as the plain gate first, then invert the result.

Do I write the expression or the table first?

Either works, but writing an expression gate by gate is usually the safer start. Label the output of each gate with a letter such as X or Y, then combine the labels. The labels act as the working columns of a truth table.

Sources

  1. Cambridge IGCSE Computer Science 0478 syllabus page

Updated:

Your next step

If circuits make sense when a teacher draws them but go blank on an unfamiliar diagram, a one-to-one teacher can practise reading new circuits with you until the gate-by-gate routine feels natural.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parent or guardian? Enquire here

9,000+ students helped through our service