7

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.

5

If you want easy:

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{circuits.logic.US,calc}

\begin{document}

\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);
\end{tikzpicture}

\end{document}

xor gate

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.