Single photonic crystal structure for realization of NAND and NOR logic functions by cascading basic gates