COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • BLOCKY GAMES
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • BLOCKY GAMES
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
HOME    >    IB    >    COMPUTER FUNDAMENTALS
NEXT PAGE >
LOGIC DIAGRAMS
Picture

DATA REPRESENTATION & COMPUTER LOGIC | TRUTH TABLES

DESIGNED FOR IB EXAMINATIONS
OBJECTIVES
A1.2.4 Construct and analyse truth tables.
• Truth tables to predict the output of simple logic circuits
• Truth tables to determine outputs from inputs for a problem description
• Truth tables and their relationship to a Boolean expression, with inputs and outputs
• Truth tables derived from logic diagrams to aid the simplification of logical expressions
• Karnaugh maps and algebraic simplification to simplify output expressions
  • LEARN
  • TERMINOLOGY
  • QUESTIONS
  • FLASHCARDS
  • WORKBOOK
<
>

SECTION 1 | PREDICT SIMPLE LOGIC CIRCUITS

 A truth table is a structured way of showing how a logic circuit behaves for all possible input combinations. Truth tables are used to predict the output of simple logic circuits made from logic gates such as AND, OR, and NOT.

Purpose of Truth Tables
The main purpose of a truth table is to:
  • Systematically test every possible input combination
  • Determine the corresponding output for each combination
  • Verify the behaviour of a logic circuit

Because binary inputs can only be 0 or 1, a truth table guarantees that no possible case is missed.

Structure of a Truth Table
A truth table consists of:
  • One column for each input variable
  • One column for the output
  • Rows representing every possible combination of inputs
For example:
  • A circuit with one input has 2 possible input combinations
  • A circuit with two inputs has 4 possible input combinations
  • A circuit with three inputs has 8 possible input combinations

The number of rows increases exponentially as the number of inputs increases. The truth tables below are simple truth tables to show the output of each gate given each possible input combination.
Picture
NOT GATE TRUTH TABLE
Picture
AND GATE TRUTH TABLE
Picture
OR GATE TRUTH TABLE
Picture
NOR GATE TRUTH TABLE
Picture
XOR TRUTH TABLE
Picture
NAND GATE TRUTH TABLE
Picture
Predicting Outputs Using Logic Gates
To predict the output of a simple logic circuit:
  1. List all possible input combinations in binary order.
  2. Apply the rule of each logic gate to the inputs.
  3. Record the resulting output for each row.
For example:
  • An AND gate outputs 1 only when both inputs are 1.
  • An OR gate outputs 1 when at least one input is 1.
  • A NOT gate outputs the inverse of its input.

By applying these rules row by row, the output of the circuit can be predicted accurately.

Important Student Note: Listing Binary Inputs Correctly
When constructing a truth table, it is essential that input values are listed in the correct binary order.
For two inputs, the correct order is:

00
01
10
11

​The table below illustrated how binary should be listed, note the pattern - column D is 0101 and so on, column C is 001100 and so on, column B is 00001111 and so on. By noting this pattern, you can quickly check if you have listed your binary in the correct order and not missed any combinations. If you fail to list in the correct order, then your answer will most likely be marked as wrong.
Correct Binary Input Order (4 Inputs: A, B, C, D)
RowABCD
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
101010
111011
121100
131101
141110
151111

Quick check patterns: D alternates every row; C changes every 2 rows; B changes every 4 rows; A changes every 8 rows.

Truth Tables for Combined Circuits
Simple logic circuits often contain more than one gate.
  • Intermediate outputs may be calculated for each gate.
  • These intermediate results are then used to determine the final output.
  • The truth table reflects the complete behaviour of the circuit.

This method ensures that even circuits with multiple gates can be analysed in a clear and systematic way.

Importance in Circuit Design and Analysis
Truth tables are important because they:
  • Allow engineers and students to test circuit logic before building hardware
  • Help identify errors in circuit design
  • Provide a clear link between logic gates and circuit behaviour

They are a key tool for understanding how logical decisions are made in digital systems.

Summary
  • Truth tables list all possible input combinations and outputs.
  • They are used to predict the output of logic circuits.
  • Each row represents a unique combination of binary inputs.
  • Truth tables ensure complete and accurate analysis of logic circuits.

Truth tables provide a reliable method for predicting the output of simple logic circuits. By evaluating every possible input combination, they allow the behaviour of digital systems to be fully understood and verified.

