In dotted line box 1 is a NOT gate
Explanation. Its circuits is as shown in Fig.
Here `y=bar(A.A)=barA+barA=barA=NOT A`
In dotted line box 2 is an OR gate.
Explanation. Its circuit is as shown in Fig.
Here, `y=bar(barA.barB)=A+B=A OR B`
(From De-Morgan's Theorem)
In dotted line box 3 is AND gate.
Explanation. Its circuit is as shown in Fig.

Here, `y=bar((bar(A.B)).bar((A.B))) = A.B+A.B`
Applying de Morgon's theorem
(i) `bar(barC+barD)=C.D (ii) bar(barC.barD)=C+D`
`:. y=A.B+A.B=A.(B+B)=A.B`
`=A AND B. ( :' B+B=B OR B=B)`
Similarrly, we can explain the values of y for other values of A and B in truth table.