I am designing memory layout of primitive data types such as int showing 8 bits. Below is the code snippet-
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix, positioning, calc}
\begin{document}
\begin{tikzpicture}[node distance=0mm,every node/.style={inner sep=1mm, font=\tiny}]
\node [draw, matrix] (a)
{
\foreach \x in {0,1,...,7} {\fill[black] (\x mm, 0.0) circle (1pt);}\\
};
\node [draw, matrix,right=of a](b)
{
\foreach \x in {0,1,...,7} {\fill[black] (\x mm, 0.0) circle (1pt);}\\
};
\node [draw, matrix,right=of b](c)
{
\foreach \x in {0,1,...,7} {\fill[black] (\x mm, 0.0) circle (1pt);}\\
};
\node [draw, matrix,right=of c](d)
{
\foreach \x in {0,1,...,7} {\fill[black] (\x mm, 0.0) circle (1pt);}\\
};
\node[below=of $(a)!0.5!(d)$, yshift=-1mm] (plus) {label goes here};
\end{tikzpicture}
\end{document}
This is how generated diagram looks-

Is it possible to shorten the code? For example, just by encapsulating few nodes, I think it can be done. Any leads, please?



\pic. It seems a nice way to utilize\pic. Thank you very much! – ravi May 09 '18 at 03:22