Initial import
[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
13 \subsection{What is \texorpdfstring{\clash{}}{CLasH}}
14 \frame
15 {
16   \frametitle{What is \clash{}?}
17   \begin{itemize}
18     \item \clash{}: CAES Language for Hardware Descriptions
19     \item Rapid prototyping language
20     \item Subset of Haskell can be translated to Hardware (VHDL)
21     \item Structural Description of a Mealy Machine
22   \end{itemize}
23 }
24 \subsection{Mealy Machine}
25 \frame
26 {
27 \frametitle{Mealy Machine}
28   \begin{figure}
29   \centerline{\includegraphics[width=\textwidth]{mealymachine}}
30   \label{img:mealymachine}
31   \end{figure}
32 }
33
34 \frame
35 {
36 \frametitle{Haskell Description}
37 \begin{code}
38 mealyMachine :: 
39   InputSignals ->
40   {-"{\color<2->[rgb]{1,0,0}"-}State{-"}"-} ->
41   (State, OutputSignals)
42 mealyMachine inputs {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} = ({-"{\color<3->[rgb]{0,0,1}"-}new_state{-"}"-}, output)
43   where
44     {-"{\color<3->[rgb]{0,0,1}"-}new_state{-"}"-}   =   logic     {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-}   input
45     outputs                                         =   logic     {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-}   input
46 \end{code}
47 }
48 \subsection{Simulation}
49 \frame
50 {
51 \frametitle{Simulating a Mealy Machine}
52 \begin{code}
53 run func {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} [] = []
54 run func {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} (i:input) = o:out
55   where
56     ({-"{\color<3->[rgb]{0,0,1}"-}state'{-"}"-}, o) = func {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} i
57     out         = run func {-"{\color<3->[rgb]{0,0,1}"-}state'{-"}"-} input
58 \end{code}
59 }