We proposed a new and simple scheme to implement exclusive OR (XOR) and not exclusive OR (NXOR) logic operations in the optical domain enabled by a dual-parallel phase modulator (PM). Both the intensity and phase of the optical signal are utilized to represent the four different states of two binary inputs, and direct detection is used to map the four states to the corresponding binary output. Through numerical analysis, two PMs with phase offsets were adjusted to π∕2, and the phase shifter between the two PMs was controlled atπ∕2; thus, the NXOR logic gate was successfully carried out. Two PMs with phase offsets were adjusted to π∕2, and the phase shifter between the two PMs was controlled atπ; thus, the XOR logic gate was successfully carried out. Simulations were successfully carried out at the speed of 10 Gb/s.