SECTION 2 | TRUTH TABLES WITH PROBLEM DESCRIPTIONS

Truth tables are not only used to analyse given logic circuits; they are also a powerful tool for solving problem descriptions. In this context, a problem describes a situation using words, and a truth table is constructed to determine the correct output for every possible input combination.

From Problem Description to Truth Table
When given a problem description, the first step is to identify the inputs and outputs.
  • Inputs are conditions that can be true (1) or false (0).
  • The output represents the result or action based on those conditions.
  • Each input is assigned a variable name (such as A, B, C).
For example, a problem may describe:
  • Two switches controlling a light
  • Conditions that trigger an alarm
  • Rules for granting access
Each condition becomes an input column in the truth table.

Interpreting Logical Conditions
Problem descriptions often use logical language such as:
  • “and”
  • “or”
  • “not”
  • “only if”

These words correspond directly to Boolean operators. Understanding this relationship is essential for determining outputs correctly.

For example:
  • “The alarm sounds if both sensors are active” implies an AND relationship.
  • “The system activates if either condition is true” implies an OR relationship.
  • “The output is true when the input is not true” implies a NOT relationship.

Constructing the Truth Table
To determine outputs from a problem description:
  1. List all possible input combinations in correct binary order.
  2. Interpret the rules described in the problem.
  3. Apply the rules to each row of the table.
  4. Record the output value for each combination.

This ensures that the system’s behaviour is defined for every possible scenario.

Using Truth Tables to Avoid Ambiguity
Problem descriptions can sometimes be unclear or complex. Truth tables help by:
  • Removing ambiguity in logical statements
  • Making assumptions explicit
  • Providing a clear, visual representation of behaviour

If the logic is correct, the truth table will always produce consistent outputs.

Applications in Computer Systems
Truth tables derived from problem descriptions are commonly used in:
  • Control systems
  • Security systems
  • Embedded systems
  • Decision-making logic in software and hardware

They allow designers to test logical rules before implementing them in circuits or programs.

Summary
  • Problem descriptions can be translated into truth tables.
  • Each condition becomes a binary input.
  • Logical language maps directly to Boolean operators.
  • Truth tables define outputs for all input combinations.
  • This approach ensures accuracy and completeness.

Truth tables provide a systematic way to determine outputs from inputs based on a problem description. By translating words into logical rules and applying them consistently, complex decision-making systems can be clearly defined and analysed.

Worked Examples
Truth tables are often constructed from written problem descriptions rather than circuit diagrams. The key skill is translating logical conditions written in everyday language into binary inputs and outputs, then systematically determining the output for every possible input combination.

Example 1: Simple Problem Description (Baby Alarm)
​
Logic gates form the basis of how computers work and they are in most items of technology we use in our everyday lives. By combining logic gates, we can create complex logic circuits to perform an unlimited number of tasks. Here we will look at an example of how logic circuits are used in a baby monitor which uses logic gates to help alert parents when their baby is crying or needs attention.

A logic circuit can be used in a baby monitor to turn on an alarm when either an audio sensor or a motion sensor is triggered, and the monitor is currently switched on.

To create the logic circuit for this, we can use an OR gate to combine the signals from the audio sensor and motion sensor, and an AND gate to ensure the alarm only works when it is actually switched on.
The logic circuit can be expressed as:
  • X = (A OR B) AND C
Where:
  • A represents the signal from the audio sensor
  • B represents the signal from the motion sensor
  • C represents the signal from the switch
  • X represents the output signal that triggers the alarm

In this circuit, the OR gate outputs a high signal when both A or B inputs are high. This means that the alarm will be triggered when either the audio sensor or motion sensor detect activity.
​

The AND gate then combines this result with the switch signal, which allows the user to turn the monitor on and off. This means that the alarm will not be triggered if the switch is turned off, even if both the audio sensor and motion sensor detect activity.
​
By using logic gates to combine the signals from multiple sensors and a switch, we can create a circuit that triggers an alarm only when specific conditions are met, making the baby monitor more reliable and effective.

​The truth table for the logic expression for the baby monitor would be as follows:
Picture
The logic circuit for the baby monitor would be as follows:
Picture
Remember to list binary in a logical order when completing your truth table.  Listing binary in a logical order is important when completing truth tables because it helps to ensure that all possible combinations of inputs are considered and that the resulting outputs are accurate. In a truth table, the binary digits represent the possible combinations of input values for the logic circuit being analysed.
​

