A1.2.5 — Logic Diagrams
What is a Logic Diagram?
A logic diagram is a visual representation of connected logic gates showing how inputs are processed to produce an output. They are read left to right. They can be directly transposed into electronic circuits — they are blueprints for physical circuits.
- Inputs enter from the left — labelled with letters (A, B, C) or descriptive names.
- Output leaves from the right — always labelled Q.
- A dot on a wire means it connects to every gate it touches.
- Each gate's output can become the input to the next gate.
Building a Diagram from a Problem
- Identify all inputs and label them.
- Identify the output Q.
- Translate the logical conditions into gate operations.
- Draw gates and connect them left to right.
Karnaugh Maps (K-maps)
A visual method for simplifying Boolean expressions. Instead of algebraic manipulation, you group 1s on a grid and read off the simplified terms.
What you need to know
- K-maps work with up to 4 inputs. IB typically uses 2 or 3.
- Row and column labels use Gray code — adjacent cells differ by exactly 1 bit: 00 → 01 → 11 → 10. This is NOT binary order.
- Fill each cell with the Q value from your truth table for that combination of inputs.
- Group only the 1s. Groups must be rectangles of size 1, 2, 4, or 8 (powers of 2 only).
- Make each group as large as possible — bigger group means fewer variables and a simpler expression.
- Groups can overlap and can wrap around edges — treat the map as if the top joins the bottom and the left joins the right.
- Every 1 must be in at least one group. No 0s allowed in a group.
- For each group: variables that stay constant across the whole group are kept. Variables that change within the group are dropped.
- OR all group terms together to get your simplified expression.
K-map layout (3 inputs: A, B, C)
| BC \ A | A=0 | A=1 |
|---|---|---|
| BC=00 | row 0 | row 1 |
| BC=01 | row 2 | row 3 |
| BC=11 | row 6 | row 7 |
| BC=10 | row 4 | row 5 |
Each cell number is the minterm from your truth table. Fill it with the Q value for that row.
Practice Exercises
Truth table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Fill the K-map and identify groups:
| B \ A | A=0 | A=1 |
|---|---|---|
| B=0 | ? | ? |
| B=1 | ? | ? |
| B \ A | A=0 | A=1 |
|---|---|---|
| B=0 | 0 | 1 |
| B=1 | 1 | 1 |
- Bottom row group (B=1, both A values): B stays 1, A changes → term is B
- Right column group (A=1, both B values): A stays 1, B changes → term is A
Truth table:
| A | B | C | Q |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Fill the K-map and simplify:
| BC \ A | A=0 | A=1 |
|---|---|---|
| BC=00 | 0 | 0 |
| BC=01 | 1 | 1 |
| BC=11 | 1 | 1 |
| BC=10 | 0 | 0 |
- Group of 4 (rows BC=01 and BC=11): C stays 1 throughout, A and B both change → drop A and B
Q = 1 for minterms 0, 1, 4, 5. Fill the K-map and find the simplified expression.
| BC \ A | A=0 | A=1 |
|---|---|---|
| BC=00 | 1 | 1 |
| BC=01 | 1 | 1 |
| BC=11 | 0 | 0 |
| BC=10 | 0 | 0 |
- Group of 4 (top two rows): B stays 0 throughout, A and C both change → drop A and C
To remember:
- Logic diagrams: always read left to right. Label output Q. Show intermediate gate outputs when constructing truth tables.
- K-maps: row order is Gray code — 00, 01, 11, 10. Not sequential. This trips people up.
- K-map groups must be powers of 2 in size. Bigger groups give a simpler expression.
- Groups can wrap around edges of the K-map — treat it as if the edges connect.