Universal NAND gate and its application in level monitoring in chemical plant