All-optical logic gates are designed to extend the existing design to a higher number of bits, to use the same gate in multifunctions, and to add new gate designs. This type of gate is based on semiconductor optical amplifier (SOA) nonlinearities, since the SOA can provide a strong change of the refractive index together with high gain. The SOA is used with a Mach-Zehnder interferometer (MZI) forming an SOA-MZI structure which is used to perform the logic gates XOR, NOR, OR, and XNOR. Two binary input data signals are used with different number of bits (4, 6, 8, and 16 bit) at 10 Gbps. This work includes the study of the effect of the number of bits on the received power, minimum bit error rate, and maximum Q-factor. (C) 2016 Society of Photo-Optical Instrumentation Engineers (SPIE)