Constructing logic diagrams
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, andXNOR. - 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
| Term | Simple meaning |
|---|---|
| Logic diagram | A schematic drawing using standard gate symbols and signal wires to show how inputs are combined to produce an output. |
| Standard gate symbol | The recognized geometric shape (such as D-shaped AND, shield-shaped OR, or triangle NOT) identifying a logic gate in circuit diagrams. |
| Inversion bubble | A 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 dot | A solid dot showing where one wire splits to feed multiple gate inputs; crossing wires without a dot are not connected. |
| Propagation delay | The 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.
| Gate | Input back & extra lines | Body outline | Output tip | Distinguishing visual clue |
|---|---|---|---|---|
AND | Flat vertical back line | Rounded D-shaped front | Plain line (no bubble) | Flat back + curved D-front. |
NAND | Flat vertical back line | Rounded D-shaped front | Small bubble (○) | AND shape + output bubble (NOT AND). |
OR | Inward-curved back edge | Pointed curved front | Plain line (no bubble) | Concave curved back meeting at a point. |
NOR | Inward-curved back edge | Pointed curved front | Small bubble (○) | OR shape + output bubble (NOT OR). |
XOR | Inward-curved back plus a second curved arc just behind it | Pointed curved front | Plain line (no bubble) | OR shape + extra parallel input arc. |
XNOR | Inward-curved back plus a second curved arc just behind it | Pointed curved front | Small bubble (○) | XOR shape + output bubble. |
NOT | Single input into flat triangle base | Pointed triangle | Small 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:
- 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. - Build inside parentheses first: Respect standard operator precedence (
NOT, thenANDorNAND, thenOR,NOR,XOR, orXNOR):- Connect any
NOTinputs throughNOTgates first. - Connect
AND/NANDsub-expressions next. - Connect
OR/NOR/XOR/XNORsub-expressions next.
- Connect any
- Label intermediate wires: Name internal wires (
P,Q) whenever useful to avoid crossed or confusing lines. - Combine into the outermost gate(s): Connect the intermediate wires into the final gate(s) to drive the labelled output (
YorX).
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:
- Identify each gate nearest the inputs (
A,B,C) and label its output wire with a short Boolean sub-expression (P,Q). - Move stage by stage toward the output, substituting earlier sub-expressions as inputs into downstream gates until reaching final output
Y. - To trace a specific test case (such as
A = 1, B = 0, C = 1), write the0or1directly 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.
- Identify inputs: Draw input rails
A,B, andCon the left. - Inner expression 1 (
(A + B)): FeedAandBinto a 2-inputORgate to create intermediate wireP = A + B. - Inner expression 2 (
(NOT C)): FeedCinto a 1-inputNOTgate to create intermediate wireQ = NOT C. - Outer expression (
P · Q): Connect intermediate wiresPandQinto a final 2-inputANDgate to outputY.
| Stage | Gate | Inputs | Output wire and expression |
|---|---|---|---|
| Stage 1 (Inner) | OR | A, B | P = A + B |
| Stage 1 (Inner) | NOT | C | Q = NOT C |
| Stage 2 (Outer) | AND | P, Q | Y = (A + B) · (NOT C) |
- 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. (IfCchanged to1, thenQ = 0and the finalANDoutput would drop to0.)
- Gate 1 (
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):
- Distributive law (factor
A):W = A · (B + NOT B) + C - Complement law (
B + NOT B = 1):W = A · 1 + C - 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
- Which two visual details distinguish the standard
NORgate symbol from anANDgate symbol? - When building a diagram for
Y = A · (B ⊕ C), which gate sits closer to the inputs and which gate drives outputY? - Trace
Y = NOT(A · B) + (NOT C)forA = 1,B = 1, andC = 1. - 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, thenANDorNAND, thenOR,NOR,XOR, orXNOR). - 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.5in 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.