MCS-212 · Block 1 Unit 3

Boolean Algebra and Circuits

Section 4 of 6

Block 1 · Unit 3Boolean Algebra and Circuits10 min · Section 4 of 6

3.4Boolean functions and equivalent expressions

Covers IGNOU MCS-212 §3.4 (Boolean functions, Examples 9, E10–E11)

A logic table tells us what a circuit does, not how it is wired. Two very different circuits can do exactly the same job. To talk about “the job” itself we use Boolean functions; two expressions are equivalent when they compute the same function.

There are 2k2^k input rows, and each row can have output 0 or 1, so there are 22k2^{2^k} different Boolean functions of kk variables (16 functions of 2 variables, 256 of 3 variables).

Equivalent expressions give circuits that do the same job, so we may always replace a circuit by a simpler equivalent one.

Checking equivalence with a program

For many variables a table by hand is slow. A short program can try all 2k2^k inputs. This one compares the expressions of E10/E11:

Python · equivalent.py
from itertools import product


def X(x1, x2, x3):
    """(x1 AND x2) OR (x1 AND NOT x3)"""
    return (x1 and x2) or (x1 and not x3)


def Y(x1, x2, x3):
    """x1 AND (x2 OR NOT x3)"""
    return x1 and (x2 or not x3)


same = True
print("x1 x2 x3 | X Y")
for bits in product([0, 1], repeat=3):
    x, y = int(bool(X(*bits))), int(bool(Y(*bits)))
    print(*bits, "|", x, y)
    if x != y:
        same = False
print("Equivalent:", same)
Output
x1 x2 x3 | X Y
0 0 0 | 0 0
0 0 1 | 0 0
0 1 0 | 0 0
0 1 1 | 0 0
1 0 0 | 1 1
1 0 1 | 0 0
1 1 0 | 1 1
1 1 1 | 1 1
Equivalent: True

Key takeaways

  • A Boolean function f:Bk→Bf: B^k \to B gives an output bit for each of the 2k2^k input tuples.
  • Every Boolean expression (and every circuit) defines a Boolean function.
  • X≡YX \equiv Y means equal outputs on all inputs; equivalent circuits do the same job.
  • Check equivalence by a full table, by the laws, or by a short program.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

How many rows does the table of a Boolean function f:B3→Bf: B^3 \to B have?

Show answer

Answer: C. 8

There are 23=82^3 = 8 input triples. Option 4 (323^2) mixes up the base and the exponent.

Question 2 · multiple choice

How many different Boolean functions of 2 variables are there?

Show answer

Answer: B. 16

There are 4 input rows and each can have output 0 or 1, so 24=162^4 = 16 functions. Option 1 counts the rows, not the functions.

Question 3 · multiple choice

Let f(e1,e2)=e1∧e2′f(e_1, e_2) = e_1 \land e_2'. What is f(1,0)f(1, 0)?

Show answer

Answer: A. 1

f(1,0)=1∧0′=1∧1=1f(1, 0) = 1 \land 0' = 1 \land 1 = 1. Option 3 forgets that e2e_2 is complemented.

Question 4 · multiple choice

Which expression is equivalent to (x1∨x2)′(x_1 \lor x_2)'?

Show answer

Answer: D. x1′∧x2′x_1' \land x_2'

De Morgan’s law; both are 1 only at (0,0)(0, 0). Option 1 is 1 at three inputs, so it is a different function.

Question 5 · multiple choice

Are X=(x1∧x2)∨(x1∧x3)X = (x_1 \land x_2) \lor (x_1 \land x_3) and Y=x1∧(x2∨x3′)Y = x_1 \land (x_2 \lor x_3') equivalent?

Show answer

Answer: C. No; at (1,0,0)(1, 0, 0), X=0X = 0 but Y=1Y = 1

X=x1∧(x2∨x3)X = x_1 \land (x_2 \lor x_3), which differs from YY at (1,0,0)(1,0,0) and (1,0,1)(1,0,1). Option 4 is wrong: when x1=0x_1 = 0 both are 0.

Question 6 · short answer

Write the table of the Boolean function f:B3→Bf: B^3 \to B defined by (x1∧x2)∨(x1∧x3′)(x_1 \land x_2) \lor (x_1 \land x_3') (E10).

Show worked answer

In the row order (e1,e2,e3)(e_1, e_2, e_3) = 000, 001, 010, 011, 100, 101, 110, 111: e1∧e2e_1 \land e_2 = 0, 0, 0, 0, 0, 0, 1, 1; e3′e_3' = 1, 0, 1, 0, 1, 0, 1, 0; e1∧e3′e_1 \land e_3' = 0, 0, 0, 0, 1, 0, 1, 0; so ff = 0, 0, 0, 0, 1, 0, 1, 1. The function is 1 exactly at (1,0,0)(1,0,0), (1,1,0)(1,1,0) and (1,1,1)(1,1,1).

↑ ↓ move↵ openTab switch type