Due to its inherent parallelism and tremendous operational speed, optical signal is the most suitable for data processing and digital communication in various fields. Conventional electronic and opto-electronic systems are unable to fulfill this arena, because of their low speed and time delay. In the case of pure electronic flip-flop, when a switch is turned ON, there is notable propagation delay on the order of nanoseconds. For an opto-electronic flip-flop although the propagation delay time is much less than that of an electronic flip-flop (about 10 to 100 times less), there are many disadvantages. Some of these disadvantages are delay of response time due to the use of spatial light modulators, an O/E converter that does not operate at all frequencies or wavelengths, and the unavailability of such materials. An optical input encoding methodology is proposed for the performance of all-optical flip-flop operations possible for two inputs. These operations were conducted in all-optical mode and are parallel in nature. All the operations are treated with proper exploitation of some nonlinear materials.