TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I draw a 3-input logic gate with circuitikz? Is there a way to do so?

For example,

  (0,0) node[and port](myand){}
  (myand.in 1) node[left]{A}
  (myand.in 2) node[left]{B}
  (myand.in 3) node[left]{C}
  (myand.out) node[right]{Y}
share|improve this question
I don't know about circuitikz, but with tikz you could see this answer. Who knows, maybe it even helps with circuitikz. – morbusg Jan 20 '13 at 23:14
Yeah, I've seen it. But it's because I use circuitikz to draw my circuits, so I'm used to it. But thank you anyway. – Gutierrez PS Jan 26 '13 at 16:39
up vote 4 down vote accepted
    \begin{tikzpicture}[minimum height=0.75cm] 
        \node[or gate US, draw,logic gate inputs=nnn] (A) {}; 
        \foreach \a in {1,...,3}
            \draw (A.input \a -| -1,0) -- (A.input \a); 
        \draw (A.output) -- ([xshift=0.5cm]A.output);

    \begin{tikzpicture}[minimum height=0.75cm] 
        \node[and gate US, draw,logic gate inputs=nnn] (A) {}; 
        \foreach \a in {1,...,3}
            \draw (A.input \a -| -1,0) -- (A.input \a); 
        \draw (A.output) -- ([xshift=0.5cm]A.output);


enter image description here

By slight modification of this code you can acheive gates with more inputs (modifying inputs=nnn and \foreach \a in {1,...,3}).

For more, check TikZ & PGF manual section 29.3 Page 300

share|improve this answer
I was trying to do it with circuitikz, but it seems there's no way. Thanks anyway. – Gutierrez PS Feb 27 '13 at 23:05
@Pouya, this is not working with american nor port. – CroCo Oct 11 '15 at 16:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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