By listing the binary in a logical order, such as in ascending or descending order, it makes it easier to identify all possible combinations of input values without missing any or repeating any. This ensures that the truth table is complete and accurate, which is essential for analysing the behaviour of the logic circuit.
Additionally, listing binary in a logical order helps to maintain consistency and clarity throughout the truth table, which makes it easier to read and interpret the results. It also helps to avoid errors or confusion when analysing the circuit or designing a new circuit based on the truth table.
Example 2: Building Security System
A building security system activates an alert if:
  • The system is armed, and
Either:
  • A window sensor is triggered, or
  • A motion sensor is triggered and it is outside office hours
Example 2: Building Security Alert Truth Table
Alert activates if A AND (B OR (C AND D))
A: Armed, B: Window triggered, C: Motion triggered, D: Outside office hours
ABCDAlert
00000
00010
00100
00110
01000
01010
01100
01110
10000
10010
10100
10111
11001
11011
11101
11111
Inputs are listed in binary order from 0000 to 1111 (D alternates every row).

SECTION 3 | THE ROLE OF LOGIC GATES

Truth tables and Boolean expressions are two different ways of describing the same logical behaviour. A truth table shows how outputs change for every possible input combination, while a Boolean expression provides a compact algebraic representation of that behaviour.

Logic gate circuits can be expressed with an algebraic expression. Whilst there are various ways to represent each logic gate, this section will look at the following gate representations.

  • NOT Gate (represented with Ā)
  • OR Gate (represented with A + B)
  • NOR Gate
  • AND Gate (represented with A x B or A · B)
  • NAND Gate
  • XOR Gate (Represented with ⊕)
​
Why This Relationship Is Important
Understanding the relationship between truth tables and Boolean expressions allows students to:
  • Move between verbal descriptions, algebraic logic, and tabular representations
  • Verify that a logic expression behaves as intended
  • Prepare for logic simplification using algebra or Karnaugh maps

This skill is essential for designing, analysing, and optimising digital systems.

  • Truth tables and Boolean expressions describe the same logic in different forms.
  • Truth tables show all possible input-output combinations.
  • Boolean expressions provide a concise algebraic description.
  • Each row of a truth table corresponds to an evaluation of the expression.
  • Understanding this relationship is key to logic analysis and simplification.

Truth tables and Boolean expressions are closely linked representations of logical behaviour. Mastering the connection between them allows complex logic systems to be analysed, verified, and simplified effectively.
Sample Scenario + Truth Table
How to Convert to a Boolean Expression

Problem description: A school issues an access pass. A student is granted access if the student has a valid ID card and either the student knows the correct PIN or a teacher provides override approval.

Inputs: A = ID card valid, B = PIN correct, C = Teacher override
Output: Access (1 = granted, 0 = denied)

ABCAccess
0000
0010
0100
0110
1000
1011
1101
1111

How to convert a truth table into a Boolean expression

Step 1: Identify the rows where the output is 1.
Step 2: For each output=1 row, write a condition (a “product term”) that matches that row:
- If an input is 1 in that row, use the variable (e.g., A).
- If an input is 0 in that row, use NOT of the variable (e.g., NOT A).
Step 3: Combine all product terms using OR (this forms a “sum of products”).
Step 4: (Optional) Simplify the expression using Boolean algebra or a Karnaugh map.
Applied to this truth table:
Output = 1 at rows: (A,B,C) = (1,0,1), (1,1,0), (1,1,1)

Product terms:
- (1,0,1) → A AND (NOT B) AND C
- (1,1,0) → A AND B AND (NOT C)
- (1,1,1) → A AND B AND C

Unsimplified expression (sum of products):
Access = (A AND (NOT B) AND C) OR (A AND B AND (NOT C)) OR (A AND B AND C)

Simplified expression:
Access = A AND (B OR C)
Converting a Truth Table into a Boolean Expression
When given a completed truth table, it is possible to write a Boolean expression that exactly represents the behaviour shown. This skill is essential for analysing logic circuits, checking designs, and preparing for simplification using Boolean algebra or Karnaugh maps.

Step 1: Identify the Input Variables and Output
  • Each column in the truth table represents a binary variable.
  • The final column represents the output of the logic system.
  • Label the inputs clearly (for example, A, B, C).
