Move FIR example to use case section
authorChristiaan Baaij <baaijcpr@wlan228123.mobiel.utwente.nl>
Thu, 25 Feb 2010 13:08:32 +0000 (14:08 +0100)
committerChristiaan Baaij <baaijcpr@wlan228123.mobiel.utwente.nl>
Thu, 25 Feb 2010 13:08:32 +0000 (14:08 +0100)
4tapfir.svg
cλash.lhs

index d9a33db44e6510fed1c1f601e0eb371fb2488fd9..b6a3f237434f2b1a874f049b4e495c04cfd524ac 100644 (file)
@@ -15,7 +15,7 @@
    id="svg2"
    version="1.1"
    inkscape:version="0.47 r22583"
    id="svg2"
    version="1.1"
    inkscape:version="0.47 r22583"
-   sodipodi:docname="choice-case.svg">
+   sodipodi:docname="4tapfir.svg">
   <sodipodi:namedview
      id="base"
      pagecolor="#ffffff"
   <sodipodi:namedview
      id="base"
      pagecolor="#ffffff"
@@ -28,7 +28,7 @@
      inkscape:cy="84.413489"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      inkscape:cy="84.413489"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
-     showgrid="true"
+     showgrid="false"
      inkscape:snap-grids="true"
      inkscape:window-width="1091"
      inkscape:window-height="778"
      inkscape:snap-grids="true"
      inkscape:window-width="1091"
      inkscape:window-height="778"
index 2c5ad89aa06c0c03bfc98d40ba2a70a390ad6d84..487d6964ccccec84494716bd89488a772cb49332 100644 (file)
@@ -1019,52 +1019,52 @@ by an (optimizing) \VHDL\ synthesis tool.
     which variables  are part of the state is completely determined by the 
     type signature. This approach to state is well suited to be used in 
     combination with the existing code and language features, such as all the 
     which variables  are part of the state is completely determined by the 
     type signature. This approach to state is well suited to be used in 
     combination with the existing code and language features, such as all the 
-    choice constructs, as state values are just normal values.
-    
-    Returning to the example of the FIR filter, we will slightly change the
-    equation belong to it, so as to make the translation to code more obvious.
-    What we will do is change the definition of the vector of input samples.
-    So, instead of having the input sample received at time
-    $t$ stored in $x_t$, $x_0$ now always stores the current sample, and $x_i$
-    stores the $ith$ previous sample. This changes the equation to the
-    following (Note that this is completely equivalent to the original
-    equation, just with a different definition of $x$ that will better suit
-    the the transformation to code):
-
-    \begin{equation}
-    y_t  = \sum\nolimits_{i = 0}^{n - 1} {x_i  \cdot h_i } 
-    \end{equation}
-    
-    Consider that the vector \hs{hs} contains the FIR coefficients and the 
-    vector \hs{xs} contains the current input sample in front and older 
-    samples behind. The function that does this shifting of the input samples 
-    is shown below:
-    
-    \begin{code}
-    x >> xs = x +> tail xs  
-    \end{code}
-    
-    Where the \hs{tail} functions returns all but the first element of a 
-    vector, and the concatenate operator ($\succ$) adds the new element to the 
-    left of a vector. The complete definition of the FIR filter then becomes:
-    
-    \begin{code}
-    fir (State (xs,hs)) x = (State (x >> xs,hs), xs *+* hs)
-    \end{code}
-    
-    The resulting netlist of a 4-taps FIR filter based on the above definition
-    is depicted in \Cref{img:4tapfir}.
-    
-    \begin{figure}
-    \centerline{\includegraphics{4tapfir}}
-    \caption{4-taps FIR Filter}
-    \label{img:4tapfir}
-    \end{figure}
-    
+    choice constructs, as state values are just normal values.    
 \section{\CLaSH\ prototype}
 
 foo\par bar
 
 \section{\CLaSH\ prototype}
 
 foo\par bar
 
+\section{Use cases}
+Returning to the example of the FIR filter, we will slightly change the
+equation belong to it, so as to make the translation to code more obvious.
+What we will do is change the definition of the vector of input samples.
+So, instead of having the input sample received at time
+$t$ stored in $x_t$, $x_0$ now always stores the current sample, and $x_i$
+stores the $ith$ previous sample. This changes the equation to the
+following (Note that this is completely equivalent to the original
+equation, just with a different definition of $x$ that will better suit
+the the transformation to code):
+
+\begin{equation}
+y_t  = \sum\nolimits_{i = 0}^{n - 1} {x_i  \cdot h_i } 
+\end{equation}
+
+Consider that the vector \hs{hs} contains the FIR coefficients and the 
+vector \hs{xs} contains the current input sample in front and older 
+samples behind. The function that does this shifting of the input samples 
+is shown below:
+
+\begin{code}
+x >> xs = x +> tail xs  
+\end{code}
+
+Where the \hs{tail} function returns all but the first element of a 
+vector, and the concatenate operator ($\succ$) adds a new element to the 
+left of a vector. The complete definition of the FIR filter then becomes:
+
+\begin{code}
+fir (State (xs,hs)) x = (State (x >> xs,hs), xs *+* hs)
+\end{code}
+
+The resulting netlist of a 4-taps FIR filter based on the above definition
+is depicted in \Cref{img:4tapfir}.
+
+\begin{figure}
+\centerline{\includegraphics{4tapfir}}
+\caption{4-taps FIR Filter}
+\label{img:4tapfir}
+\end{figure}
+
 \section{Related work}
 Many functional hardware description languages have been developed over the 
 years. Early work includes such languages as $\mu$\acro{FP}~\cite{muFP}, an 
 \section{Related work}
 Many functional hardware description languages have been developed over the 
 years. Early work includes such languages as $\mu$\acro{FP}~\cite{muFP}, an