
Here's how to do it in tikz:
\documentclass[tikz, border=20]{standalone}
\begin{document}
\begin{tikzpicture}
% Grid
\draw[step=0.5] (0, 0.99) grid (8, 3);
\foreach \x in {0, 0.5, ..., 8} {
\draw (\x, 1) -- (\x, 0);
}
% Memory Labels
\foreach \a/\x in {0/0, 1/1, 2/2, 3/3, 4/4, 5/5, 6/6, 7/7, 8/8, 9/9, A/10, B/11, C/12, D/13, E/14, F/15} {
\node at ({0.5*(\x+0.5)}, 3.25) {\texttt{\a}};
}
\foreach \a/\y in {0x00/0, 0x10/1, 0x20/2, 0x30/3} {
\node at (-0.5, {3-0.5*(\y+0.5)}) {\texttt{\a}};
}
\node at (-0.5, 0.75) {\(\vdots\)};
\tikzset{block/.style={rounded corners, #1, fill=#1!50, opacity=0.8}}
\pgfmathsetmacro{\offset}{0.05}
% Coloured lines
\draw[block=yellow] (0 + \offset, 2.5 + \offset) rectangle (0.5 - \offset, 3 - \offset);
\draw[block=red] (0.5 + \offset, 2.5 + \offset) rectangle (6.5 - \offset, 3 - \offset);
\draw[block=green] (6.5 + \offset, 2.5 + \offset) rectangle (8 - \offset, 3 - \offset);
\draw[block=green] (0 + \offset, 2 + \offset) rectangle (4.5 - \offset, 2.5 - \offset);
\draw[block=blue] (4.5 + \offset, 2 + \offset) rectangle (8 - \offset, 2.5 - \offset);
\draw[block=blue] (0 + \offset, 1.5 + \offset) rectangle (8 - \offset, 2 - \offset);
\draw[block=blue] (0 + \offset, 1 + \offset) rectangle (1.5 - \offset, 1.5 - \offset);
\draw[block=purple] (1.5 + \offset, 1 + \offset) rectangle (5.5 - \offset, 1.5 - \offset);
% Message labels
\node at (0.25, 2.75) {\(\star\)};
\node[right] at (0.5, 2.7) {\texttt{Message 1}};
\node[right] at (6.5, 2.7) {\texttt{M2}};
\node[right] at (0, 2.2) {\texttt{Message 2}};
\node[right] at (4.5, 2.2) {\texttt{Message 3}};
\node[right] at (0, 1.7) {\texttt{Message 3}};
\node[right] at (0, 1.2) {\texttt{M3}};
\node[right] at (1.5, 1.2) {\texttt{Message 4}};
% Config byte label
\draw[block=yellow] (8.5 + \offset, 2.5 + \offset) rectangle (11.5 - \offset, 3 - \offset);
\node[below right] at (8.5, 3) {\parbox{2.75cm}{\(\star\) Config Byte: Stores number of messages}};
% Title
\node at (4, 4) {EEPROM Memory---256 bytes};
\end{tikzpicture}
\end{document}
This is a very manual way to do it though. If you wanted to do something much bigger than this then you would be best off defining some more nodes.
pstricksand in particular itspst-nodemodule. – Bernard Jul 26 '21 at 14:41