Create and complete truth tables from logic expressions or circuits

Resources | Subject Notes | Computer Science

Boolean Logic - Truth Tables

This section covers the fundamental concepts of Boolean logic, focusing on constructing and completing truth tables. Truth tables are a crucial tool for understanding and simplifying logical expressions and analyzing digital circuits.

Basic Boolean Operators

The core Boolean operators are:

  • AND ($ \land $): The output is true only if both inputs are true.
  • OR ($ \lor $): The output is true if at least one input is true.
  • NOT ($ eg$): The output is the logical inverse of the input (true becomes false, and vice versa).

Constructing Truth Tables

To construct a truth table, you need to consider all possible combinations of input values for a given number of inputs. The number of rows in the truth table is 2n, where 'n' is the number of inputs.

Here's the general format:

Input A Input B Output (A AND B)
0 0 $ eg ( eg A \land eg B)$
0 1 $ eg ( eg A \land B)$
1 0 $ (A \land eg B)$
1 1 $ (A \land B)$

Example 1: Truth Table for (A AND B)

Let's create a truth table for the expression (A AND B). We have two inputs, A and B, so we need 22 = 4 rows.

A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

Example 2: Truth Table for (A OR B)

Now, let's create a truth table for the expression (A OR B). Again, we have two inputs, A and B, so we need 22 = 4 rows.

A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1

Example 3: Truth Table for (NOT A)

Let's create a truth table for the expression (NOT A). We have one input, A, so we need 21 = 2 rows.

A NOT A
0 1
1 0

Completing Truth Tables from Logic Expressions

You can often deduce the truth table for a logic expression directly from the expression itself. For example, consider the expression: $ eg (A \lor B) $.

Using De Morgan's Laws, we can rewrite this as: $ eg A \land eg B $.

The truth table for $ eg A \land eg B $ is:

A B NOT A NOT B NOT A AND NOT B
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 0 0 0

Truth Tables for Circuits

Truth tables are also used to analyze digital circuits. By understanding the logic expression implemented by a circuit, you can construct its truth table.

Suggested diagram: A simple AND gate circuit.

Practice

Practice constructing truth tables for more complex Boolean expressions. This is a fundamental skill for understanding digital logic.