From: Matthijs Kooijman Date: Mon, 14 Dec 2009 09:58:57 +0000 (+0100) Subject: Merge git://github.com/christiaanb/thesispresentation X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=9246a7cdb2a903798eb1719cbd6df1753ee61ee9;p=matthijs%2Fmaster-project%2Ffinal-presentation.git Merge git://github.com/christiaanb/thesispresentation * git://github.com/christiaanb/thesispresentation: Higlight code Notities toegevoegd --- 9246a7cdb2a903798eb1719cbd6df1753ee61ee9 diff --cc matthijs/introduction.lhs index 369ab79,37a12cd..7aff0cf --- a/matthijs/introduction.lhs +++ b/matthijs/introduction.lhs @@@ -112,99 -112,15 +112,99 @@@ \frame { - TODO: Impure (stateful) example. + \frametitle{Multiply-accumulate} + \begin{columns} + \begin{column}{5cm} + \begin{block}{} + \begin{tabular}{lll} + Input A & Input B & Output \\ + \hline + 1 & 1 & 0 \\ + 1 & 2 & 1 \\ + 1 & 1 & 3 \\ + 2 & 2 & 4 \\ + \end{tabular} + \end{block} + \end{column} + \begin{column}{5cm} + \begin{figure} + TODO: Image of MAC with internal register + \end{figure} + \end{column} + \end{columns} +} + +\note[itemize] +{ + \item Next sheet: MAC circuit and I/O values + \item MAC is common circuit + \item Multiplies pairs, one pair at a time + \item Stores sum so far + \item Not pure! + \item Depends on inputs \emph{and} current register value + \item Solution: Put register value (state) in argument } +\frame +{ + \frametitle{Multiply-accumulate} + \begin{columns} + \begin{column}{5cm} + \begin{block}{} + \vspace{-0.5cm} +\begin{verbatim} +mac (a, b) (State s) = let + sum = s + (a * b) +in (State sum, sum) +\end{verbatim} + \end{block} + \end{column} + \begin{column}{5cm} + \begin{figure} + TODO: Image of MAC with external register + \end{figure} + \end{column} + \end{columns} +} + +\note[itemize] +{ + \item Next sheet: MAC implementation + \item Current state as argument (annotated) + \item Two parts in the result: New state and output + \item Register is placed ``outside'' + \item We want it inside! + \item Annotation allows compiler to put it inside +} + +\begin{frame}[fragile] + \frametitle{Simulating} + + \begin{block}{Recursive run function} + run f (i:is) s = let + (o, s') = f i s + in o : (run f is s') + \end{block} + + \begin{block}{Remember \texttt{mac}} +\vspace{-0.5cm} +\begin{verbatim} +mac (a, b) (State s) = let + sum = s + (a * b) +in (State sum, sum) +\end{verbatim} + \end{block} +\end{frame} + \note[itemize] { - \item TODO + \item Next sheet: run function + \item Used for simulation only + \item Recursion ``stores'' state + \item Each recursion step, \texttt{f} is evaluated once. } - \subsection{\clash} + \subsection{\texorpdfstring{\clash{}}{CLasH}} \frame{ \begin{center}