Before writing any expression, ensure you understand what each input represents and which column is the output.

Step 2: Find the Rows Where the Output Is 1
  • Scan the output column.
  • Identify every row where the output value is 1.
  • Ignore rows where the output is 0.
Only rows with output 1 contribute to the Boolean expression.

Step 3: Write an AND Term for Each Output = 1 Row
For each row where the output is 1:
  • If an input is 1, include the variable (e.g. A).
  • If an input is 0, include the negated variable (e.g. NOT A).
Combine the inputs for that row using AND. Each row produces one AND term that exactly matches that input combination.

Step 4: Combine All AND Terms Using OR
  • Take all AND terms created in Step 3.
  • Join them together using OR.
This creates a sum-of-products Boolean expression that fully represents the truth table. At this stage, the expression is usually unsimplified, but it is logically correct.

Step 5: (Optional) Simplify the Expression
  • The unsimplified expression may contain repeated variables.
  • Boolean algebra rules or Karnaugh maps can be used to simplify it.
  • Simplification does not change behaviour, only the complexity of the expression.

Key Exam Tips
  • Always list inputs in correct binary order before analysing the table.
  • Do not skip rows where the output is 1.
  • Each output=1 row must appear in the expression.
  • Use brackets to clearly show AND groupings.
  • Simplification should only be done after the correct expression is formed.

Summary
  • Truth tables and Boolean expressions describe the same logic.
  • Only rows with output = 1 are used to build the expression.
  • Each such row becomes an AND term.
  • All terms are joined using OR.
  • The resulting expression can then be simplified if required.

Converting a truth table into a Boolean expression is a systematic process. By carefully translating each output=1 row into an AND term and combining them with OR, any truth table can be accurately represented as a Boolean expression.
Multiple Choice: Unsimplified Expression from a Truth Table
Environmental scenario (smart irrigation):
An irrigation system turns Watering on if the soil is dry and it is not raining, or if a gardener presses a manual override button.

A = Soil is dry    B = Rain detected    C = Manual override
Output = Watering (1 = on, 0 = off)
ABCWatering
0000
0011
0100
0111
1001
1011
1100
1111
Question:
Which option is the correct unsimplified Boolean expression (sum of products) for Watering?
A. (A AND (NOT B)) OR C
B. ((NOT A) AND (NOT B) AND C) OR ((NOT A) AND B AND C) OR (A AND (NOT B) AND (NOT C)) OR (A AND (NOT B) AND C) OR (A AND B AND C)
C. (A AND B) OR C
D. (A AND (NOT B) AND C) OR ((NOT A) AND (NOT B) AND (NOT C))
Producing a Truth Table from a Given Boolean Expression

A Boolean expression provides an algebraic description of how a logical output depends on one or more inputs. To fully understand and verify this behaviour, the expression can be converted into a truth table that shows the output for every possible input combination.

Step 1: Identify All Input Variables
  • Read the Boolean expression carefully.
  • List every distinct variable used (for example, A, B, C).
  • Each variable will become a column in the truth table.
The number of input variables determines how many rows the truth table will have:
  • 2 variables → 4 rows
  • 3 variables → 8 rows
  • 4 variables → 16 rows

Step 2: Set Up the Truth Table Structure
Create a table with:
  • One column for each input variable
  • One column for the output
  • Space for intermediate columns (working space between inputs and output)

List all possible input combinations in correct binary order, starting from all zeros and ending with all ones. Ensuring correct binary ordering is essential for accuracy and exam success.

Step 3: Break Down the Boolean Expression
Before filling in the output column:
  • Identify brackets and operator precedence.
  • Break complex expressions into smaller parts if necessary.
  • Create intermediate columns for sub-expressions.
For example, in the expression:
  • A AND (B OR C)
It is useful to first evaluate B OR C, then apply AND with A.

Step 4: Evaluate the Expression Row by Row
For each row of the truth table:
  1. Substitute the input values into the Boolean expression.
  2. Apply the Boolean operators in the correct order.
  3. Record the final output as 0 or 1.
Use Boolean rules consistently:
  • AND is true only if all inputs are true.
  • OR is true if at least one input is true.
  • NOT inverts the value.

Step 5: Check for Consistency
Once the table is complete:
  • Verify that every row has been evaluated.
  • Check that the output values follow logically from the expression.
  • Look for patterns that match your expectations.

