在门电路上适当地放置文本

在门电路上适当地放置文本
        \node[and port, number inputs=3, yscale=1] (and1) at (0, 0) {};
        \node[or port, yscale=1.6, xscale=1] (or1) at (3.5, 0.45) {};
        \node[or port, number inputs=3] (or2) at (0,-2.01) {};
        \node[and port] (and2) at (5.5,-1.73) {};
        
        \node (in1) at ($(and1.in 1) - (1, 0)$) {};
        \node (in2) at ($(and1.in 2) - (1, 0)$) {};
        \node (in3) at ($(and1.in 3) - (1, 0)$) {};
        \node (in4) at ($(or1.in 4) - (4.5, -2.68)$) {};
        \node (in5) at ($(or2.in 3) - (1, -0.75)$) {};
        \node (in6) at ($(or2.in 3) - (1, -0.35)$) {};
        \node (in7) at ($(or2.in 3) - (1, 0)$) {};
        
        \node at (in1) {\(y\)};
        \node at (in2) {\(z\)};
        \node at (in3) {\(t\)};
        \node at (in4) {\(x\)};
        \node at (in5) {\(y\)};
        \node at (in6) {\(z\)};
        \node at (in7) {\(t\)};
        
        \draw (in1) -- (and1.in 1) ;
        \draw (in2) -- (and1.in 2);
        \draw (in3) -- (and1.in 3);
        \draw (in4) -- (or1.in 1);
        \draw (in5) -- (or2.in 1);
        \draw (in6) -- (or2.in 2);
        \draw (in7) -- (or2.in 3);
         
        \draw (and1.out) -- (or1.in 2) node[above] {\(y+z+t\)};
        
        \draw (or2.out) -- ++ (1, 0) node[below] {\(yzt\)};
        \draw (or1.out) -| (and2.in 1) node[left] {$x(y+z+t)$};
        \draw (or2.out) -- (and2.in 2) ++ (1.5, 0)  node[right] {$x(y+z+t)+yzt$};
        \draw (and2.out) -- ++ (0.5,0);
        
    \end{circuitikz}

这让我

在此处输入图片描述

显然我需要y+z+t稍微调整一下左侧和x(y+z+t)右上方。我该怎么做?

答案1

\draw (or1.out) -| (and2.in 1) node[left, xshift=-1cm] {$x(y+z+t)$};

node [above left=12mm and 15mm of A] {P};

\draw (or2.out) -- (and2.in 2) ++ (1.5, 0)  node[right, xshift=1cm, yshift=1cm] {$x(y+z+t)+yzt$};

相关内容