This paper presents a simple and novel scheme for all-optical SR and D flip-flop employing cross gain modulation (XGM) effect in two wideband semiconductor optical amplifiers. The proposed flip-flop has a fast response, with less than 20 ps transition times for both rising and falling edges. The FF speed-limit is mainly determined by the SOA recovery time and the intra-FF coupling length. The simulation results exhibit a contrast ratio of 13 dB between two states with an AM of less than 2.5 dB. The distinctive simplicity of the flip-flop implies reduced footprint and low power consumption which makes it ideal for photonic integration. (C) 2013 Elsevier GmbH. All rights reserved.