逻辑门的多个输入

逻辑门的多个输入

在里面手动的, 部分5.1.1 Logical ports

除非逻辑端口外,所有逻辑端口都有两个输入和一个输出。

似乎输入仅限于两个。我找到的所有解决方案都是使用or gate US而不是american nor port新更新中的命令。在我的案例中,我需要在以下案例中添加三个输入,

在此处输入图片描述

\documentclass[border={10pt}]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[siunitx,european,american]{circuitikz}
\usetikzlibrary{circuits.logic.US,circuits.logic.IEC}
\begin{document}
\begin{tikzpicture}
    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        block/.style={fill=blue!20,draw=red!70,thick,minimum width=3cm,minimum height=3.5cm}
    ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw (0,0)
  node[block] (P1) {block} 
  ($(P1.north)$) coordinate (P1n)
  ($(P1.south)$) coordinate (P1s)
  ($(P1.east)$)  coordinate (P1e)
  (P1n) to[short,-o] ++(0, .2) coordinate (p1n) node[left] {$p1$}
  (P1s) to[short,-o] ++(0,-.2) coordinate (p1s) node[left] {$p2$}
  (P1e) to[short,-o] ++(0,0) coordinate (p1e) node[left]   {$p3$}
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  (P1) ++(4,0)  node[american nor port] (And1) {}
  (p1n) -|  (And1.in 1) (p1s) -| (And1.in 2); 

\end{tikzpicture}
\end{document}

答案1

你说得对。这个组件的一些锚点位于奇怪的位置。

\documentclass[border={10pt}]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[siunitx,european,american]{circuitikz}
\usetikzlibrary{circuits.logic.US,circuits.logic.IEC,calc}
\begin{document}
\begin{tikzpicture}
    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        block/.style={fill=blue!20,draw=red!70,thick,minimum width=3cm,minimum height=3.5cm}
    ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\draw (0,0)
  node[block] (P1) {block} 
  ($(P1.north)$) coordinate (P1n)
  ($(P1.south)$) coordinate (P1s)
  ($(P1.east)$)  coordinate (P1e)
  (P1n) to[short,-o] ++(0, .2) coordinate (p1n) node[left] {$p1$}
  (P1s) to[short,-o] ++(0,-.2) coordinate (p1s) node[left] {$p2$}
  (P1e) to[short,-o] ++(0,0) coordinate (p1e) node[left]   {$p3$}
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  (P1) ++(4,0)  node[american nor port] (And1) {}
  (p1n) -|  (And1.in 1) (p1s) -| (And1.in 2)
  (P1e) -- ($(And1.west)!0.33!(And1.east)$);

\end{tikzpicture}
\end{document}

演示

相关内容