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}
+1 -3
View File
@@ -17,13 +17,11 @@
\def\minY{-1.5em} \def\maxY{1.5em}
\def\minX{-7} \def\maxX{7}
\usetikzlibrary{decorations.pathreplacing}
\section{Encoding Scheme}
All instructions are a fixed width of 32-bits. There are two basic encoding schemes that the object code will take. The most basic layout is shown in Figure \ref{fig:OpShortEncodingFigure} that is used by instructions that take one or zero arguments, where the 16 most significant bits are used to encode the instruction itself. Followed by the 16 least significant bits being used to encode a numeric constant that may be interpreted as a relative address. For instructions that require two arguments the encoding scheme shown in Figure \ref{fig:OpArgEncodingFigure} is used.
% Placement info here: https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures
% Paths: https://tikz.dev/tikz-paths
\begin{figure}[h]
\begin{figure}
\begin{tikzpicture}
\draw (\minX, 0) -- (\maxX, 0);
\draw (\minX, \minY / 2) -- (\minX, \maxY / 2); %{$y$}; Note the $'s, those make something math stylized.
+2
View File
@@ -2,6 +2,8 @@
\usepackage{tabularx}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{fit}
\usepackage{hyperref}
\hypersetup{
linktoc=all