This step helps catch errors in logic or evaluation.

Why This Process Is Important
Creating truth tables from Boolean expressions allows you to:
  • Confirm that an expression behaves as intende
  • Compare different expressions for equivalence
  • Prepare expressions for simplification
  • Analyse logic circuits before implementation

It forms a key link between algebraic logic and practical digital systems.

Exam Tips
  • Always list inputs before calculating outputs.
  • Use intermediate columns for complex expressions.
  • Follow operator precedence carefully.
  • Do not simplify unless explicitly instructed.
  • Show working clearly if intermediate steps are required.

Summary
  • Boolean expressions can be converted into truth tables.
  • All input combinations must be included.
  • Outputs are calculated by evaluating the expression row by row.
  • Intermediate steps improve clarity and accuracy.
  • Truth tables provide a complete view of logical behaviour.

Producing a truth table from a Boolean expression is a systematic and reliable method for analysing logic. By carefully listing inputs, evaluating expressions correctly, and checking results, students can accurately predict the behaviour of digital systems
Worked Example: Boolean Expression → Truth Table (with Intermediate Columns)

Scenario (environmental monitoring):
A conservation system triggers an alert if the protected area is not in maintenance mode and either (the temperature is too high and the humidity is too low) or the smoke sensor is triggered.

A = Temperature too high    B = Humidity too low    C = Smoke detected    D = Maintenance mode

Boolean expression:
Alert = (NOT D) AND ( (A AND B) OR C )

Required intermediate columns:
1) A AND B    2) (A AND B) OR C    3) NOT D
ABCD A AND B (A AND B) OR C NOT D Alert
00000010
00010000
00100111
00110100
01000010
01010000
01100111
01110100
10000010
10010000
10100111
10110100
11001111
11011100
11101111
11111100

Inputs are listed in correct binary order from 0000 to 1111 (A is the slowest-changing input, D alternates every row).

SECTION 4 | LOGIC DIAGRAMS

A logic diagram shows how gates are connected, while a truth table shows how the circuit behaves for every possible input combination. By deriving a truth table from a logic diagram, it becomes easier to identify patterns and simplify the underlying logical expression.

From Logic Diagram to Truth Table
When given a logic diagram, the goal is to determine the output produced for all possible inputs.
To do this:
  • Identify each input in the diagram.
  • Identify each logic gate and its operation.
  • Trace how signals move through the circuit.

Rather than evaluating the entire diagram at once, the circuit should be broken into smaller sections.

Using Intermediate Columns
When deriving a truth table from a logic diagram, intermediate columns are essential.
  • Each logic gate in the diagram corresponds to an intermediate result.
  • An intermediate column is created for the output of each gate.
  • These values are then used to calculate the final output.

This method ensures accuracy and makes complex diagrams manageable.

Constructing the Truth Table
To derive a truth table from a logic diagram:
  1. List all input variables in correct binary order.
  2. Create intermediate columns for each gate in the diagram.
  3. Evaluate each gate row by row.
  4. Use the final gate output as the output column.

This systematic approach mirrors how signals propagate through the circuit.

Using the Truth Table to Simplify Logic
Once the truth table is complete:
  • Rows where the output is 1 can be identified.
  • Patterns in the input combinations can be observed.
  • These patterns often indicate opportunities for simplification.
For example:
  • If the output depends only on one input, others may be redundant.
  • If multiple rows differ by only one variable, terms may be combined.

This insight allows the original logic to be rewritten in a simpler form.

Benefits of This Approach
  • Deriving truth tables from logic diagrams helps students to:
  • Understand the behaviour of a circuit without guessing
  • Verify that a diagram performs the intended function
  • Prepare expressions for algebraic or Karnaugh map simplification

It creates a clear bridge between visual logic diagrams and algebraic logic expressions.

Exam Technique
  • Always convert logic diagrams into truth tables before simplifying.
  • Include intermediate columns for every gate.
  • Look for repeating patterns in the output column.
  • Simplify only after confirming the truth table is correct.

Summary
  • Logic diagrams show structure; truth tables show behaviour.
  • Intermediate columns represent gate outputs.
  • Truth tables derived from diagrams reveal simplification opportunities.
  • This process improves accuracy and clarity in logic analysis.

