uni

Thing1's amazing uni repo
Log | Files | Refs | Submodules

commit 784e34da8d2b08c15b96c564f1f78e00add9652e
parent 5452e4be8794caafc2959e4104007a01934f5a7c
Author: thing1 <thing1@seacrossedlovers.xyz>
Date:   Fri, 15 May 2026 17:14:09 +0100

stated crib sheet

Diffstat:
ACS10720/crib/Makefile | 8++++++++
ACS10720/crib/crib.tex | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/CS10720/crib/Makefile b/CS10720/crib/Makefile @@ -0,0 +1,8 @@ +crib.pdf: crib.tex + pdflatex crib.tex +monitor: crib.pdf + zathura crib.pdf & +clean: + rm *.pdf *.aux *.log + +.PHONY: monitor clean diff --git a/CS10720/crib/crib.tex b/CS10720/crib/crib.tex @@ -0,0 +1,93 @@ +\documentclass[a4paper,10pt,twocolumn]{article} +\usepackage[a4paper, total={6in, 8in}]{geometry} +\usepackage[table]{xcolor} +\usepackage{titling} +\usepackage{titlesec} + +\geometry{a4paper,left=5mm,right=5mm,top=5mm,bottom=5mm} + +\titleformat{\section} {\small} {\thesection: } {0em} {}[] +\titleformat{\subsection} {\small} {\thesubsection: } {0em} {}[] +\titleformat{\subsubsection} {\small} {\thesubsubsection: } {0em} {} [] + +\begin{document} +\section{Question 1} +\subsection{Part 1} +Numbers + +\subsubsection{signed magnitude} +Very simple, has sign bit at start, causes 2 versions of 0 (-0, 0) + +\begin{tabular}{| c | c | c | c | c | c | c | c |} + \hline + 1 \cellcolor{red!40}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}\\ + \hline +\end{tabular} + +\subsubsection{1's complement} +\textbf{MSB} is the complement of what you'd expect minus 1 ($ 128 \rightarrow -12 $ for 8 bit), also has double 0 + +\begin{tabular}{| c | c | c | c | c | c | c | c |} + \hline + 1 \cellcolor{green!40}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}\\ + \hline +\end{tabular} + +\subsubsection{2's complement} +\textbf{MSB} is the complement of what you'd expect ($ 128 \rightarrow -128 $ for 8 bit), and add 1 to the final number to avoid double 0 + +\begin{tabular}{| c | c | c | c | c | c | c | c |} + \hline + 1 \cellcolor{green!40}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}\\ + \hline +\end{tabular} + +\subsubsection{Excess} +Standard binary, with a shift (bias), subtracted from the number ( $ b=8, 1111 \rightarrow 7 $, $ 1111 $ is normally $ 15 $, but $ 15 - 8 = 7 $), no double 0 + +\begin{tabular}{| c | c | c | c | c | c | c | c |} + \hline + 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}\\ + \hline +\end{tabular} + +\subsubsection{Convertions} + +\begin{tabular}{| c | c | c |} + \hline + \textbf{From} & \textbf{To} & \textbf{How} \\ \hline + 1's & 2's & just add 1 \\ \hline + 2's & 1's & just sub 1 \\ \hline + other & other & convert to dec, then back \\ \hline +\end{tabular} + +\subsection{Part 2} +\subsubsection{IEEE 754} +16 bits, 1 sign bit, 5 bit exponent (excess), 10 bit mantissa (standard). +Leading 1 is dropped from mantissa, (number is always 1.10101... so we shorten to .10101) + +\begin{tabular}{| c | c | c | c | c | c | c | c | c | c | c | c | c | c | c | c |} + \hline + 1 \cellcolor{red!40}& 1 \cellcolor{green!30}& 1 \cellcolor{green!30}& 1 \cellcolor{green!30}& 1 \cellcolor{green!30}& 1 \cellcolor{green!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}& 1 \cellcolor{blue!30}\\ + \hline +\end{tabular} + +\subsubsection{Comparison} +\begin{itemize} + \item NaN can't be compared, all operations involving it are \textbf{false} + \item $ + \infty $ is always \textbf{bigger} than any number + \item $ - \infty $ is always \textbf{smaller} than any number + \item $ +0 == -0 $ is always \textbf{true} +\end{itemize} + +\subsection{Part 3} +multiply the matrix \textit{\textbf{BUH}} +\section{Question 2} +\subsection{Part 1} +\subsection{Part 2} +\subsection{Part 3} +\section{Question 3} +\subsection{Part 1} +\subsection{Part 2} +\subsection{Part 3} +\end{document}