I just started creating a custom shape. Here the not too bad looking result:

Actually I only had little time and little TeX experience. I'll post it anyway, but be warned: There are dragons! Only brave souls may continue. Any tips and help is appreciated ;)
\documentclass{article}
\usepackage{etoolbox}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\usetikzlibrary{positioning}
\makeatletter
%TODO allow easier usage, like:
%\node[glogic={parameter=name,...}] {};
%TODO better input?
%TODO remove max values
\def\maxVPins{20}
\def\maxHPins{20}
\newcounter{pinCounter}
\def\getPinNumber#1{\csname #1Pin\Roman{pinCounter}\endcsname}
\tikzset{%
gLogic/pin spacing/.initial=3mm,
gLogic/contact length/.initial=10pt,
gLogic/horizontal pins/.initial=2,
gLogic/vertical pins/.initial=2,
gLogic/pin labels/.initial={},
gLogic/bottom text/.initial=\empty,
}
\pgfdeclareshape{gLogic}{
\savedanchor{\upperrightcorner}{
\pgf@y=.5\ht\pgfnodeparttextbox %
\pgf@x=.5\wd\pgfnodeparttextbox %
}
\anchor{text}{%
\upperrightcorner%
\pgf@x=-\pgf@x%
\pgf@y=-\pgf@y%
}
\anchor{center}{\pgfpointorigin}
\def\pinspacing{\noexpand\pgfkeysvalueof{/tikz/gLogic/pin spacing}}
\def\myWidth{\pinspacing*\noexpand\pgfkeysvalueof{/tikz/gLogic/horizontal pins}}
\def\myHight{\pinspacing*\noexpand\pgfkeysvalueof{/tikz/gLogic/vertical pins}}
%create some anchors to make the positioning library happy ;)
\edef\defineAnchors{%
\noexpand\deferredanchor{south west}{\noexpand\pgfpoint{-\myHight/2}{-\myWidth/2}}%
\noexpand\anchor{south}{\noexpand\pgfpoint{0pt}{-\myWidth/2}}%
\noexpand\anchor{south east}{\noexpand\pgfpoint{\myHight/2}{-\myWidth/2}}%
\noexpand\anchor{east}{\noexpand\pgfpoint{\myHight/2}{0pt}}%
\noexpand\anchor{north east}{\noexpand\pgfpoint{\myHight/2}{\myWidth/2}}%
\noexpand\anchor{north}{\noexpand\pgfpoint{0pt}{\myWidth/2}}%
\noexpand\anchor{north west}{\noexpand\pgfpoint{-\myHight/2}{\myWidth/2}}%
\noexpand\anchor{west}{\noexpand\pgfpoint{-\myHight/2}{0pt}}}
\defineAnchors
%TODO make this prettier...
\def\createAnchorsB{%
\noexpand\savedanchor\getPinNumber{b}{\noexpand\pgfpoint{\pinspacing * (\n-.5)-\myWidth/2}{-\myHight/2}}%
\noexpand\anchor{pinB\n}{\getPinNumber{b}}%
}
\def\createAnchorsT{%
\noexpand\savedanchor\getPinNumber{t}{\noexpand\pgfpoint{-\pinspacing * (\n-.5)+\myWidth/2}{\myHight/2}}%
\noexpand\anchor{pinT\n}{\getPinNumber{t}}%
}
\def\createAnchorsL{%
\noexpand\savedanchor\getPinNumber{l}{\noexpand\pgfpoint{-\myWidth/2}{-\pinspacing * (\n-.5)+\myHight/2}}%
\noexpand\anchor{pinL\n}{\getPinNumber{l}}%
}
\def\createAnchorsR{%
\noexpand\savedanchor\getPinNumber{r}{\noexpand\pgfpoint{\myWidth/2}{\pinspacing * (\n-.5)-\myHight/2}}%
\noexpand\anchor{pinR\n}{\getPinNumber{r}}%
}
%TODO remove max values and use the real values (some expansion problem)
\foreach \n in {1,...,\maxVPins} {
\pgfmathsetcounter{pinCounter}{\n}
\edef\expandThis{%
\createAnchorsL
\createAnchorsR
}
\expandThis
}
\foreach \n in {1,...,\maxHPins} {
\pgfmathsetcounter{pinCounter}{\n}
\edef\expandThis{%
\createAnchorsB%
\createAnchorsT
}
\expandThis
}
\foregroundpath{
\edef\myLabels{\pgfkeysvalueof{/tikz/gLogic/pin labels}}
%TODO look for a cleaner solution
\foreach \x [count=\n] in \myLabels {
\ifx \x\empty\else%don't draw connectors without label
\ifnumcomp{\n}{<}{\pgfkeysvalueof{/tikz/gLogic/horizontal pins}+1}{
%bootom row
\pgfmathsetcounter{pinCounter}{\n}
\pgfpathmoveto{\getPinNumber{b}}
\pgftext[top, right,at= \pgfpointadd{\pgfpoint{-1pt}{-1pt}}{\getPinNumber{b}}]{\scriptsize \x}
\pgfpathlineto{\pgfpointadd{\getPinNumber{b}}{\pgfpoint{0}{-\pgfkeysvalueof{/tikz/gLogic/contact length}}}}
}{\ifnumcomp{\n}{<}{\pgfkeysvalueof{/tikz/gLogic/horizontal pins}+\pgfkeysvalueof{/tikz/gLogic/vertical pins}+1}{
%right column
\pgfmathparse{\n-\pgfkeysvalueof{/tikz/gLogic/horizontal pins}};
\pgfmathsetcounter{pinCounter}{\pgfmathresult}
\pgftext[base, left,at= \pgfpointadd{\pgfpoint{2pt}{1pt}}{\getPinNumber{r}}]{\scriptsize \x}
\pgfpathmoveto{\getPinNumber{r}}
\pgfpathlineto{\pgfpointadd{\getPinNumber{r}}{\pgfpoint{\pgfkeysvalueof{/tikz/gLogic/contact length}}{0}}}
}{\ifnumcomp{\n}{<}{2*\pgfkeysvalueof{/tikz/gLogic/horizontal pins}+\pgfkeysvalueof{/tikz/gLogic/vertical pins}+1}{
%top row
\pgfmathparse{\n-\pgfkeysvalueof{/tikz/gLogic/horizontal pins}-\pgfkeysvalueof{/tikz/gLogic/vertical pins}};
\pgfmathsetcounter{pinCounter}{\pgfmathresult}
\pgftext[bottom, right, at=\pgfpointadd{\pgfpoint{-1pt}{1pt}}{\getPinNumber{t}}]{\scriptsize \x}
\pgfpathmoveto{\getPinNumber{t}}
\pgfpathlineto{\pgfpointadd{\getPinNumber{t}}{\pgfpoint{0}{\pgfkeysvalueof{/tikz/gLogic/contact length}}}}
}{\ifnumcomp{\n}{<}{2*\pgfkeysvalueof{/tikz/gLogic/horizontal pins}+2*\pgfkeysvalueof{/tikz/gLogic/vertical pins}+1}{
%left column
\pgfmathparse{\n-2*\pgfkeysvalueof{/tikz/gLogic/horizontal pins}-\pgfkeysvalueof{/tikz/gLogic/vertical pins}};
\pgfmathsetcounter{pinCounter}{\pgfmathresult}
\pgftext[base, right, at=\pgfpointadd{\pgfpoint{-2pt}{1pt}}{\getPinNumber{l}}]{\scriptsize \x}
\pgfpathmoveto{\getPinNumber{l}}
\pgfpathlineto{\pgfpointadd{\getPinNumber{l}}{\pgfpoint{-\pgfkeysvalueof{/tikz/gLogic/contact length}}{0}}}
}{}}}}\fi%closing all the ifs ;-/
}
%TODO don't define them twice with different expanding behaviours?
\def\myWidth{\pgfkeysvalueof{/tikz/gLogic/horizontal pins}%
*\pgfkeysvalueof{/tikz/gLogic/pin spacing}}
\def\myHight{\pgfkeysvalueof{/tikz/gLogic/vertical pins}%
*\pgfkeysvalueof{/tikz/gLogic/pin spacing}}
\pgftext[bottom, at=\pgfpoint{-0pt}{-\myHight/2+2pt}]{\footnotesize \pgfkeysvalueof{/tikz/gLogic/bottom text}}
% rectangle around the logic gate
\pgfpathrectanglecorners{\pgfpoint{-\myWidth/2}{-\myHight/2}}%
{\pgfpoint{\myWidth/2}{\myHight/2}}
\pgfusepath{draw}% draw all the lines :D
}
}
\makeatother
\begin{document}
\def\labels{A,B,C,D,E, F, G, H, I, J,K, L, M, N,O, P, Q, R, S, T}
\begin{tikzpicture}[circuit ee IEC]
\node[gLogic, gLogic/pin spacing=7mm, gLogic/horizontal pins=3, gLogic/pin labels={A,B,~,D,,F}] (IC1) {funny IC};
\node[gLogic, gLogic/pin spacing=5mm, gLogic/horizontal pins=4, gLogic/vertical pins=6, gLogic/pin labels=\labels, gLogic/bottom text=IC-42-42, above right=3 of IC1] (IC2) {IC};
\draw (IC1.pinR1) to [diode={light emitting, name=LED}] ($(IC1.pinR1)+(2,0)$) -| (IC2.pinB4);
\end{tikzpicture}
\end{document}
Y_2;) – Tom Bombadil Nov 24 '13 at 04:05