We propose and numerically investigate for the first time a novel all-optical on-off-keying to alternate-mark-inversion modulation format converter operating at 40 Gbps employing a semiconductor optical amplifier (SOA)-based Mach-Zehnder interferometer (MZI). We demonstrate that this SOA-MZI operates as a pulse subtractor, and in the absence of patterning will produce perfectly phase inverted pulses regardless of the individual SOA phase excursions. We use a comprehensive computer model to illustrate the impact of patterning on the output phase modulation, which is quantified through the definition of the phase compression factor. (C) 2010 Optical Society of America