3

I would like to get help on how can I get 1 input as a separated line into two different inputs, I wrote this and I would like to have one input going to the second input of the upper gate and the first input in the lower gate

\begin{circuitikz} 
\draw
(0,2) node[xor port] (myxor1) {}
(0,-.7) node[xor port] (myxor2) {}
(2,0.5) node[xor port] (myxor) {}
(myxor1.in 2) node[anchor=east] {A}
(myxor2.in 1) node[anchor=east]  {A}
(myxor1.out) -| (myxor.in 1)
(myxor2.out) -| (myxor.in 2)
;
\end{circuitikz}
Nehad
  • 77

1 Answers1

4

enter image description here

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

\begin{document} \begin{circuitikz} \draw (0,2) node[xor port] (myxor1) {} (0,0) node[xor port] (myxor2) {} (2,1) node[xor port] (myxor) {} (myxor1.in 2) |- (myxor2.in 1) (myxor1.out) -| (myxor.in 1) (myxor2.out) -| (myxor.in 2) (myxor.out) -- ++ (1,0) node[right] {$C_i$} % (myxor1.in 2 |- myxor.out) to [short] ++ (-1,0) node[twoportshape, anchor=right,t=$G_A$] (ga) {} (ga.west) to [short] ++ (-1,0) node[twoportshape, anchor=right,t=$S_A$] (sa) {} % (sa.west) to [short] ++ (-1,0) node[left] (in2) {0} (myxor1.in 1) -- (myxor1.in 1 -| in2.east) node[left] (in1) {$C_i$} (myxor2.in 2) -- (myxor2.in 2 -| in2.east) node[left] (in3) {0} ; \end{circuitikz} \end{document}

Addendum: A version with ieee logic style (as suggested @Rmano):

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

\begin{document} \begin{circuitikz} \ctikzset{logic ports=ieee} \draw (0,2) node[xor port] (myxor1) {} (0,0) node[xor port] (myxor2) {} (3,1) node[xor port] (myxor) {} (myxor1.in 2) -- ++ (-0.5,0) coordinate (aux) |- (myxor2.in 1) (myxor.in 1) -- ++ (-0.5,0) |- (myxor1.out) (myxor.in 2) -- ++ (-0.5,0) |- (myxor2.out) (myxor.out) -- ++ (1,0) node[right] {$C_i$} % (aux |- myxor.out) to [short] ++ (-0.5,0) node[twoportshape, anchor=right,t=$G_A$] (ga) {} (ga.west) to [short] ++ (-0.5,0) node[twoportshape, anchor=right,t=$S_A$] (sa) {} % (sa.west) to [short] ++ (-1,0) node[left] (in2) {0} (myxor1.in 1) -- (myxor1.in 1 -| in2.east) node[left] (in1) {$C_i$} (myxor2.in 2) -- (myxor2.in 2 -| in2.east) node[left] (in3) {0} ; \end{circuitikz} \end{document}

enter image description here

Zarko
  • 296,517