Optical computation is the demand needed for high speed signal processing. This demand is ever increasing scrutiny and it needs the focus on reliable, low loss with very high switching speed and minimal power consumption of photonic transition between successive data. In this paper we proposed the design of efficient switching encoder that encodes the data based on Hamming distance to reduce the power consumption. The basic XOR gate setup based on SOA is simulated in OptSim 2016.06. © OSA 2016.