You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
1.5 KiB

\item \self Compute the propositional formula of the following circuit.
\tikzstyle{branch}=[fill,shape=circle,minimum size=3pt,inner sep=0pt]
\begin{tikzpicture}[label distance=2mm]
\node (a) at (0,0) {$a$};
\node (b) at (0,-1) {$b$};
\node (c) at (0,-2) {$c$};
\node (z) at (8,-1) {$z$};
\node (bm) at (3,-1) {};
\node (cm1) at (2,-2) {};
\node (cm2) at (3,-2) {};
\node (bc_c1) at (2,-1.1) {};
\node (bc_c2) at (2.1,-1) {};
\node (bc_c3) at (2,-.9) {};
\node (not1m) at (3,0) {};
\node (and1m) at (5,-.5) {};
\node (nand1m) at (5,-1.5) {};
\node[not gate US, draw, logic gate inputs=n] at ($(2,0)$) (not1) {\tiny NOT};
\node[and gate US, draw, logic gate inputs=nn] at ($(4,-.5)$) (and1) {\tiny AND};
\node[nand gate US, draw, logic gate inputs=nn] at ($(4,-1.5)$) (nand1) {\tiny NAND};
\node[xor gate US, draw, logic gate inputs=nn] at ($(6,-1)$) (xor1) {\tiny XOR};
\draw (a.east) -- (not1.input);
\draw (not1.output) -| (not1m.center) node[above] {$w$} |- (and1.input 1);
\draw (c.east) -| (cm1.center) node[circle, fill,inner sep=2pt] {} -- (bc_c1.center) -- (bc_c2.center) -- (bc_c3.center) |- (and1.input 2);
\draw (b.east) -| (bm.center) |- (nand1.input 1);
\draw (c.east) -| (cm2.center) |- (nand1.input 2);
\draw (and1.output) -| (and1m.center) node[above] {$x$} |- (xor1.input 1);
\draw (nand1.output) -| (nand1m.center) node[below] {$y$} |- (xor1.input 2);
\draw (xor1.output) -- (z);
\end{tikzpicture}