The theory optical logic coder based on multimode interference self-imaging principle is demonstrated. We concretely design a 1-D 23 bit optical logic coder using partial phase modulation method. According to beam propagation method, the simulation results obtained by Beamprop software are discussed and some input parameters are optimized. Different modulation methods produce different Boolean logic states with the extinction ratio higher than 11 dB.