You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
A key skill for OCR J277 Section 2.5 is the ability to derive a Boolean expression from a truth table. This means looking at a truth table and writing the algebraic expression that describes when the output is 1. This lesson teaches you a systematic method for doing this.
The most reliable method for deriving a Boolean expression from a truth table is called the sum of products (SOP) method. Here is the step-by-step process:
Consider this truth table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Step 1: Identify rows where Q = 1:
Step 2: Write product terms:
Step 3: Combine with OR:
This is the Boolean expression for XOR — which makes sense, as the truth table matches XOR.
OCR Exam Tip: The sum of products method always works, even for complex truth tables. It may not give the simplest expression, but it will always give a correct one.
| 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 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Step 1: Rows where Q = 1: rows 2, 4, 7, 8.
Step 2: Product terms:
Step 3: Combine with OR:
This expression is correct but can be simplified (covered in the next lesson).
You may also be asked to construct a truth table from a Boolean expression. The process is reversed:
| A | B | NOT B | A AND (NOT B) |
|---|---|---|---|
| 0 | 0 | 1 | 0 AND 1 = 0 |
| 0 | 1 | 0 | 0 AND 0 = 0 |
| 1 | 0 | 1 | 1 AND 1 = 1 |
| 1 | 1 | 0 | 1 AND 0 = 0 |
In the exam, you may see expressions written in formal notation:
| English | Algebraic notation |
|---|---|
| A AND B | A . B or AB |
| A OR B | A + B |
| NOT A | Ā (bar over A) |
| A XOR B | A ⊕ B |
So the expression (NOT A) AND B OR A AND (NOT B) could also be written as:
Q = ĀB + AB̄
OCR Exam Tip: In the exam, you can use either English (AND, OR, NOT) or algebraic notation (., +, bar). Be consistent within your answer. If you use algebraic notation, make sure your bars are clearly drawn over the correct variables.
The full SOP method is a fixed sequence: scan rows, write product terms, OR them. The flow below captures the routine you should follow on every "write an expression for this truth table" question.
flowchart TD
TT[Truth table] --> SCAN[Scan every row]
SCAN --> CHK{Is Q = 1?}
CHK -->|No| NEXT[Skip - move to next row]
CHK -->|Yes| BUILD[Build a product term: variable as-is for input 1, NOT variable for input 0]
BUILD --> NEXT
NEXT --> END{All rows checked?}
END -->|No| SCAN
END -->|Yes| OR[Combine all product terms with OR]
OR --> SOP[Sum-of-products expression]
SOP --> SIMP[Optional: simplify with Boolean laws]
Derive the Boolean expression from this truth table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Solution:
Q = ((NOT A) AND (NOT B)) OR (A AND (NOT B)) OR (A AND B)
This simplifies to Q = (NOT B) OR A (which you can verify by checking all rows).
A bike lock opens (Q = 1) when you enter the correct digit on at least two of three dials. Let A, B, C represent whether each dial is correct (1 = correct).
Build the truth table first by asking "is at least two of A, B, C equal to 1?":
| A | B | C | Q |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Now apply sum of products. Q = 1 in four rows. Write a product term for each:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.