Result:

PS. If you want, you can use circuitikz's logic gates too; just replace and gate with and port and similarly for the OR gate. (But somehow circuitikz's gates are not as well-designed as those of TikZ itself, although it's other electrical elements are.)