Silicon waveguides are essential to integrated photonics, which is where optical and electronic components are coupled together on a single silicon chip. These waveguides allow for the integration of signal processing and optical transmission, which advances data centers, telecommunications, and other optical applications. Thus, our study involves the simulation of essential all-optical logic operations, namely XOR, AND, OR, NOT, NOR, NAND, and XNOR, and utilizes M-shaped silicon optical waveguides at a wavelength of 1.55 μm. This simulation is conducted through Lumerical FDTD solutions. The suggested waveguide comprises four identical slots, configured in the shape of the letter ‘M’, and all of which are formed of core silicon and silica cladding. These logic operations work based on constructive and destructive interferences that are caused by phase changes in the input optical beams. The contrast ratio (CR) is employed to quantitatively and comparatively assess the degree to which the target logic operations are efficiently executed. The simulation results indicate that, compared to other reported designs, the considered logic functions constructed using the proposed waveguide can be implemented with higher CRs. The outcomes of this paper can be utilized regarding the implementation of optoelectronic combinational logic circuits of enhanced functionality.