Abstract The all-optical switching phenomena in the non-linear directional coupler using cross-phase modulation (XPM) effect have been proposed. It is designed to generate an all-optical XOR functionality, considering the XOR logic gates as a basic module the design and analysis of an efficient all-optical 4-bit binary to gray code converter and 4-bit even parity checker circuit is proposed. The design methodology includes the switching of a weak continuous-wave (CW) signal, which is controlled by the combination of two controlled pump signals. In this paper, mathematical analysis of the coupled mode theory associated with optical directional couplers has been discussed. The switching characteristics of XPM effect based All-optical directional couplers have been examined for appropriate values of the controlled pump signals. Appropriate values of extinction ratio and corresponding controlled pump signal levels are investigated for an efficient generation of XOR logic gates. Further, the detailed analysis of layout generation and design aspects of All-optical 4-bit binary to gray code converter and 4-bit even parity checker circuits have been carried out. The proposed methodology is verified by the appropriate simulation results, which include the transmittivity, extinction ratio (Xratio) curve variation and dynamic time domain plot associated with proposed units.