You know how the tikz gate libraries have 3-input OR and AND gates but not an XOR one. I am specifically looking for the US style of it. I was somewhat surprised that this isn't available. I was thinking about producing it myself but looking through the code for the OR is somewhat daunting. Is there an easy way to do it, maybe somehow inheriting from the OR?

The image I am looking for looks like this xorgate, not like the IEEE one, except for the three or more legs of course.


If you want easy:




\begin{tikzpicture}[circuit logic US]
\draw (0,0) node[xor gate](XOR1){}
  ($(XOR1.north west)!.5!(XOR1.input 1)$) -- ++(-.5,0)
  (XOR1.input 1) -- ++(-.5,0)
  (XOR1.west) -- ++(-.5,0)
  (XOR1.input 2) -- ++(-.5,0)
  ($(XOR1.south west)!.5!(XOR1.input 2)$) -- ++(-.5,0)
  (XOR1.output) -- ++(.5,0);


xor gate


There is even more simple way!

    \begin{circuitikz}%[circuit logic US]
        \draw (0,0) node[xor port ,scale=2, number inputs=3](XOR1){}
  • Welcome to TeX.SE!
    – Mensch
    Jan 27 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.