I want to draw a CPU register set as shown at my hand-made concept draw:
My LaTeX source so far is:
\documentclass[tikz,border=0pt]{standalone}
\usepackage{xstring}
\StrLen{Register Rx}[\RegStrLen]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[
font=\sffamily
]
\matrix[%draw,
row 1/.style={nodes={text height=0},font=\scriptsize},draw=none,
column 1/.style={nodes={draw}},
column 2/.style={nodes={draw,minimum width=\RegStrLen}},
column 3/.style={nodes={draw,minimum width=\RegStrLen}}
]
{
%
\node[anchor=east] {31}; & & \node[anchor=west] {0}; \\
& \node {R0}; \\
& \node {R1}; \\
& \node {R2}; \\
& \node {R3}; \\
& \node {R4}; \\
};
\end{tikzpicture}
\end{document}
It fails to get the right border drawn around the R(egister)-labeled columns, where the first column doesn't have it. The MSB und LSB (31 und 0) shall be aligned to the left, resp. right side.
Getting curly braces – I also failed 🙁 As well as to draw the so-called shadow-registers A and B, the text around …
Not the AI help of CoCalc, the VisualTikZ nor PGF Manual gave me a hint how to accomplish my task/wish. I also searched at StackExchange for those solution hints without results.
At least the fontsize of the first column looks promising 🙂
So, what could be a solution using TikZ?
Best Answer
Something like this?
As starting point: