Digital Logic
Boolean Algebra

Boolean Algebra and Logic Circuits

Boolean algebra is a branch of algebra that deals with binary variables and logic operations. The variables in Boolean algebra are typically designated by letters such as A, B, x, and y. The three fundamental logic operations in Boolean algebra are AND, OR, and complement (NOT). A Boolean function can be expressed algebraically using binary variables, logic operation symbols, parentheses, and the equal sign. For a given set of variable values, the Boolean function evaluates to either 1 (true) or 0 (false).

Truth Table Generator

Properties of Boolean Algebra

Commutative Property

P1a. a+b=b+aa + b = b + a

P1b. ab=baab = ba

Note that the values for both OR and AND are the same for the second and third lines of the truth table. This is known as the commutative property. It seems obvious because it holds for addition and multiplication, which use the same notation. However, it needs to be stated explicitly, because it is not true for all operators in all algebras. (For example, abbaa - b \neq b - a in ordinary algebra. There is no subtraction operation in switching algebra.)

Associative Property

P2a. a+(b+c)=(a+b)+ca + (b + c) = (a + b) + c

P2b. a(bc)=(ab)ca(bc) = (ab)c

This property, known as the associative law, states that the order in which one does the OR or AND operation doesn’t matter, and thus we can write just a+b+ca + b + c and abcabc (without the parentheses). It also enables us to talk of the OR or AND of several things. We can thus extend the definition of OR to:

a+b+c+d+a + b + c + d + \cdots

is 1 if any of the operands (a,b,c,d,a, b, c, d, \ldots) is 1 and is 0 only if all are 0.

and the definition of AND extends to:

abcdabcd \cdots

is 1 if all of the operands are 1 and is 0 if any is 0.

Identity Property

P3a. a0=0a \cdot 0 = 0

P3b. a+1=1a + 1 = 1

Properties 3a and 3b follow directly from the first and third lines of the truth tables.

Null Property

P4a. a1=aa \cdot 1 = a

P4b. a+0=aa + 0 = a

Properties 4a and 4b follow from the second and fourth lines of the truth tables.

Complement Property

P5a. aa=0a \cdot \overline{a} = 0

P5b. a+a=1a + \overline{a} = 1

Property 5 follows from the definition of the NOT operation, which states that either aa or a\overline{a} is always 1, and the other is always 0. Thus, aaa \cdot \overline{a} must be either 010 \cdot 1 or 101 \cdot 0, both of which are 0. Similarly, a+aa + \overline{a} must be either 0+10 + 1 or 1+01 + 0, both of which are 1.

Combined Properties

Combining the commutative property (P1a) with the above properties, we also have:

P3aa. 0a=00 \cdot a = 0

P3bb. 1+a=11 + a = 1

P4aa. 1a=a1 \cdot a = a

P4bb. 0+a=a0 + a = a

P5aa. aa=0\overline{a} \cdot a = 0

P5bb. a+a=1\overline{a} + a = 1

Often, as we manipulate expressions, we will use one of these versions, rather than first interchanging the terms using the commutative law (P1).

Idempotency Property

P6a. a+a=aa + a = a

P6b. aa=aa \cdot a = a

By repeated application of Property 6a, we can see that:

a+a+a++a=aa + a + a + \cdots + a = a

Involution Property

P7. (a)=a\overline{(\overline{a})} = a

If a=0a = 0, then a=1\overline{a} = 1. However, when that is complemented again, that is, (0)=1=0=a\overline{(\overline{0})} = \overline{1} = 0 = a. Similarly, if a=1a = 1, a=0\overline{a} = 0 and (1)=1\overline{(\overline{1})} = 1. Because there are no ANDs, ORs, 0’s, or 1’s, the dual is the same property.

Distributive Property

P8a. a(b+c)=ab+aca(b + c) = ab + ac

P8b. a+(bc)=(a+b)(a+c)a + (bc) = (a + b)(a + c)

P8a looks very familiar; we commonly use it with addition and multiplication. In right-to-left order, it is referred to as factoring. On the other hand, P8b is not a property of regular algebra. The simplest way to prove these properties of switching algebra is to produce a truth table for both sides of the equality and show that they are equal.

Example Boolean Function

Consider the Boolean function:

F=x+yzF = x + y'z

Truth Table

To understand how this function behaves, we can construct a truth table. A truth table lists all possible combinations of input variables and the corresponding output of the Boolean function. For three variables (x, y, and z), there are 23=82^3 = 8 possible combinations.

xyzy'y'zx + y'zF
0001000
0011111
0100000
0110000
1001011
1011111
1100011
1110011

From the truth table, we see that the function FF is equal to 1 if xx is 1 or if both yy' and zz are 1. Therefore, FF is equal to 0 in all other cases.

Logic Diagram

A Boolean function can also be represented as a logic diagram composed of AND, OR, and NOT gates. The logic diagram for the function F=x+yzF = x + y'z is shown below:

  1. An inverter (NOT gate) is used to generate yy' from the input yy.
  2. An AND gate is used to generate the term yzy'z.
  3. An OR gate combines the term xx and yzy'z to produce the final output FF.

Purpose of Boolean Algebra

Boolean algebra simplifies the analysis and design of digital circuits. It provides tools to:

  1. Express the relationship between binary variables and outputs in algebraic form.
  2. Derive the input-output relationships from logic diagrams.
  3. Simplify Boolean expressions to create more efficient digital circuits.

Simplification Using Boolean Algebra

A Boolean function can be expressed in various algebraic forms. By applying Boolean algebra rules, we can simplify these expressions to reduce the number of gates required in a circuit.

Basic Identities of Boolean Algebra

Table 1-1 lists the fundamental identities of Boolean algebra. Each identity can be proven using truth tables.

Identity No.ExpressionDescription
1x+0=xx + 0 = xOR with 0 leaves the variable unchanged.
2x0=0x \cdot 0 = 0AND with 0 results in 0.
3x+1=1x + 1 = 1OR with 1 results in 1.
4x1=xx \cdot 1 = xAND with 1 leaves the variable unchanged.
5x+x=xx + x = xA variable ORed with itself is unchanged.
6xx=xx \cdot x = xA variable ANDed with itself is unchanged.
7x+x=1x + x' = 1A variable ORed with its complement is 1.
8xx=0x \cdot x' = 0A variable ANDed with its complement is 0.
9x+y=y+xx + y = y + xOR operation is commutative.
10xy=yxx \cdot y = y \cdot xAND operation is commutative.
11x+(y+z)=(x+y)+zx + (y + z) = (x + y) + zOR operation is associative.
12x(yz)=(xy)zx \cdot (y \cdot z) = (x \cdot y) \cdot zAND operation is associative.
13x(y+z)=xy+xzx \cdot (y + z) = xy + xzDistributive property of AND over OR.
14x+yz=(x+y)(x+z)x + yz = (x + y)(x + z)Distributive property of OR over AND.
15(x+y)=xy(x + y)' = x' \cdot y'DeMorgan's Theorem.
16(xy)=x+y(x \cdot y)' = x' + y'DeMorgan's Theorem.
17(x)=x(x')' = xDouble negation results in the original variable.

Example Simplification

Consider the following Boolean expression:

AB+CD+AB+CDAB' + C'D + AB' + C'D

By letting x=AB+CDx = AB' + C'D, the expression becomes x+xx + x. Using identity 5 from Table 1-1, x+x=xx + x = x. Thus, the expression simplifies to:

AB+CDAB' + C'D

DeMorgan's Theorems

DeMorgan's Theorems are crucial for simplifying expressions involving NOR and NAND gates. They state:

  1. (x+y)=xy(x + y)' = x' \cdot y'
  2. (xy)=x+y(x \cdot y)' = x' + y'

Proof of the First Theorem

  1. Expression of the original theorem: (x+y)(x + y)'

  2. Apply the definition of the complement (NOT operation): (x+y)=x+y(x + y)' = \overline{x + y}

  3. Using the definition of OR operation: x+y means that neither x nor y is true\overline{x + y} \text{ means that neither } x \text{ nor } y \text{ is true}

  4. Expressing in terms of AND operation: x+y=xy\overline{x + y} = \overline{x} \cdot \overline{y}

  5. Using the complement (NOT) of each variable: x=x and y=y\overline{x} = x' \text{ and } \overline{y} = y'

  6. Combining these results: (x+y)=xy(x + y)' = x' \cdot y'

Proof of the Second Theorem

  1. Expression of the original theorem: (xy)(x \cdot y)'

  2. Apply the definition of the complement (NOT operation): (xy)=xy(x \cdot y)' = \overline{x \cdot y}

  3. Using the definition of AND operation: xy means that at least one of x or y is false\overline{x \cdot y} \text{ means that at least one of } x \text{ or } y \text{ is false}

  4. Expressing in terms of OR operation: xy=x+y\overline{x \cdot y} = \overline{x} + \overline{y}

  5. Using the complement (NOT) of each variable: x=x and y=y\overline{x} = x' \text{ and } \overline{y} = y'

  6. Combining these results: (xy)=x+y(x \cdot y)' = x' + y'

Verification with Truth Tables

To verify these theorems, we can use truth tables:

First Theorem: (x+y)=xy(x + y)' = x' \cdot y'

xxyyx+yx + y(x+y)(x + y)'xx'yy'xyx' \cdot y'
0001111
0110100
1010010
1110000

Second Theorem: (xy)=x+y(x \cdot y)' = x' + y'

xxyyxyx \cdot y(xy)(x \cdot y)'xx'yy'x+yx' + y'
0001111
0101101
1001011
1110000

From the truth tables, we can see that (x+y)=xy(x + y)' = x' \cdot y' and (xy)=x+y(x \cdot y)' = x' + y' hold true for all possible values of xx and yy, verifying DeMorgan's Theorems.

These theorems allow the transformation of NOR and NAND gates into equivalent AND-OR gates and vice versa.

Example: Logic Diagram Simplification

Consider the logic diagram with the output expression:

F=ABC+ABC+ACF = ABC + ABC' + A'C

Using Boolean algebra, we can simplify this expression:

F=ABC+ABC+ACF = ABC + ABC' + A'C F=AB(C+C)+ACF = AB(C + C') + A'C F=AB1+ACF = AB \cdot 1 + A'C F=AB+ACF = AB + A'C

The simplified logic diagram requires fewer gates, making the circuit more efficient.

Complement of a Function

The complement of a Boolean function is derived by interchanging 1s and 0s in the truth table or by applying DeMorgan's theorem to the algebraic expression. For instance, the complement of F=AB+CD+BDF = AB + C'D + B'D is:

F=(A+B)(C+D)(B+D)F' = (A' + B')(C + D)(B + D')

This is achieved by changing ANDs to ORs, ORs to ANDs, and complementing each variable.

Boolean algebra, therefore, provides a systematic approach to design and optimize digital circuits, ensuring efficient and effective implementation.