Started to mess around with setting up the figure for the layout of the registers and main memory.

This commit is contained in:
Garritt McCune
2024-07-22 16:09:00 -05:00
parent b1e3e585f4
commit 1b9910e908
3 changed files with 21 additions and 18 deletions
+18 -15
View File
@@ -8,22 +8,25 @@ Eight 32-bit general purpose registers are available for holding operands and me
Finally we have the Program Counter which contains a 32 bit address that points to the next instruction to execute.
\tikzstyle{blockRow} = [rectangle, minimum width=10cm, minimum height=0.5cm, text centered, draw=black]
%Note: tikzset might be better to use instead of tikzstyle.
\tikzset{
Rect/.style = {rectangle, fill=red!10!white}
}
\begin{figure}[!htb]
%\centering
\begin{tikzpicture}
\node at (1 ,0) {31};
%\node [Rect] at (0, 2) {test};
%\node at (0, )
\def\minY{-5} \def\maxY{5}
\def\minX{-5} \def\maxX{5}
\begin{figure}[h]
\centering
\begin{tikzpicture}[node distance=0cm]
\node [draw, fit={(\minX, 0) (0, 0.5)}, label=center:Status Register (Flags)] (flags) {};
%\draw (\minX,0.5) node[above=1em] {31} rectangle (0, 1) node[midway] {Status Register (Flags)} node[above] (lsb) {0};
\draw (flags);
\node[above left=of flags] {31};
\node[above right=of flags] {0};
%\draw (\minX,-\pos / 2 - 0.5) rectangle (0, -\pos / 2) node[midway] (register1) {r1};
\foreach \pos in {1,...,8} {
%\node at (0, \pos + 1) [blockRow] (\pos) {\pos};
\node at (0, \pos - 1) [blockRow] {r\pos};
;}
%\node [blockRow] (start) {r1};
%\node (r2) [blockRow] [below=of start] {r2};
\draw (\minX,-\pos / 2 - 0.5) rectangle (0, -\pos / 2) node[midway] (register\pos) {r\pos};
}
%\draw node[above=of register1] {General Purpose Registers};
\draw (\maxX / 2, 1) rectangle (\maxX, \minY) node[midway] {Memory};
\end{tikzpicture}
\caption{Register Bit Layout}
\end{figure}