The hairpin structure of DNA molecules have been widely employed for a variety of biosensors and nanoscale molecular assembly applications. For example, the commonly known molecular beacons can report the presence of specific nucleic acids in homogeneous solutions with high accuracy. Recently, Smith et al. proposed to induce hairpin formation through the sequence-specific binding of a small-molecule ligand G-G mismatch. Not only did this make the control of the hairpin formation flexible, but more important the induced hairpin still keeps a high sensitivity to specific hybridization. In this paper, we simulate the working process of logical XOR gates based on induced hairpin formation.