Solution:
(a) The Boolean expression for NAND gate is given as $Y=\overline{A B}$
Let the output of the NAND gate be $Y^{\prime}$.
Therefore, Final output of the combination will be $Y=\overline{Y^{\prime} \cdot Y^{\prime}}$
$\mathrm{Y}=\overline{\overline{\mathrm{A} \cdot \mathrm{B}} \cdot \overline{\mathrm{A.B}}}$
$Y=\overline{A \cdot B}+\overline{A \cdot B}$
$Y=A . B$
The given circuit acts as an AND gate.
(b) Boolean expression for NOT gate is $Y=\bar{A}$
For the first NOT gate, the output $Y_{1}$ is $\bar{A}$
For the second NOT gate, the output $Y_{2}$ is $\bar{B}$
The output of the combination will be
$Y=\overline{Y_{1} \cdot Y_{2}}$
$Y=\overline{\bar{A} \cdot \bar{B}}$
$Y=\overline{\bar{A}}+\overline{\bar{B}}$
$Y=A+B$
This is the Boolean expression for OR gate.