By exploiting the phenomena of optical switching, different logic functions for all-optical digital signal processing has been projected. This paper presents the application of optical switching to design of all-optical half adder and half subtractor by Mach-Zehnder interferometer. All-Optical half adder and half subtractor are designed with the optimized structure of 2 × 2 Mach-Zehnder interferometer switch by electro-optic effect in lithium niobate. Numerical simulations of the proposed structure have been conducted to verify the suitability of the designed structure using Opti-BPM software. The implementation of proposed structures is simulated in MATLAB software along with the mathematical description. It is interesting to analyze that the proposed structures are useful to generate combinational and sequential logic circuits in high-speed optical signal processing and switching network.