Tristate and Gate Using Photonic Crystal