I want to design a chip with some interior gates. Putting a gate inside the chip and connecting it to a chip's pin is easy and straitforward.

enter image description here

  • But how to move the pin numbers from inside to outside?
  • How to scale the chip lines only but not the pin numbers font?
  • How to align the gate output with a certain pin using the same basic length as used for pins positions?

1 Answer 1


The standard dimensions of components are chosen so that the distance between the inputs of a logic port is the same as the distance between chip pins. So you really need to scale one or another.

The safest way to scale a component is using its class options (see section 3.3 and following in the manual); the same for the line thickness. I used a global option for the thickness and a local one for the scale to show the two possibilities.

For the pin numbers, you can decide to hide them and add them manually do you can do whatever you like with them.


\usepackage[siunitx, RPvoltages]{circuitikz}


    logic ports=ieee,
    logic ports origin=center, % not needed for IEEE

% when using in a node, you have to prepend "circuitikz/"
\node[dipchip, num pins=16, hide numbers, circuitikz/chips/scale=2](C){};
% put the nand port: horizontally midway between pin 6 and 7
%                    vertically in the center of the chip 
\path ($(C.bpin 6)!0.5!(C.bpin 7)$) coordinate (midway-6-7)
      (midway-6-7 -| C.north) node[nand port](N1){};
% connect pins
\draw (C.bpin 6) -| (N1.in 1);
\draw (C.bpin 7) -| (N1.in 2);
\draw (C.bpin 9) -| (N1.out);

% external numbers
\foreach \pin in {1,...,8} \node[font=\tiny, above left] at(C.bpin \pin) {\pin};
\foreach \pin in {9,...,16} \node[font=\tiny, above right] at(C.bpin \pin) {\pin};


enter image description here

  • 1
    Thanks a lot for this excellent answer!
    – Uwe
    Feb 20, 2021 at 18:19
  • In the meantime, I prefer a horizontal orientation of the chip. I rotated both the chip and the gate and used C.center instead of C.north. But I need three levels for the gates, at C.center but also above and below it. Using C.west places the gate at the border of the chip, one half inside and the other outside. Is there a relative positioning between C.center and C.west? C.nw or C.sw does not help.
    – Uwe
    Feb 20, 2021 at 20:39
  • 1
    @Uwe, please create a new question with an minimal working example (MWE) --- I really can't understand what you problem is. Notice that it is important to check and understand calc and perpendicular coordinates from TikZ to be able to be fluent in circuitikz...
    – Rmano
    Feb 20, 2021 at 22:16
  • BTW, tex.stackexchange.com/help/someone-answers
    – Rmano
    Feb 20, 2021 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.