All optical logic gates play a key role in implementing an optically transparent network where the node functionalities are performed in the optical domain to reduce latency and power consumption. In this paper we present the experimental demonstration and details of optimization of all optical XOR/ XNOR gate using four-wave mixing (FWM) in Semiconductor Optical Amplifier (SOA) for 10 Gbps Differential Phase Shift Keyed (DPSK) data. Two DPSK modulated signals at carrier frequencies ω1 and ω2, phases φ1and φ2and a continuous wave pump at frequency ωCW and phase φCW are allowed to undergo FWM in a non-linear SOA to generate additional frequency components. The phase of the generated FWM idler corresponding to the frequency ω1+ ω2-ωCW given by φ1+ φ2- CW corresponds to the XOR operation in DPSK format. Light from a DFB and tunable laser source (TLS) are combined and phase-modulated using a pseudo-random bit sequence. The bit sequences in the two carrier wavelengths are separated in time by propagating through a sufficient length of SMF; the data is combined with a CW pump from a tunable laser and allowed to undergo non-degenerate FWM in a nonlinear SOA. The relative spacing between the pump and the signal wavelengths and their polarization states are optimized to yield maximum conversion efficiency in the desired idler. The XOR output is further propagated through a delay-line interferometer (DLI) to obtain XOR and XNOR outputs in the two ports of the DLI, in the OOK format. Extinction ratio and Contrast ratio of better than 7.2 dB and 10.6 dB respectively for the XNOR gate and 6.8 dB and 7.5 dB for the XOR gaterespectively. © 2015 SPIE.