We propose a novel photonic circuit capable of implementing the AND/NAND logic operations over two cascaded Mach-Zehnder interferometers. Two electrical signals that stand for the two operands of the operations are applied to the arms of the Mach-Zehnder interferometers, which are modulated through the electro-optic effect, and the outcome of the operation is channelled as light to the output port. The model of this device has been analyzed, and the results are verified by numerical simulation.