Step 1: Understanding the Concept
The circuit uses four NAND gates. Let the first gate (fed by A and B) give \(P = \overline{AB}\).
Step 2: Middle gates
The upper gate gets A and P: \(Q = \overline{A\cdot\overline{AB}}\).
The lower gate gets B and P: \(S = \overline{B\cdot\overline{AB}}\).
Step 3: Simplify
\(Q = \overline{A} + AB = \overline{A}+B\) and \(S = \overline{B} + AB = \overline{B} + A\).
Step 4: Output gate
\(Y = \overline{Q\cdot S} = \overline{(\overline{A}+B)(A+\overline{B})} = \overline{AB + \overline{A}\,\overline{B}}\).
Step 5: Compare the options
\(\overline{AB + \overline{A}\,\overline{B}} = A\overline{B} + \overline{A}B = A\oplus B\), which is an X-OR gate.
Final Answer:
The combination behaves as an X-OR gate.
\[ \boxed{\text{(D) }\text{X-OR gate}} \]