A multistable self-assembling system with three distinct luminescence outputs: prototype of a bidirectional half subtractor and reversible logic device