X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=introduction.lhs;h=1066173ead0e57a02e95b5ebe66af5a10ce4294d;hb=715d9487c4e666cef21e89f0735d23a4f5ab2d27;hp=899c53450b682277efe228e228e88199ad7a0684;hpb=9f6a6587a2e51364cebce060cfc6ef9534b0bd2e;p=matthijs%2Fmaster-project%2Fhaskell-symposium-talk.git diff --git a/introduction.lhs b/introduction.lhs index 899c534..1066173 100644 --- a/introduction.lhs +++ b/introduction.lhs @@ -1,51 +1,43 @@ %include talk.fmt \section{Introduction} -\subsection{What will you see} -\frame -{ - \frametitle{What will we see?} - \begin{itemize} - \item Small tour: what can we describe in \clash{} - \item Quick real demo - \end{itemize} -} -\note{Virtuele demo} - \subsection{What is \texorpdfstring{\clash{}}{CLasH}} \frame { - \frametitle{What is \clash{}?} + \frametitle{What is \clash{}?}\pause \begin{itemize} - \item \clash{}: CAES Language for Hardware Descriptions - \item Rapid prototyping language - \item Subset of Haskell can be translated to Hardware (VHDL) + \item \clash{}: CAES Language for Hardware Descriptions\pause + \item Rapid prototyping language\pause + \item Subset of Haskell can be translated to Hardware (VHDL)\pause \item Structural Description of a Mealy Machine \end{itemize} } \note[itemize] { -\item Wij zijn wij -\item \clash{} voor rapid prototyping -\item Subset haskell vertaalbaar -\item Mealy machine beschrijving +\item We are a Computer Architectures group, this has been a 6 month project, no prior experience with Haskell. +\item \clash{} is written in Haskell, of course +\item \clash{} is currently meant for rapid prototyping, not verification of hardware desigs +\item Functional languages are close to Hardware +\item We can only translate a subset of Haskell +\item All functions are descriptions of Mealy Machines } \subsection{Mealy Machine} \frame { -\frametitle{Mealy Machine} +\frametitle{What again is a Mealy Machine?} \begin{figure} \centerline{\includegraphics[width=10cm]{mealymachine}} \label{img:mealymachine} \end{figure} } -\note{ -Voor wie het niet meer weet, dit is een mealy machine +\note[itemize]{ +\item Mealy machine bases its output on current input and previous state } \frame { \frametitle{Haskell Description} +\begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox} \begin{code} mealyMachine :: InputSignals -> @@ -53,19 +45,39 @@ mealyMachine :: (State, OutputSignals) mealyMachine inputs {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} = ({-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-}, output) where - {-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-} = logic {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} input + {-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-} = logic {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} input outputs = logic {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} input \end{code} +\end{beamercolorbox} +\begin{itemize} +\uncover<2->{\item Current state is part of the input} +\uncover<3->{\item New state is part of the output} +\end{itemize} } +\note[itemize]{ +\item State is part of the function signature +\item Both the current state, as the updated State +} + \subsection{Simulation} \frame { \frametitle{Simulating a Mealy Machine} +\begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox} \begin{code} run func {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} [] = [] run func {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} (i:input) = o:out where - ({-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-}, o) = func {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} i - out = run func {-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-} input + ({-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-}, o) = func i {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} + out = run func {-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-} input \end{code} -} \ No newline at end of file +\end{beamercolorbox} +\begin{itemize} +\item State behaves like an accumulator +\end{itemize} +} +\note[itemize]{ +\item This is just a quick example of how we can simulate the mealy machine +\item It sort of behaves like MapAccumN +} +