Here is simple example using a \pic
for the rectangles and numbered colors to make the code brief.
\documentclass[tikz,border=2mm]{standalone}
% colors
\definecolor{color0}{HTML}{999999} % gray
\definecolor{color1}{HTML}{FF0000} % red
\definecolor{color2}{HTML}{0000FF} % blue
\definecolor{color3}{HTML}{00FF00} % green
\definecolor{color4}{HTML}{FF9999} % light red
\tikzset
{
pics/my rectangle/.style={% #1 -> list of numbers (colors)
code={%
\foreach[count=\j]\i in {#1}
\fill[color\i] (0.2*\j,0) rectangle (0.2*\j+0.18,0.5);
\coordinate (-label) at (3.39,-0.3);
}},
}
\begin{document}
\begin{tikzpicture}
\pic (A) at (0,0) {my rectangle={0,0,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
\node at (A-label) {$0-31$};
\pic (B) at (8,0) {my rectangle={0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
\node at (B-label) {$32-63$};
\end{tikzpicture}
\end{document}
Best Answer
as starting point:
here on site is many similar questions with answers. you should fist search for similar ones and try to draw an adoption to your need. also helps reading of tikz & pgf manual, for start a tutorials ...
arrows.meta
is for drawing arrowspositioning
is for positioning of nodesquotes
is for labeling of arrows. syntax for this is["<label text>"]
. optionswap
move label on oposite side of arrowbend right
is for bending lines (to right side)