diff --git a/chapter 2.tex b/chapter 2.tex index d7d2915..5ecdd7a 100644 --- a/chapter 2.tex +++ b/chapter 2.tex @@ -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} - \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} \ No newline at end of file +\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}; + \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} \ No newline at end of file