We present a new ultrafast optical waveguide gate based on a nonlinear optical interaction in a waveguide interferometer. A train of signal pulses is gated by control pulses which change the refractive index in only one arm of the interferometer. The principle of operation is demonstrated using a modified Mach-Zehnder interferometer, 2 cm long, fabricated in a LiNbO3substrate. The experiments were performed with a near-infrared dye laser which produced 5 ps pulses at nm. A maximum modulation on the order of 10-3was obtained for a peak control power of 2 W. Experimentally, we determined the appropriate nonlinear coefficient of LiNbO3to be (MW/cm2)-1. As possible applications of the structure we describe an all-optical inverter, an XOR gate, and an AND gate. We conclude with a brief description of a random number generator encoder and decoder based on a few all-optical logic gates.