Improve presentation, based on comments.
[matthijs/master-project/haskell-symposium-talk.git] / introduction.lhs
1 %include talk.fmt
2 \section{Introduction}
3 \subsection{What is \texorpdfstring{\clash{}}{CLasH}}
4 \frame
5 {
6   \frametitle{What is \clash{}?}\pause
7   \begin{itemize}
8     \item \clash{}: CAES Language for Hardware\pause
9     \item Rapid prototyping language\pause
10     \item Subset of Haskell can be translated to Hardware (VHDL)\pause
11     \item Structural Description of the logic part of a Mealy Machine
12   \end{itemize}
13 }
14 \note[itemize]
15 {
16 \item We are a Computer Architectures group, this has been a Masters' project, no prior experience with Haskell.
17 \item \clash{} is written in Haskell, of course
18 \item \clash{} is currently meant for rapid prototyping, not verification of hardware desigs
19 \item Functional languages are close to Hardware
20 \item We can only translate a subset of Haskell
21 \item All functions are descriptions of Mealy Machines
22 }
23
24 \subsection{Mealy Machine}
25 \frame
26 {
27 \frametitle{What is a Mealy Machine again?}
28   \begin{figure}
29   \centerline{\includegraphics[width=10cm]{mealymachine}}
30   \label{img:mealymachine}
31   \end{figure}
32 }
33 \note[itemize]{
34 \item Mealy machine bases its output on current input and previous state
35 \item: TODO: Integrate this slide with the next two. First, show the picture
36 with the mealyMachine type signature (and rename it to "func"). Then, show the
37 run function, without type signature. Focus is on correspondence to the
38 picture.
39 }
40
41 \frame
42 {
43 \frametitle{Haskell Description}
44 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
45 \begin{code}
46 mealyMachine :: 
47   InputSignals ->
48   {-"{\color<2>[rgb]{1,0,0}"-}State{-"}"-} ->
49   (State, OutputSignals)
50 \end{code}
51 \end{beamercolorbox}
52 \begin{itemize}
53 \uncover<2->{\item Current state is part of the input}
54 \uncover<3->{\item New state is part of the output}
55 \end{itemize}
56 }
57 \note[itemize]{
58 \item State is part of the function signature
59 \item Both the current state, as the updated State
60 }
61
62 \subsection{Simulation}
63 \frame
64 {
65 \frametitle{Simulating a Mealy Machine}
66 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
67 \begin{code}
68 run func {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} [] = []
69 run func {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} (i:input) = o:out
70   where
71     ({-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-}, o)  =   func i {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-}
72     out                                             =   run func {-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-} input
73 \end{code}
74 \end{beamercolorbox}
75 \begin{itemize}
76 \item State behaves like an accumulator
77 \item Input is a (normal) list of inputs, one for each cycle
78 \end{itemize}
79 }
80 \note[itemize]{
81 \item This is just a quick example of how we can simulate the mealy machine
82 \item It sort of behaves like MapAccumN
83 }
84