In honor of the attention to detail you put in making your examples, here is an implementation that also seeks to resemble the result you are looking for... Although at first it is difficult to understand the code because there are many ways to do the same thing with different coding, but then you will learn some good practices along the way... one of these is knowing what things each line does and for that in my case the VisualTikz manual made it much easier to undrstand for me, here you can see the code and result, something that helped me a lot.
Some important things that are useful are first to choose a unit of work for the x
and y
coordinates, in this case use em
which is relative to the size of the text, then for the node styles you must keep in mind that you can manage their size whenever the text does not exceed the minimum dimensions
that can be set, then there is the override of the inner separation
dimension which is the distance from the shape box to the text, and as always it is important to use node names to be able to place other nodes using their relative points.
It is also good to work with help lines to know what is happening.
RESULT:
MWE:
\documentclass[border=0pt,tikz]{standalone}
\usetikzlibrary{arrows.meta,backgrounds,positioning,shapes.symbols}
\usepackage{emerald}
\usepackage[T1]{fontenc}
\definecolor{BGcolor1}{HTML}{D5D0CC}
\definecolor{BGcolor2}{HTML}{898987}
\begin{document}
\begin{tikzpicture}[
x=1em,
y=1em,
>={Stealth[inset=0pt,length=0.5em]},
font=\ECFAugie\tiny,
line width=0.1pt,
fill opacity=0.2,
text opacity=1,
P/.style 2 args={
draw,
thick,
rectangle,
minimum height=#2em,
minimum width=#1em,
inner sep=0,
outer sep=0,
anchor=south west,
font=\ECFAugie,
align=center
},
background rectangle/.style={%By background library
rectangle,
shade,
top color=BGcolor1,
bottom color=BGcolor2,
shading angle=85
},show background rectangle% To show the rackground.
]
%Start drawing the thing...
% Help lines to plan where put all:
\def\wcanvas{30}
\def\hcanvas{25}
\draw[gray!70!black,step=1em] (-0.5,-0.5) grid (\wcanvas,\hcanvas);
\foreach \x in {0, ..., \wcanvas} {%
\draw(\x,-0.9) node {\x};
}
\foreach \y in {0, ..., \hcanvas} {%
\node at (-0.9,\y*1) {\y};
}
% The first arrow
\draw[->,thick](1,7) node[anchor=0,rotate=90]{\small Address} -- +(0,8);
%Nodes See https://tug.ctan.org/info/visualtikz/VisualTikZ.pdf#section.7
%and https://tug.ctan.org/info/visualtikz/VisualTikZ.pdf#section.17
\draw(5,1) node[P={8}{3},fill=green!50!orange](M0){M0}; %Absolute coodinate
\draw(5,1+3) node[P={8}{3},fill=purple](M1){M1}; %Coordinte using arithmetic operators
\node[P={8}{5},fill=red!50!black,above=0 of M1](M2){M2, with long \\ text describing \\ something}; % using positioning.
\node[P={8}{3},fill=blue!50!cyan,above=0 of M2](M3){M3};
\node[P={8}{3},fill=yellow,above=0 of M3](M4){M4};
%Special nodes from https://tug.ctan.org/info/visualtikz/VisualTikZ.pdf#subsection.17.3
\node[P={8}{2},tape,tape bend bottom= none,fill=black,above=-0.25 of M4](VOID-1){};
\node[P={8}{3.5},tape,tape bend top= none,fill=orange!50!black,above=1+0.25 of VOID-1](TOP){TOP};
% the second column...
\node[P={8}{2},fill=green!50!yellow,right=5 of M0.south east, anchor=south west](R1){Region 1};%positioning erases first anchor defined by P style
\node[P={8}{2},fill=green!50!black,above=0 of R1](R2){Region 2};
\node[P={8}{3},fill=green!50!orange,above=0 of R2](R3){Also long text \\ Region 3};
\node[P={8}{1.25},tape,tape bend bottom= none,fill=black,above=-0.25 of R3](VOID-2){};
\node[P={8}{1.25},tape,tape bend top= none,fill=black,above=1+0.25 of VOID-2](VOID-3){};
\node[P={8}{2},fill=red!50!white,above=0 of VOID-3](RX){Region X};
\node[P={8}{1.25},tape,tape bend bottom= none,fill=black,above=-0.25 of RX](VOID-4){};
%Then draw some text based in nodenames and anchors
\def\one{\,\,\,1\,\,}%this is only to manage text separation for this font.
\foreach \RegText/\PositoningReference/\NodeAnchor/\TextAlign in {
0x000/M0.south west/south east/left,
0x\one00/M0.north west/north east/left,% Change \one for 1 in normal font.
0x\one0\one/M1.south west/south east/left,% Change \one for 1 in normal font.
0x200/M1.north west/north east/left,
0x20\one/M2.south west/south east/left,% Change \one for 1 in normal font.
0x500/M2.north west/north east/left,
0x50\one/M3.south west/south east/left,% Change \one for 1 in normal font.
0x600/M3.north west/north east/left,
0x60\one/M4.south west/south east/left,% Change \one for 1 in normal font.
0x700/M4.north west/north east/left,
0xTop/TOP.north west/north east/left,
\one G/M0.south east/south east/left,% Change \one for 1 in normal font.
2 G/M1.south east/south east/left,
\one G/M2.south east/south east/left,% Change \one for 1 in normal font.
\one G/M3.south east/south east/left,% Change \one for 1 in normal font.
1 M/R1.south west/south west/right,
1 M/R2.south west/south west/right,
1 M IN/R3.south west/south west/right,
\quad Low\one/R1.south east/south west/left,% Change \one for 1 in normal font.
\quad Up\one/R1.north east/north west/left,% Change \one for 1 in normal font.
\quad Low 2/R2.south east/south west/left,
\quad Up 2/R2.north east/north west/left,
\quad Low 3/R3.south east/south west/left,
\quad Up 3/R3.north east/north west/left,
\quad Low X/RX.south east/south west/left,
\quad Up X/RX.north east/north west/left% This percent symbol is necessary to make this arrangement of code
}{
\draw(\PositoningReference) node[align=\TextAlign,anchor=\NodeAnchor,xscale=0.65, inner ysep=0.1em]{\scriptsize\RegText};
}
%Drawing the dash lines
\foreach \RefStart/\RefEnd in {
M0.south east/R1.south west,
M0.south east/R3.north west,
M2.7/RX.south west,% Nodename.angle: gives a point in the shape from the angle ray from node.center.
M2.20/RX.north west%
}{
\draw[dashed, thick](\RefStart)--(\RefEnd);
}
\end{tikzpicture}
\end{document}