Put code in colored boxes
[matthijs/master-project/haskell-symposium-talk.git] / introduction.lhs
1 %include talk.fmt
2 \section{Introduction}
3 \subsection{What will you see}
4 \frame
5 {
6   \frametitle{What will we see?}
7   \begin{itemize}
8     \item Small tour: what can we describe in \clash{}
9     \item Quick real demo
10   \end{itemize}
11 }
12 \note{Virtuele demo}
13
14 \subsection{What is \texorpdfstring{\clash{}}{CLasH}}
15 \frame
16 {
17   \frametitle{What is \clash{}?}
18   \begin{itemize}
19     \item \clash{}: CAES Language for Hardware Descriptions
20     \item Rapid prototyping language
21     \item Subset of Haskell can be translated to Hardware (VHDL)
22     \item Structural Description of a Mealy Machine
23   \end{itemize}
24 }
25 \note[itemize]
26 {
27 \item Wij zijn wij
28 \item \clash{} voor rapid prototyping
29 \item Subset haskell vertaalbaar
30 \item Mealy machine beschrijving
31 }
32
33 \subsection{Mealy Machine}
34 \frame
35 {
36 \frametitle{Mealy Machine}
37   \begin{figure}
38   \centerline{\includegraphics[width=10cm]{mealymachine}}
39   \label{img:mealymachine}
40   \end{figure}
41 }
42 \note{
43 Voor wie het niet meer weet, dit is een mealy machine
44 }
45
46 \frame
47 {
48 \frametitle{Haskell Description}
49 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
50 \begin{code}
51 mealyMachine :: 
52   InputSignals ->
53   {-"{\color<2>[rgb]{1,0,0}"-}State{-"}"-} ->
54   (State, OutputSignals)
55 mealyMachine inputs {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-} = ({-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-}, output)
56   where
57     {-"{\color<3>[rgb]{1,0,0}"-}new_state{-"}"-}    =   logic     {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-}   input
58     outputs                                         =   logic     {-"{\color<2>[rgb]{1,0,0}"-}state{-"}"-}   input
59 \end{code}
60 \end{beamercolorbox}
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 }