Let the two inputs be A and B.
All the four gates shown in the network are two-input NAND gates.
We label the output of each NAND gate so that the algebra can be written step by step.
Gate-1 output: P=AB −(1)
Gate-2 output (driven by A and P): Q=AP −(2)
Gate-3 output (driven by B and P): R=BP −(3)
Gate-4 output (final output Y, driven by Q and R): Y=QR −(4)
Substitute P from (1) into (2):
Q=AAB
Apply the distributive property inside the complement:
AAB=A(A+B)
(because XY=X+Y)
Now, A(A+B)=AA+AB=0+AB=AB
Therefore, Q=AB=A+B −(5)
(using XY=X+Y once more)
In the same way, substitute P from (1) into (3):
R=BAB
Proceeding exactly as before, we get
R=BA=B+A −(6)
Finally, substitute (5) and (6) into (4):
Y=(A+B)(B+A)
Expand the product:
(A+B)(B+A)=AB+AA+BB+BA=AB+0+0+AB=AB+AB
Therefore,
Y=AB+AB
Recall De Morgan’s theorem, P+Q=PQ.
Apply it to the above expression:
Y=AB⋅AB=(A+B)(A+B)
Now expand once more:
(A+B)(A+B)=AA+AB+BA+BB=0+AB+BA+0=AB+AB
The Boolean expression Y=AB+AB is the definition of the Exclusive-OR (XOR) operation between A and B, symbolically A⊕B.
Hence the network implements an XOR gate, so the truth table of Y is
A B | Y
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0
Among the four answer choices, Option 3 corresponds to Y=A⊕B.
Therefore, Option 3 is correct.