Search code examples
boolean-logictruthtable

Deriving a Boolean function from a table describing the output d of a Boolean function


I have been presented with the following question:

The following table describes the output d of a Boolean fun with three input values a, b, and c.

 a  b  c  |  d 
----------+----
 0  0  0  |  1 
 0  0  1  |  1 
 0  1  0  |  1 
 0  1  1  |  0 
 1  0  0  |  0 
 1  0  1  |  0 
 1  1  0  |  0 
 1  1  1  |  0 

Give this Boolean function using a suitable combination of AND, OR, XOR, NOT, NAND, NOR or XNOR.

Why is the correct answer:

d := (((NOT a) AND (NOT b)) AND (NOT c)) OR
(((NOT a) AND (NOT b)) AND c) OR
(((NOT a) AND b) AND (NOT c))

My Answer. (((NOT a) AND (NOT b)) AND (NOT c))

a   b   c     d
===============
0   0   0     1      
.
. 
.

How is this derived?


Solution

  • The answer you give is called the sum-of-products (SOP) formulation. Look at the three large terms joined by ORs:

    • ((NOT a) AND (NOT b)) AND (NOT c))
    • ((NOT a) AND (NOT b)) AND c)
    • ((NOT a) AND b) AND (NOT c)

    Now look at the truth table, in which exactly three lines have a 1 in the d column. Each of these three lines corresponds to one of the three terms.

    Briefer answers can be composed, such as d := (NOT a) AND (NOT(b AND c)), but they are not the sum-of-products formulation you have given.