Files
lang/chapter 2.tex
T

31 lines
1.7 KiB
TeX

\chapter{Instruction Set Architecture}
\section{Encoding Schemes}
\def\minY{0} \def\maxY{0.5}
\def\minX{-7} \def\maxX{7}
\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}