From b1e3e585f43c6721d3ee5834eff5170c0a853f10 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Fri, 19 Jul 2024 16:26:21 -0500 Subject: [PATCH] Minor tweaks and added a note or two. --- chapter 2.tex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chapter 2.tex b/chapter 2.tex index 4a92372..26f8d89 100644 --- a/chapter 2.tex +++ b/chapter 2.tex @@ -20,14 +20,15 @@ \usetikzlibrary{decorations.pathreplacing} \section{Encoding Scheme} -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 +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{tikzpicture} \draw (\minX, 0) -- (\maxX, 0); \draw (\minX, \minY / 2) -- (\minX, \maxY / 2); %{$y$}; Note the $'s, those make something math stylized. - \draw (\maxX, \minY / 2) -- (\maxX, \maxY / 2); \draw (0, \minY / 2) -- (0, \maxY / 2); % Halfway mark + \draw (\maxX, \minY / 2) -- (\maxX, \maxY / 2); \draw (\minX, -\maxY) node[below=1em] {31} [decorate, decoration={brace, amplitude=1em, mirror}] -- (0, -\maxY) node[below=1em] {16} node[midway, below=1em] {Op Code (16-bits)}; \draw (0, \maxY) node[above=1em] {15} [decorate, decoration={brace, amplitude=1em}] -- (\maxX, \maxY) node[above=1em] {0} node[midway, above=1em] {Near Address (16-bits)}; \end{tikzpicture} @@ -38,9 +39,9 @@ There are two basic encoding schemes that the object code will take. The most ba \begin{tikzpicture} \draw (\minX, 0) -- (\maxX, 0); \draw (\minX, \minY / 2) -- (\minX, \maxY / 2); %{$y$}; Note the $'s, those make something math stylized. - \draw (\maxX, \minY / 2) -- (\maxX, \maxY / 2); \draw (0, \minY / 2) -- (0, \maxY / 2); % Halfway mark - \draw [dotted] (\maxX / 2, \minY / 2) -- (\maxX / 2, \maxY / 2); % Halfway mark for the lower 16 bits + \draw (\maxX, \minY / 2) -- (\maxX, \maxY / 2); + \draw (\maxX / 2, \minY / 2) -- (\maxX / 2, \maxY / 2); % Halfway mark for the lower 16 bits \draw (\minX, -\maxY) node[below=1em] {31} [decorate, decoration={brace, amplitude=1em, mirror}] -- (0, -\maxY) node[below=1em] {16} node[midway, below=1em] {Op Code (16-bits)}; \draw (0, \maxY) node[above=1em] {15} [decorate, decoration={brace, amplitude=1em}] -- (\maxX / 2, \maxY) node[above=1em] {8} node[midway, above=1em] {Destination}; \draw (\maxX / 2, -\maxY) node[below=1em] {7} [decorate, decoration={brace, amplitude=1em, mirror}] -- (\maxX, -\maxY) node[below=1em] {0} node[midway, below=1em] {Source};