Terahertz wave logic gates are one of the key devices required in terahertz wave communication systems and signal processing systems. In this paper, we design a logic gate to realize the function of AND gate and XOR gate. The logic AND-XOR gate is based on two large photonic crystal ring resonators, one small ring resonator and photonic crystal branch waveguides. The structure is analyzed and simulated by treating the plane wave expansion and finite difference time domain methods. The steady-state field distributions and output power characteristics of the gate are analyzed. The simulation results show that the designed device with the feasibility can be used in terahertz wave integrated digital circuit.