Add part about the run-function to the section about state
authorChristiaan Baaij <baaijcpr@wlan228123.mobiel.utwente.nl>
Thu, 25 Feb 2010 13:28:32 +0000 (14:28 +0100)
committerChristiaan Baaij <baaijcpr@wlan228123.mobiel.utwente.nl>
Thu, 25 Feb 2010 13:28:32 +0000 (14:28 +0100)
4tapfir.svg
cλash.lhs

index b6a3f237434f2b1a874f049b4e495c04cfd524ac..3a0ef40bb9d79580f5d32facb647e1e905d47d61 100644 (file)
@@ -10,7 +10,7 @@
    xmlns="http://www.w3.org/2000/svg"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="153.05"
+   width="149.05"
    height="184.13002"
    id="svg2"
    version="1.1"
    height="184.13002"
    id="svg2"
    version="1.1"
@@ -24,8 +24,8 @@
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
      inkscape:zoom="2"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
      inkscape:zoom="2"
-     inkscape:cx="129.37703"
-     inkscape:cy="84.413489"
+     inkscape:cx="116.56774"
+     inkscape:cy="72.903496"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
       </cc:Work>
     </rdf:RDF>
   </metadata>
      inkscape:label="Layer 1"
      inkscape:groupmode="layer"
      id="layer1"
      inkscape:label="Layer 1"
      inkscape:groupmode="layer"
      id="layer1"
-     transform="translate(-408.06,-664.5295)">
+     transform="translate(-412.06,-664.5295)">
     <rect
        style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
        id="rect7593"
     <rect
        style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
        id="rect7593"
-       width="130"
-       height="175"
-       x="50"
-       y="134.43002"
+       width="124.8"
+       height="174.5"
+       x="55.200001"
+       y="134.93002"
        transform="translate(367.86,538.7295)" />
     <g
        id="g2940">
        transform="translate(367.86,538.7295)" />
     <g
        id="g2940">
        sodipodi:nodetypes="ccc" />
     <path
        style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend)"
        sodipodi:nodetypes="ccc" />
     <path
        style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend)"
-       d="m 408.56,688.15952 22,0"
+       d="m 412.56,688.15952 18,0"
        id="path3826"
        sodipodi:nodetypes="cc" />
     <g
        id="path3826"
        sodipodi:nodetypes="cc" />
     <g
    style="fill:#000000;stroke-width:0" />
 </g>    <g
        id="g7777"
    style="fill:#000000;stroke-width:0" />
 </g>    <g
        id="g7777"
-       transform="matrix(1,0,0,-1,186.5,1343.9595)"
+       transform="matrix(1,0,0,-1,191.7,1343.9595)"
        xml:space="preserve"
        stroke-miterlimit="10.433"
        font-style="normal"
        xml:space="preserve"
        stroke-miterlimit="10.433"
        font-style="normal"
index 487d6964ccccec84494716bd89488a772cb49332..2adeed6e903eaf48d805917ad38a44e8f94de739 100644 (file)
@@ -907,7 +907,7 @@ by an (optimizing) \VHDL\ synthesis tool.
     
     A FIR filter multiplies fixed constants ($h$) with the current 
     and a few previous input samples ($x$). Each of these multiplications
     
     A FIR filter multiplies fixed constants ($h$) with the current 
     and a few previous input samples ($x$). Each of these multiplications
-    are summed, to produce the result at time $t$. The equation of the FIR 
+    are summed, to produce the result at time $t$. The equation of a FIR 
     filter is indeed equivalent to the equation of the dot-product, which is 
     shown below:
     
     filter is indeed equivalent to the equation of the dot-product, which is 
     shown below:
     
@@ -1019,7 +1019,25 @@ 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.    
+    choice constructs, as state values are just normal values.
+    
+    We can simulate stateful descriptions using the recursive \hs{run} 
+    function:
+    
+    \begin{code}
+    run f s (i:inps) = o : (run f s' inps)
+      where
+        (s', o) = f s i
+    \end{code}
+    
+    The \hs{run} function maps a list of inputs over the function that a 
+    developer wants to simulate, passing the state to each new iteration. Each
+    value in the input list corresponds to exactly one cycle of the (implicit) 
+    clock. The result of the simulation is a list of outputs for every clock
+    cycle. As both the \hs{run} function and the hardware description are 
+    plain hardware, the complete simulation can be compiled by an optimizing
+    Haskell compiler.
+    
 \section{\CLaSH\ prototype}
 
 foo\par bar
 \section{\CLaSH\ prototype}
 
 foo\par bar