port 32 is as shown by u201c output 1 u201d in fig4 the nonlinear cavity unit 01 is coupled with the y type and logic gate unit 02 i e the intermediate signal input port 31 of the nonlinear cavity unit 01 is connected with the intermediate signal output port 32 of the y shape and logic gate unit 02 and it is supposed that the and logic output signal of the y shape and logic gate unit 02 is g i e the and logic output signal g of the y shape and logic gate unit 02 is the input signal of the intermediate signal input port 31 of the nonlinear cavity unit 01 at the moment reference light e 1 is input to the reference light input port 11 of the high contrast phc and logic gate and it can be obtained from formula 2 finally the system output port 15 will output the high contrast and logic signal g the 2d phc structure of the device of the present invention is a 2m 1 u00d7 2n 1 array structure where m is an integer more than or equal to 4 and where n is an integer more than or equal to 7 design and simulation results will be provided below in an embodiment given in combination with the accompanying drawings wherein the embodiment is exemplified by a 17 u00d7 27 array structure and design and simulation results are given taking the lattice constant d of the 2d phc array being 1 u03bcm and 0 5208 u03bcm respectively as an example referring to that shown in fig1 the lattice constant d is 1 u03bcm the operating wavelength is 2 976 u03bcm the radius of the circular high refractive.