Haroon,
Be careful about just believing that your equipment will do what Spitoon said. I talked to an IFR controller and he told me that your XPDR code will indicate when you are switching through numbers, as Spitoon said it would, but he said as soon as you select an emergency code it will show up, there is no delay.
To avoid setting off alarms you need to follow the advice of TC AIM RAC 1.9.1. I will paraphrase it: DO NOT SELECT AN EMERGENCY CODE! It's as simple as that.