Implementation of logic gates using PLC