All-optical half adder based on photonic crystals for BPSK signals