IB Computer Science2027 syllabus
Level view
A1.2.5

Constructing logic diagrams

SL & HL25 min readLesson

In one sentence: A logic diagram maps Boolean expressions and multi-step conditions onto interconnected standard gate symbols, letting engineers trace signals from inputs to outputs and simplify circuits before building hardware.

What you will learn

By the end of this lesson, you should be able to:

  • Recognize and draw the standard logic gate symbols for AND, OR, NOT, NAND, NOR, XOR, and XNOR.
  • Construct a connected logic diagram directly from a Boolean expression or problem specification.
  • Trace binary signals step by step through a multi-gate logic diagram and extract its Boolean expression.
  • Apply Boolean algebra rules to simplify complex logic diagrams and explain why simplification improves real hardware.

Before you begin

Review Purpose and use of logic gates (A1.2.3) and Constructing and analysing truth tables (A1.2.4), especially Boolean operator precedence (NOT, then AND/NAND, then OR/NOR/XOR/XNOR) and the Boolean simplification laws.

Key words

TermSimple meaning
Logic diagramA schematic drawing using standard gate symbols and signal wires to show how inputs are combined to produce an output.
Standard gate symbolThe recognized geometric shape (such as D-shaped AND, shield-shaped OR, or triangle NOT) identifying a logic gate in circuit diagrams.
Inversion bubbleA small circle (○) drawn on the output tip of NOT, NAND, NOR, and XNOR symbols indicating logical inversion (flipping 0 to 1 and 1 to 0).
Junction dotA solid dot showing where one wire splits to feed multiple gate inputs; crossing wires without a dot are not connected.
Propagation delayThe brief electrical delay taken for a signal change to travel through layers of logic gates from inputs to output.

The idea, step by step

1. Standard gate symbols (AND, OR, NOT, NAND, NOR, XOR, XNOR)

Every engineer must read the same visual shorthand. Standard distinctive-shape symbols distinguish the seven gates by three features: the shape of the input back, the shape of the body, and the presence or absence of an inversion bubble (○) on the output wire.

GateInput back & extra linesBody outlineOutput tipDistinguishing visual clue
ANDFlat vertical back lineRounded D-shaped frontPlain line (no bubble)Flat back + curved D-front.
NANDFlat vertical back lineRounded D-shaped frontSmall bubble (○)AND shape + output bubble (NOT AND).
ORInward-curved back edgePointed curved frontPlain line (no bubble)Concave curved back meeting at a point.
NORInward-curved back edgePointed curved frontSmall bubble (○)OR shape + output bubble (NOT OR).
XORInward-curved back plus a second curved arc just behind itPointed curved frontPlain line (no bubble)OR shape + extra parallel input arc.
XNORInward-curved back plus a second curved arc just behind itPointed curved frontSmall bubble (○)XOR shape + output bubble.
NOTSingle input into flat triangle basePointed triangleSmall bubble (○)Triangle pointing right with 1 input and output bubble.

Consult A1.2.3 and A1.2.5 in the textbook (Book pp. 52–55, 65–66) to examine rendered printed drawings of each geometric symbol alongside these structural cues.

2. Building a logic diagram from a Boolean expression

Follow a reliable left-to-right workflow when converting any Boolean expression into a diagram:

  1. Place the input labels down the left edge: Draw horizontal input wires (A, B, C) toward the right. Whenever an input variable appears more than once in the expression, branch a new wire downward from its main line using a junction dot rather than duplicating input letters haphazardly.
  2. Build inside parentheses first: Respect standard operator precedence (NOT, then AND or NAND, then OR, NOR, XOR, or XNOR):
    • Connect any NOT inputs through NOT gates first.
    • Connect AND/NAND sub-expressions next.
    • Connect OR/NOR/XOR/XNOR sub-expressions next.
  3. Label intermediate wires: Name internal wires (P, Q) whenever useful to avoid crossed or confusing lines.
  4. Combine into the outermost gate(s): Connect the intermediate wires into the final gate(s) to drive the labelled output (Y or X).

Because logic gates can be chained together, combining simple gates builds more complex behaviour. For example, feeding the same two bits A and B into both an XOR gate (for the sum bit) and an AND gate (for the carry bit) forms a half-adder, the fundamental circuit block behind binary arithmetic in the ALU.

3. Reading and tracing a logic diagram

Working in reverse (from a given circuit diagram back to a Boolean expression and truth table) uses the same left-to-right order:

  1. Identify each gate nearest the inputs (A, B, C) and label its output wire with a short Boolean sub-expression (P, Q).
  2. Move stage by stage toward the output, substituting earlier sub-expressions as inputs into downstream gates until reaching final output Y.
  3. To trace a specific test case (such as A = 1, B = 0, C = 1), write the 0 or 1 directly alongside each input wire, evaluate each gate's intermediate wire left-to-right, and record the final output bit.

4. Simplifying logic diagrams with Boolean algebra

