Updated the figure for instruction encoding, mostly just example code for more proper figures.

This commit is contained in:
2024-07-18 00:24:44 -05:00
parent 51c79d74aa
commit b6b340fd62
+25 -4
View File
@@ -1,10 +1,31 @@
\chapter{Instruction Set Architecture}
\section{Encoding}
\section{Encoding Schemes}
\def\minY{0} \def\maxY{0.5}
\def\minX{-7} \def\maxX{7}
\begin{tikzpicture}
\usetikzlibrary{decorations.pathreplacing}
\begin{figure}[!htb]
\begin{tikzpicture}
\draw (\minX, \minY) -- (\maxX, \minY);
\draw (\minX, \minY) -- (\minX, \maxY) node[above] {31}; %{$y$}; Note the $'s, those make something math stylized.
\draw (\maxX, \minY) -- (\maxX, \maxY) node[above]{0};
\end{tikzpicture}
\draw (\maxX, \minY) -- (\maxX, \maxY) node[above] {0};
\draw (0, \minY) -- (0, \maxY) node[above] {15};
\draw [dotted] ({\maxX / 2}, \minY) -- ({\maxX / 2}, \maxY) node[above] {7};
\draw [decorate, decoration={brace, amplitude=1em, mirror}] (\minX, -\maxY) -- (0, -\maxY) node[midway, below=1em] {Op Code (16-bits)};
\draw [decorate, decoration={brace, amplitude=1em, mirror}] (0, -\maxY) -- ({\maxX / 2}, -\maxY) node[midway, below=1em] {Destination (8-bits)};
\draw [decorate, decoration={brace, amplitude=1em, mirror}] ({\maxX / 2}, -\maxY) -- (\maxX, -\maxY) node[midway, below=1em] {Source (8-bits)};
\end{tikzpicture}
\caption{Register Based Opcodes}
\end{figure}
\begin{figure}[!htb]
\begin{tikzpicture}
\draw (\minX, \minY) -- (\maxX, \minY);
\draw (\minX, \minY) -- (\minX, \maxY) node[above] {31}; %{$y$}; Note the $'s, those make something math stylized.
\draw (\maxX, \minY) -- (\maxX, \maxY) node[above] {0};
\draw (0, \minY) -- (0, \maxY) node[above] {15};
\draw [decorate, decoration={brace, amplitude=1em, mirror}] (\minX, -\maxY) -- (0, -\maxY) node[midway, below=1em] {Op Code (16-bits)};
\draw [decorate, decoration={brace, amplitude=1em, mirror}] (0, -\maxY) -- (\maxX, -\maxY) node[midway, below=1em] {Near Address (16-bits)};
\end{tikzpicture}
\caption{Short Valued Opcodes}
\end{figure}