20 min read
From Expression to Circuit Diagram
Break an expression into parts, draw the gates in the right order, and check with a truth table.
The Order of Operations
Boolean algebra has an order, like BODMAS in maths:
- Brackets first.
- NOT next.
- AND next.
- OR last.
So in you do NOT C first, then B AND (NOT C), and finally A OR that result.
Drawing Method
- Write the inputs down the left of the page, one line each.
- Draw a NOT gate for every letter that has a bar.
- Draw the AND gates (and anything in brackets).
- Draw the final OR (or whatever operation is done last) on the right.
- Label each gate output and check it matches the expression.
X = 0
| A | B | C | P | R | X |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 1 | 1 |
Try it: Check that X = 1 whenever C = 1 and (A = 1 or B = 0).
X = 0
| A | B | C | P | R | S | X |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 | 1 | 0 | 1 |
Try it: When A = 1 the output copies B; when A = 0 it copies C. (This circuit is called a multiplexer — it chooses between two inputs.)
Practice
In X = A + B · C̄, which operation is done first?
More lessons in Boolean Algebra and Logic Gates · Next: The Laws of Boolean Algebra · Previous: From Circuit Diagram to Boolean Expression
