3

Hi im trying to connect both inputs of a logic gate, to a batterry connected to ground. Im having a problem finding the information about the sintaxis of the logic gates, i have read the documentation of circuitikz but there is no information of the available anchors, or the ways to connect the pins of the gate(straight lines, curve lines, something...). Also i am having problem understanding how to declare nodes to connect the gate.

Maybe i miss some information...

\begin{circuitikz}
            \draw (0,0) node[ground]{} to [battery] (0,1)
            (3,1) node[nand port] (nand1){}
            (nand1.in 2) 
            (nand1.in 1) ;          
\end{circuitikz}

enter image description here

I have achieve this, but looks ugly...

\begin{circuitikz}
            \draw (0,0) node[ground]{} to [battery] (0,1)
            (3,1) node[nand port] (nand1){}
            (nand1.in 2) -- (nand1.in 1) 
            (nand1.in 1) -- (0,1);          
    \end{circuitikz}

enter image description here

For example i dont know what are the --, or how to declare nodes to connect and how to properly connect both inputs and the nodes created with another nodes. Thanks a lot for the information.(:

  • 1
    Please show us the code you have so far, and perhaps an screenshot marked with the changing you want to have. Welcome to TeX.SE! – Mensch Aug 19 '16 at 2:18
  • Welcome to TeX.SX!! Rather than posting code fragments it is better to give a full minimal working example. Currently we have to guess what packages etc you are using and this makes it really hard to help you. A MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will! – Andrew Aug 19 '16 at 5:54
2

Probably you like to obtain something like this:

enter image description here

With your MWE you was quit cole to above image, only one coordinate I change (actually I increase all vertical distances):

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}

\begin{document}
    \begin{circuitikz}
\draw   (0,0) node[ground]{} to [battery] (0,1.5)
        (3,1.5) node[nand port] (nand1){}
        (nand1.in 1) -- (nand1.in 2)
        (nand1.in 1 |- nand1.out) to [short,*-] (0,1.5);% changed coordinate of line
                                                        % between battery and gate
    \end{circuitikz}
\end{document}

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.