This paper presents a new design method for all-optical NAND and AND logic gates based on 3x3 general interference multimode interference (GI MMI) coupler. The whole device is realized on the silicon on insulator (SOI) platform. The transfer matrix method (TMM) and three dimensional beam propagation method (3D-BPM) are used to optimally design these devices. Key words: Optical logic gate, multimode interference (MMI) coupler, silicon on insulator (SOI), beam propagation method (BPM)