Deriving a truth table from a logic diagram is a powerful technique for simplifying logical expressions. By translating visual circuits into systematic tables, complex logic can be analysed, verified, and reduced with confidence.
Scenario: Environmental Flood Warning (Logic Diagram → Truth Table)

A flood-warning system triggers an alert if:
- The river level is high OR heavy rain is detected, and
- The system is armed.

Inputs: A = River level high, B = Heavy rain detected, C = System armed
Output: X = Alert

Logic Diagram (Intermediate Output Clearly Labelled)
A B C OR Y = A OR B AND X = Alert

Y is the intermediate output from the OR gate. X is the final output (alert) from the AND gate.

How to Derive the Truth Table from the Logic Diagram

Required method (using intermediate columns)

1) List all inputs (A, B, C) and write all combinations in correct binary order.
2) Create an intermediate column for each gate output. Here: Y = A OR B.
3) Fill in Y row by row using the OR rule.
4) Use Y together with C to calculate the final output: X = Y AND C.
5) Check column patterns to confirm correct ordering before analysing results.
Truth Table (Including Intermediate Column)
ABC Y = A OR B X = Y AND C
00000
00100
01010
01111
10010
10111
11010
11111

The truth table is derived directly from the diagram: calculate Y first, then use Y and C to find X.

SECTION 4 | KARNAUGH MAPS AND SIMPLIFICATION

A Karnaugh map (K-map) is a visual method used to simplify Boolean expressions. It builds directly on truth tables and allows patterns to be identified more easily than using algebra alone. Karnaugh maps are especially useful after a truth table has been derived from a logic diagram, as in the previous flood warning example.

Recap of the Example Logic
From the logic diagram and truth table, the system behaviour was:
  • Y = A OR B (Y is the intermediate)
  • X = Y AND C

Where:
  • A = River level high
  • B = Heavy rain detected
  • C = System armed
  • X = Alert

From the truth table, the output X is 1 for the following input combinations:
Input Combinations Where Output X = 1
A B C X
0111
1011
1111
Purpose of a Karnaugh Map
A Karnaugh map:
  • Uses the same information as a truth table
  • Groups input combinations that differ by only one variable
  • Helps remove redundant variables
  • Produces a simplified Boolean expression

The goal is to find the simplest expression that still gives the same outputs.

Structure of a 3-Variable Karnaugh Map
For three inputs (A, B, C):
  • One variable is placed on one axis
  • The other two variables are combined on the other axis
  • Values are arranged in Gray code order so only one variable changes between adjacent cells

Typical layout:
Typical Layout of a 3-Variable Karnaugh Map
C \ AB 00 01 11 10
0
1
What Is Gray Code Order?
Gray code order is a way of arranging binary values so that only one bit changes between adjacent values.

This property is essential in Karnaugh maps because it ensures that neighbouring cells differ by just one variable, allowing valid grouping and simplification.

Why Gray Code Order Is Used in Karnaugh Maps
In a Karnaugh map:
  • Adjacent cells must differ by only one input variable.
  • This allows cells to be grouped and simplified correctly.
  • Standard binary counting does not always satisfy this condition.

Gray code solves this problem by minimizing bit changes between adjacent values.

Example: Two-Bit Gray Code Order
Standard binary order:
  • 00, 01, 10, 11
Gray code order:
  • 00, 01, 11, 10
Notice that in Gray code order:
  • 00 → 01 (one bit changes)
  • 01 → 11 (one bit changes)
  • 11 → 10 (one bit changes)

This is why Karnaugh map column headings are arranged as 00, 01, 11, 10 instead of standard binary order

Filling the Karnaugh Map

Using the truth table:
  • Place a 1 in each cell where X = 1
  • Leave other cells as 0

For this example, all 1s occur when C = 1 and at least one of A or B is 1.

Grouping the 1s
Rules for grouping:
  • Groups must contain 1, 2, 4, or 8 cells
  • Groups must be rectangular
  • Groups should be as large as possible
  • Groups may wrap around the edges
In this case:
  • The three 1s can be grouped to show that C is always 1
  • Within that group, A or B must be 1

Deriving the Simplified Expression
From the grouping:
  • C remains in the expression
  • A and B appear as an OR condition

This gives the simplified expression:
  • X = C AND (A OR B)

This matches the logic originally shown in the diagram, confirming correctness.

