A simple molecular fluorescent probe 5 has been designed and synthesized by appending anthracene and benzhydryl moieties through a piperazine bridge. The probe upon interaction with different metal ions showed high selectivity and sensitivity (2 ppb) for Hg(2+) through fluorescence "turn-on" response in HEPES buffer. The significant fluorescence enhancement (~10-fold) is attributable to PET arrest due to complexation with nitrogen atoms of the piperazine unit and Hg(2+) in 1:2 stoichiometry, in which a naked-eye sensitive fluorescent blue color of solution changed to a blue-green (switched-on). As a proof of concept, promising prospects for application in environmental and biological sciences 5 have been utilized to detect Hg(2+) sensitively in real samples, on cellulose paper strips, in protein medium (like BSA), and intracellularly in HeLa cells. Moreover, the optical behavior of 5 upon providing different chemical inputs has been utilized to construct individual logic gates and a reusable combinational logic circuit. The combinational circuit (switch ON mode; OR logic gate) is easily resettable to the original position (switch OFF mode; INHIBIT logic gate) by applying reset chemical inputs (OH(-) and PO4(3-)) with great reproducibility.