For the logic circuit shown in Fig. 16.10, write the Boolean expression and construct the truth table.
The Boolean expression is developed from Fig. 16.11 as
The Boolean expression is
\begin{aligned} \mathrm{X} & =\overline{\mathrm{A}+\mathrm{B}}+\mathrm{A} \cdot \mathrm{B} \\ & =\mathrm{Y}+\mathrm{Z} \end{aligned}where \mathrm{Y}=\overline{\mathrm{A}+\mathrm{B}} \text { and } \mathrm{Z}=\mathrm{A} \cdot \mathrm{B}
For constructing the truth table, we will first write the various combinations of the inputs at A and B in the form of binary numbers (the total number of possible combinations being Z^N where N is the number of inputs). We then calculate Y and Z, and then X is calculated.
Truth table
\begin{array}{|ccccc|} \hline \mathrm{A} & \mathrm{B} & \mathrm{Y} & \mathrm{Z} & \mathrm{X}=\mathrm{Y}+\mathrm{Z} \\ \hline 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 1 & 1 \\ \hline \end{array}
Boolean expression for any logic function can be obtained from the truth table. This is done by taking the sum of all terms which correspond to all those combinations of inputs for which the output attains a high value. Let us consider the truth table of the above example.
\begin{array}{|ccc|} \hline \mathrm{A} & \mathrm{B} & \mathrm{X} \\ \hline 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \\ 1 & 1 & 1 \\ \hline \end{array}The first row and fourth row have to be considered where output is high, i.e., 1.
Inputs A and B are to be considered 1. The complement \overline{\mathrm{A}} \text { and } \overline{\mathrm{B}} therefore 0.
For row 1
For row 4
Z = A.B
The Boolean expression for the output is
\mathrm{X}=\mathrm{Y}+\mathrm{Z}=\overline{\mathrm{A}+\mathrm{B}}+\mathrm{A} \cdot \mathrm{B}