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

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