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.

46 lines
2.1 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.5) {$c$};
  7. \node (d) at (0,-3.5) {$d$};
  8. \node (z) at (13.5,-1.5) {$z$};
  9. \node (am) at (2,0) {};
  10. \node (not1m) at (3,-1) {};
  11. \node (not2m) at (3,-2.5) {};
  12. \node (dm) at (2,-3.5) {};
  13. \node (bm) at (1,-1) {};
  14. \node (bm2) at (7,-1.875) {};
  15. \node (not3m) at (7,-2.5) {};
  16. \node (or1m) at (9,-.5) {};
  17. \node (and1m) at (9,-2) {};
  18. \node[not gate US, draw, logic gate inputs=n] at ($(2,-1)$) (not1) {\tiny NOT};
  19. \node[not gate US, draw, logic gate inputs=n] at ($(2,-2.5)$) (not2) {\tiny NOT};
  20. \node[or gate US, draw, logic gate inputs=nn] at ($(4,-.5)$) (or1) {\tiny OR};
  21. \node[xor gate US, draw, logic gate inputs=nn] at ($(4,-3)$) (xor1) {\tiny XOR};
  22. \node[not gate US, draw, logic gate inputs=n] at ($(6,-3)$) (not3) {\tiny NOT};
  23. \node[and gate US, draw, logic gate inputs=nn] at ($(8,-2)$) (and1) {\tiny AND};
  24. \node[or gate US, draw, logic gate inputs=nn] at ($(10,-1.5)$) (or2) {\tiny OR};
  25. \node[not gate US, draw, logic gate inputs=n] at ($(12,-1.5)$) (not4) {\tiny NOT};
  26. \draw (a.east) -| (am.center) |- (or1.input 1);
  27. \draw (b.east) -- (not1.input);
  28. \draw (not1.output) -| (not1m.center) node[below] {$r$} |- (or1.input 2);
  29. \draw (c.east) -- (not2.input);
  30. \draw (not2.output) -| (not2m.center) node[above] {$s$} |- (xor1.input 1);
  31. \draw (d.east) -| (dm.center) |- (xor1.input 2);
  32. \draw (b.east) -| (bm.center) node[circle, fill,inner sep=2pt] {} |- (bm2.center) node[above] {$u$} |- (and1.input 1);
  33. \draw (xor1.output) -- node[below] {$t$} (not3.input);
  34. \draw (not3.output) -| node[below] {$v$} (not3m.center) |- (and1.input 2);
  35. \draw (or1.output) -| (or1m.center) node[above] {$w$} |- (or2.input 1);
  36. \draw (and1.output) -| (and1m.center) node[below] {$x$} |- (or2.input 2);
  37. \draw (or2.output) -- node[below] {$y$} (not4.input);
  38. \draw (not4.output) -- (z);
  39. \end{tikzpicture}