Why Karnaugh Maps Are Useful
Karnaugh maps:
  • Reduce complex expressions efficiently
  • Make simplification visual and systematic
  • Help verify logic derived from diagrams and truth tables
  • Reduce the number of logic gates needed in hardware

They are an essential next step after truth tables when optimising logic.

Exam Technique (IB Focus)
  • Always derive the truth table first
  • Transfer values carefully into the K-map
  • Group the largest possible sets of 1s
  • Write the simplified expression from the groups
  • Check the simplified result matches the original output

Summary
  • Karnaugh maps simplify Boolean expressions visually
  • They are built directly from truth tables
  • Grouping reveals redundant variables
  • The simplified expression preserves the original logic
  • Karnaugh maps bridge truth tables and efficient circuit design​
Check Your Understanding: Karnaugh Maps
Why is Gray code order used when laying out a Karnaugh map?
A. To allow binary numbers to be counted more quickly
B. To ensure that adjacent cells differ by only one input variable
C. To reduce the number of rows in a truth table
D. To replace Boolean algebra when simplifying expressions
Fill a 3-Variable Karnaugh Map

Scenario (Flood warning): An alert output X becomes 1 when the system is armed and either the river is high or heavy rain is detected.
Inputs: A (river high), B (heavy rain), C (armed)

Task: Use the information below to place 1s in the correct Karnaugh map cells. Click a cell to toggle between 0 and 1. Then press Check.

Given information (where X = 1)

From the truth table, X = 1 for these input combinations:

ABCX
0111
1011
1111
K-map layout reminder:
Columns use Gray code order for AB: 00, 01, 11, 10.
Rows are C: 0 (top), 1 (bottom).

Interactive Karnaugh Map (Click Cells)

Set the correct cells to 1. All other cells should remain 0.

C \ AB 00011110
0 0 0 0 0
1 0 0 0 0
Hint: Convert each (A,B,C) combination into a K-map position using AB for columns and C for rows.
Truth Table | A table that lists all possible combinations of binary inputs and shows the corresponding output for each combination.

Input Variable | A binary value (0 or 1) that represents a condition or signal entering a logic circuit.

Output | The result produced by a logic circuit or Boolean expression for a given set of input values.

Logic Circuit | A system of interconnected logic gates that processes binary inputs to produce a binary output.

Logic Diagram | A graphical representation of a logic circuit showing inputs, logic gates, intermediate connections, and outputs.

Intermediate Output (Intermediate Column) |
A value produced by a logic gate within a circuit that is not the final output. Intermediate outputs are used as inputs to later gates and must be included when constructing truth tables.

Boolean Expression | An algebraic expression that represents logical relationships using variables and Boolean operators such as AND, OR, and NOT.

Boolean Operator | A logical operation applied to binary values. Common operators include AND, OR, and NOT.

AND | A Boolean operator that produces an output of 1 only when all inputs are 1.

OR | A Boolean operator that produces an output of 1 when at least one input is 1.

NOT | A Boolean operator that inverts the input value (0 becomes 1, and 1 becomes 0).

Sum of Products | A Boolean expression formed by OR-ing together multiple AND terms, each corresponding to a row in a truth table where the output is 1.

Binary Order | The standard sequence used to list input combinations in a truth table (for example: 000, 001, 010, 011, 100, 101, 110, 111).

Gray Code Order | A method of ordering binary values so that only one bit changes between adjacent values. Gray code order is used in Karnaugh maps.

Karnaugh Map (K-map) | A visual tool used to simplify Boolean expressions by grouping adjacent cells that represent input combinations producing an output of 1.

Cell (Karnaugh Map) | An individual square in a Karnaugh map that represents a specific combination of input values.

Grouping | The process of combining adjacent 1s in a Karnaugh map to eliminate redundant variables and simplify a Boolean expression.

Simplification | The process of reducing a Boolean expression to its simplest form without changing its logical behaviour.

Redundant Variable | A variable that can be removed from a Boolean expression without affecting the output.

Truth Table Derivation | The process of creating a truth table from a Boolean expression or a logic diagram.

Expression Derivation | The process of creating a Boolean expression from a truth table by identifying rows where the output is 1.

Gray Code Adjacency | The property that allows Karnaugh map cells to be considered adjacent when they differ by only one input variable, including across map edges.
Picture
Question 1: Predicting Output of a Simple Logic Circuit
The circuit below computes an output X using two inputs A and B.