Drawing gates directly from an unsimplified specification can waste hardware. Applying Boolean algebra simplification rules (A1.2.4) before drawing or fabricating a circuit removes redundant gates and wires while guaranteeing identical logical behaviour on every input row.

Why does simplifying a logic diagram matter in real engineering?

  • Fewer components and lower cost: Fewer transistors and logic gates are needed per chip or board.
  • Smaller physical footprint and lower power consumption: Less silicon space and heat generation.
  • Shorter propagation delay: Signals travel through fewer gate layers, allowing higher clock speeds and cleaner timing.

Worked example

Part A: Constructing and tracing a 3-input logic diagram

Expression: Build the logic diagram for Y = (A + B) · (NOT C) and trace its output when A = 1, B = 0, and C = 0.

  1. Identify inputs: Draw input rails A, B, and C on the left.
  2. Inner expression 1 ((A + B)): Feed A and B into a 2-input OR gate to create intermediate wire P = A + B.
  3. Inner expression 2 ((NOT C)): Feed C into a 1-input NOT gate to create intermediate wire Q = NOT C.
  4. Outer expression (P · Q): Connect intermediate wires P and Q into a final 2-input AND gate to output Y.
StageGateInputsOutput wire and expression
Stage 1 (Inner)ORA, BP = A + B
Stage 1 (Inner)NOTCQ = NOT C
Stage 2 (Outer)ANDP, QY = (A + B) · (NOT C)
  1. Trace A = 1, B = 0, C = 0:
    • Gate 1 (OR): P = 1 + 0 = 1.
    • Gate 2 (NOT): Q = NOT 0 = 1.
    • Gate 3 (AND): Y = 1 · 1 = 1. (If C changed to 1, then Q = 0 and the final AND output would drop to 0.)

Part B: Simplifying a draft logic diagram using Boolean algebra

Suppose a draft circuit matches the expression: W = (A · B) + (A · NOT B) + C

Built as written, it requires 5 gates (1 NOT gate on B, 2 AND gates, and 2 OR gates). Simplify first with Boolean algebra rules (A1.2.4):

  1. Distributive law (factor A): W = A · (B + NOT B) + C
  2. Complement law (B + NOT B = 1): W = A · 1 + C
  3. Identity law (A · 1 = A): W = A + C

Input B drops out of the expression. The entire 5-gate circuit shrinks down to a single 2-input OR gate taking only A and C, cutting gate count from 5 to 1 while producing identical outputs for all 8 combinations of (A, B, C).

Check your understanding

  1. Which two visual details distinguish the standard NOR gate symbol from an AND gate symbol?
  2. When building a diagram for Y = A · (B ⊕ C), which gate sits closer to the inputs and which gate drives output Y?
  3. Trace Y = NOT(A · B) + (NOT C) for A = 1, B = 1, and C = 1.
  4. Use Boolean algebra to simplify Z = (A · B) + (NOT A · B) and state what single gate replaces the entire 4-gate draft expression.

Common mix-up

It is easy to think: Crossing wires on a logic diagram always share a signal, or AND always sits before OR regardless of parentheses.

Instead, remember: Wires only connect electrically where a junction dot is shown (or at a T-branch); plain crossing wires pass over each other independently. Likewise, always build parenthesized sub-expressions first: in Y = (A + B) · C, the OR gate runs before the AND gate because parentheses override default precedence.

Quick recap

  • Standard ANSI/IEEE gate shapes (AND, OR, NOT, NAND, NOR, XOR, XNOR) use input-edge curves, body geometry, and output inversion bubbles (○) so any diagram reads unambiguously.
  • Construct diagrams left-to-right from inputs, honouring parentheses first and then precedence (NOT, then AND or NAND, then OR, NOR, XOR, or XNOR).
  • Trace diagrams stage-by-stage with labelled intermediate wires (P, Q).
  • Simplifying expressions with Boolean algebra laws before building circuits removes redundant gates, saving components, silicon area, power, cost, and signal propagation delay.

Textbook reading

  • Computer Science (Baumgarten, Ganea, Turland, 2025), A1 Computer fundamentals > A1.2 Data representation and computer logic > A1.2.5 Constructing logic diagrams, Book pp. 65–66 (PDF pp. 75–76).
  • Review the printed distinctive gate symbols and multi-gate step-by-step circuit diagrams on these pages; this original guide does not replace the textbook.

Sources and further learning

  • IB Computer Science Guide (first assessment 2027), A1.2.5 (printed as A.1.2.5 in the Guide): Construct logic diagrams (Guide p. 29; PDF p. 35).
  • Computer Science (Baumgarten, Ganea, Turland, 2025), A1.2.5 Constructing logic diagrams, Book pp. 65–66 (PDF pp. 75–76). All schematics, traces, and simplification examples above are original.
Check your understanding5 questions · 8 marks · 10 min
Take the lesson check
End of A1.2Finished this subtopic? Take the A1.2 review5 questions · 20 marks · 35 min
Take subtopic review
Something not right?