A differential optical switch based on parallel-connected AlGaAs-GaAs pnpn structures is presented. With continuous input light we succeeded in discriminating between two optical inputs with the power difference of as low as 0.1 nW. The minimum operating energy with pulse inputs was 400 fJ. With introduction of a storage operation of pnpn structures, the optical S-R flip-flop operation is also demonstrated with a 7.2 pJ optical input energy. Its expansibility of 2-D array is attractive in optical parallel processing systems, especially in optical neural networks.