Circuit rule: First compute NOT A, then compute (NOT A) OR B.

Which truth table output column for X is correct (rows ordered as A,B = 00, 01, 10, 11)?
A B NOT OR X
Question 2: Problem Description → Output Column
Environmental scenario (air quality warning):
A city displays an Air Warning (output X = 1) if:
- Pollution is high (A = 1) and it is not windy (B = 0), or
- An emergency override is activated (C = 1).

Inputs: A = Pollution high, B = Windy, C = Emergency override
Output: X = Air Warning

Choose the correct output column for X
RowABC
0000
2001
2010
3011
4100
5101
6110
7111
Question 3: Boolean Expression → Truth Table

Click the output column cells to toggle between 0 and 1. Use the expression and intermediate columns to determine the correct outputs.

Boolean expression:
X = (A AND B) OR (NOT C)
Row A B C AND NOT X
0000010
1001000
2010010
3011000
4100010
5101000
6110110
7111100
Question 4: Logic Diagram → Truth Table Output

Task: Use the logic diagram to decide which rows should have output X = 1. Click the output cells to toggle between 0 and 1. Then press Check.
The intermediate for NOT output labelled Z and the AND output labelled Y.

A B C NOT AND OR X X = Y OR C
Row A B C NOT AND) X
1000100
2001100
3010000
4011000
5100110
6101110
7110000
8111000
Question 5: Karnaugh Map Filling and Grouping → Simplified Expression

Task: Complete the Karnaugh map for output X using the given truth-table information, then identify the main group of 1s by selecting cells, and finally choose the simplified expression.

Gray code column order: AB = 00, 01, 11, 10    Row: C = 0 (top), C = 1 (bottom)

Given (from truth table)

X = 1 for these (A,B,C) combinations:
(0,1,1), (1,0,1), (1,1,1)

Step 1: Place 1s in the K-map cells that match these combinations. Leave all others as 0.
Step 2: Click K-map cells containing 1s to select a group (try to make the group as large as possible).

Interactive Karnaugh Map (Click to Toggle 0/1, then Select Group)

First toggle cells to set the correct 1s. Then click again on 1-cells to mark them as a group (dashed highlight).

C \ AB 00011110
0 0 0 0 0
1 0 0 0 0
Grouping tip: Groups must be rectangular and contain 1, 2, or 4 cells. You may group adjacent 1s in the same row.

Choose the simplified expression

After grouping, choose the simplest expression that matches the K-map.

COMING SOON
Picture
A1.1 COMPUTER HARDWARE AND OPERATION
    ☐  1.1.1 FUNCTIONS OF THE CPU
    ☐ 1.1.2 ROLE OF THE GPU
    ☐ 1.1.3 CPU VS GPU
    ☐ 1.1.4 PURPOSE AND TYPES OF PRIMARY MEMORY
    ☐ 1.1.5 FETCH, DECODE AND EXECUTE CYCLE
    ☐ 1.1.6 PIPELINING IN MULTICORE ARCHITECTURES
    ☐ 1.1.7 SECONDARY MEMORY STORAGE
    ☐ 1.1.8 CONCEPTS OF DATA COMPRESSION
    ☐ 1.1.9 CLOUD COMPUTING

A1.2 DATA REPRESENTATION AND COMPUTER LOGIC
    ☐  1.2.1 REPRESENTING DATA
    ☐ 1.2.2 HOW BINARY IS USED TO STORE DATA
    ☐ 1.2.3 LOGIC GATES
    ➩ 1.2.4 TRUTH TABLES, CIRCUITS, EXPRESSIONS AND K MAPS
    ☐  1.2.5 LOGIC CIRCUIT DIAGRAMS - COMING SOON

A1.3 OPERATING SYSTEMS AND CONTROL SYSTEMS
    ☐  1.3.1 ROLE OF OPERATING SYSTEMS
    ☐ 1.3.2 FUNCTIONS OF OPERATING SYSTEMS
    ☐ 1.3.3 APPROACHES TO SCHEDULING
    ☐ 1.3.4 INTERUPT HANDLING
    ☐ 1.3.5 MULTITASKING
    ☐ 1.3.6 CONTROL SYSTEM COMPONENTS
    ☐ 1.3.7 CONTROL SYSTEM APPLICATIONS
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.