Fix some unhiding. Add some nodes
[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 Descriptions\pause
9     \item Rapid prototyping language\pause
10     \item Subset of Haskell can be translated to Hardware (VHDL)\pause
11     \item Structural Description of a Mealy Machine
12   \end{itemize}
13 }
14 \note[itemize]
15 {
16 \item We are a Computer Architectures group, this has been a 6 month 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 again is a Mealy Machine?}
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 }
36
37 \frame
38 {
39 \frametitle{Haskell Description}
40 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
41 \begin{code}
42 mealyMachine :: 
43   InputSignals ->
44   {-"{\color<2>[rgb]{1,0,0}"-}State{-"}"-} ->
45   (State, OutputSignals)
46 mealyMachine inputs {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} = ({-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-}, output)
47   where
48     {-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-}    =   logic     {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-}   input
49     outputs                                         =   logic     {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-}   input
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 \end{itemize}
78 }
79 \note[itemize]{
80 \item This is just a quick example of how we can simulate the mealy machine
81 \item It sort of behaves like MapAccumN
82 }
83