We have proposed an all-optical AND logic gate based on four-wave mixing (FWM) in a semiconductor optical amplifier (SOA) integrated with an optical filter. In the scheme proposed, the preferred logical function can be performed without using a continuous-wave (cw) signal. The modified nonlinear Schrödinger equation (MNLSE) is used for the modelling wave propagation in a SOA. The MNLSE takes into account all nonlinear effects relevant to pico- and sub-picosecond pulse durations and is solved by the finite-difference beam-propagation method (FD-BPM). Based on the simulation results, the optimal output signal with a 40-fJ energy can be obtained at a bit rate of 50 Gb s-1. In the simulations, besides the nonlinearities included in the model, the pattern effect of the signals propagating in the SOA medium and the effect of the input signal bit rate are extensively investigated to optimise the system performance.