<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Lothar Miller - Flankenerkennung</title>
    <link>http://www.lothar-miller.de/s9y/</link>
    <description>Elektronik und Musik</description>
    <dc:language>de</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Thu, 16 Jul 2009 20:38:47 GMT</pubDate>

    <image>
        <url>http://www.lothar-miller.de/s9y/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Lothar Miller - Flankenerkennung - Elektronik und Musik</title>
        <link>http://www.lothar-miller.de/s9y/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Kompakte Flankenerkennung</title>
    <link>http://www.lothar-miller.de/s9y/archives/52-Kompakte-Flankenerkennung.html</link>
            <category>Flankenerkennung</category>
    
    <comments>http://www.lothar-miller.de/s9y/archives/52-Kompakte-Flankenerkennung.html#comments</comments>
    <wfw:comment>http://www.lothar-miller.de/s9y/wfwcomment.php?cid=52</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.lothar-miller.de/s9y/rss.php?version=2.0&amp;type=comments&amp;cid=52</wfw:commentRss>
    

    <author>nospam@example.com (Lothar Miller)</author>
    <content:encoded>
    
&lt;p&gt;Das hier ist eine &lt;b&gt;Flankenerkennung mit einer vorgeschalteten Synchronisationsstufe&lt;/b&gt;. &lt;br /&gt;Diese Beschreibung lässt sich sehr effizient in ein FPGA implementieren und wird ohne große Anstrengungen bis zu 400MHz schnell ausgeführt. Durch die Verwendung eines lokalen Schieberegisters (Variable &lt;i&gt;&lt;b&gt;sr&lt;/b&gt;&lt;/i&gt;) bleiben alle relevanten Signale lokal. &lt;/p&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;library&lt;/span&gt; &lt;span&gt;ieee&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;use&lt;/span&gt; &lt;span&gt;ieee&lt;/span&gt;.&lt;span&gt;std_logic_1164&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;all&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;entity&lt;/span&gt; &lt;span&gt;edge_detect&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;is&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;port&lt;/span&gt; (&lt;span&gt;async_sig&lt;/span&gt; : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;        &lt;span&gt;clk&lt;/span&gt;       : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;        &lt;span&gt;rise&lt;/span&gt;      : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;out&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;        &lt;span&gt;fall&lt;/span&gt;      : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;out&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;architecture&lt;/span&gt; &lt;span&gt;RTL&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;of&lt;/span&gt; &lt;span&gt;edge_detect&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;is&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;process&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;variable&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt; : &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic_vector&lt;/span&gt; (&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;downto&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;0&lt;/span&gt;) := &lt;span style=&quot;background-color: rgb(255, 240, 240); color: rgb(221, 34, 0);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;0000&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;&lt;br /&gt;  &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;wait&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;until&lt;/span&gt; &lt;span&gt;rising_edge&lt;/span&gt;(&lt;span&gt;clk&lt;/span&gt;);&lt;br /&gt;    &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Flanken erkennen&lt;/span&gt;&lt;br /&gt;    &lt;span&gt;rise&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;and&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt;);&lt;br /&gt;    &lt;span&gt;fall&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt;);&lt;br /&gt;    &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Eingang in Schieberegister einlesen&lt;/span&gt;&lt;br /&gt;    &lt;span&gt;sr&lt;/span&gt; := &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;downto&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;0&lt;/span&gt;) &amp;amp; &lt;span&gt;async_sig&lt;/span&gt;;&lt;br /&gt;  &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;process&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;architecture&lt;/span&gt;;&lt;/pre&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;p&gt;Daraus wird dann:...&lt;/p&gt;&lt;div style=&quot;width: 800px;&quot; class=&quot;serendipity_imageComment_center&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a href=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/FastSyncEdge.gif&quot; class=&quot;serendipity_image_link&quot;&gt;&lt;!-- s9ymdb:95 --&gt;&lt;img height=&quot;378&quot; width=&quot;800&quot; src=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/FastSyncEdge.gif&quot; class=&quot;serendipity_image_center&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Flankenerkennung mit Synchronisationsstufe&lt;/div&gt;&lt;/div&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;Hier eine Testbench:&lt;/p&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;LIBRARY&lt;/span&gt; &lt;span&gt;ieee&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;USE&lt;/span&gt; &lt;span&gt;ieee&lt;/span&gt;.&lt;span&gt;std_logic_1164&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;ALL&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;USE&lt;/span&gt; &lt;span&gt;ieee&lt;/span&gt;.&lt;span&gt;numeric_std&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;ALL&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;use&lt;/span&gt; &lt;span&gt;ieee&lt;/span&gt;.&lt;span&gt;math_real&lt;/span&gt;.&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;all&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;ENTITY&lt;/span&gt; &lt;span&gt;tb_edgedetect_vhd&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;IS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;END&lt;/span&gt; &lt;span&gt;tb_edgedetect_vhd&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;ARCHITECTURE&lt;/span&gt; &lt;span&gt;behavior&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;OF&lt;/span&gt; &lt;span&gt;tb_edgedetect_vhd&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;IS&lt;/span&gt; &lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;COMPONENT&lt;/span&gt; &lt;span&gt;edge_detect&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;PORT&lt;/span&gt;(&lt;br /&gt;      &lt;span&gt;async_sig&lt;/span&gt; : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;      &lt;span&gt;clk&lt;/span&gt; : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;          &lt;br /&gt;      &lt;span&gt;rise&lt;/span&gt; : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;OUT&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;      &lt;span&gt;fall&lt;/span&gt; : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;OUT&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;&lt;br /&gt;      );&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;END&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;COMPONENT&lt;/span&gt;;&lt;br /&gt;   &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;--Inputs&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;SIGNAL&lt;/span&gt; &lt;span&gt;async_sig&lt;/span&gt; :  &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt; := &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;0&#039;&lt;/span&gt;;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;SIGNAL&lt;/span&gt; &lt;span&gt;clk&lt;/span&gt; :  &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt; := &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;0&#039;&lt;/span&gt;;&lt;br /&gt;   &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;--Outputs&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;SIGNAL&lt;/span&gt; &lt;span&gt;rise&lt;/span&gt; :  &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;SIGNAL&lt;/span&gt; &lt;span&gt;fall&lt;/span&gt; :  &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Instantiate the Unit Under Test (UUT)&lt;/span&gt;&lt;br /&gt;   &lt;span&gt;uut&lt;/span&gt;: &lt;span&gt;edge_detect&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;PORT&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;MAP&lt;/span&gt;(&lt;br /&gt;      &lt;span&gt;async_sig&lt;/span&gt; =&amp;gt; &lt;span&gt;async_sig&lt;/span&gt;,&lt;br /&gt;      &lt;span&gt;clk&lt;/span&gt; =&amp;gt; &lt;span&gt;clk&lt;/span&gt;,&lt;br /&gt;      &lt;span&gt;rise&lt;/span&gt; =&amp;gt; &lt;span&gt;rise&lt;/span&gt;,&lt;br /&gt;      &lt;span&gt;fall&lt;/span&gt; =&amp;gt; &lt;span&gt;fall&lt;/span&gt;&lt;br /&gt;      );&lt;br /&gt;&lt;br /&gt;   &lt;span&gt;clk&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;clk&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;after&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;5&lt;/span&gt; &lt;span&gt;ns&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Ein zufälliges asynchrones Signal erzeugen&lt;/span&gt;&lt;br /&gt;   &lt;span&gt;stim&lt;/span&gt; : &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;process&lt;/span&gt;&lt;br /&gt;     &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;variable&lt;/span&gt; &lt;span&gt;seed1&lt;/span&gt;, &lt;span&gt;seed2&lt;/span&gt; : &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;POSITIVE&lt;/span&gt;;&lt;br /&gt;     &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;variable&lt;/span&gt; &lt;span&gt;Rand&lt;/span&gt; : &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;REAL&lt;/span&gt;;&lt;br /&gt;     &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;variable&lt;/span&gt; &lt;span&gt;IRand&lt;/span&gt; : &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;INTEGER&lt;/span&gt;;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;     &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Zufallszahl ziwschen 0 und 1&lt;/span&gt;&lt;br /&gt;     &lt;span&gt;uniform&lt;/span&gt;(&lt;span&gt;seed1&lt;/span&gt;, &lt;span&gt;seed2&lt;/span&gt;, &lt;span&gt;rand&lt;/span&gt;);&lt;br /&gt;     &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- daraus ein Integer zwischen 50 und 150&lt;/span&gt;&lt;br /&gt;     &lt;span&gt;irand&lt;/span&gt; := &lt;span style=&quot;color: rgb(51, 68, 153); font-weight: bold;&quot;&gt;integer&lt;/span&gt;((&lt;span&gt;rand&lt;/span&gt; &lt;strong&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 0, 238); font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 0, 238); font-weight: bold;&quot;&gt;.0&lt;/span&gt;  - &lt;span style=&quot;color: rgb(102, 0, 238); font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 0, 238); font-weight: bold;&quot;&gt;.5&lt;/span&gt;) + &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 0, 238); font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 0, 238); font-weight: bold;&quot;&gt;.0&lt;/span&gt; );&lt;br /&gt;     &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- und dann diese Zeit abwarten&lt;/span&gt;&lt;br /&gt;     &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;wait&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span&gt;irand&lt;/span&gt; &lt;/strong&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;1&lt;/span&gt; &lt;span&gt;ns&lt;/span&gt;;&lt;br /&gt;     &lt;span&gt;async_sig&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;async_sig&lt;/span&gt;;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;process&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;END&lt;/span&gt;;&lt;/pre&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;p&gt;&lt;br /&gt;Und das ist die resultierende Waveform:&lt;br /&gt;&lt;!-- s9ymdb:97 --&gt;&lt;img height=&quot;73&quot; width=&quot;743&quot; class=&quot;serendipity_image_center&quot; style=&quot;border: 0px none ; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/FastSyncEdgeWF.gif&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;Als kleiner Gimmick&lt;/b&gt;&lt;/u&gt;&lt;/i&gt; &lt;br /&gt;Wenn statt&lt;/p&gt;&lt;pre&gt;    &lt;span&gt;rise&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;and&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt;);&lt;br /&gt;    &lt;span&gt;fall&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt;);&lt;/pre&gt;&lt;p&gt;die folgende (genau funktionsgleiche) Beschreibung &lt;/p&gt;&lt;pre&gt;    &lt;span&gt;rise&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;and&lt;/span&gt;     &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt;);&lt;br /&gt;    &lt;span&gt;fall&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;   &lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;3&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;2&lt;/span&gt;)&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;&lt;/span&gt;;&lt;/pre&gt;&lt;p&gt;verwendet wird, kommt das dabei raus:&lt;/p&gt;&lt;p /&gt;&lt;p /&gt;&lt;div style=&quot;width: 800px;&quot; class=&quot;serendipity_imageComment_center&quot;&gt;&lt;div class=&quot;serendipity_imageComment_img&quot;&gt;&lt;a href=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/FastSyncEdgeInv.gif&quot; class=&quot;serendipity_image_link&quot;&gt;&lt;!-- s9ymdb:96 --&gt;&lt;img height=&quot;339&quot; width=&quot;800&quot; src=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/FastSyncEdgeInv.gif&quot; class=&quot;serendipity_image_center&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;serendipity_imageComment_txt&quot;&gt;Unnötige Inverter&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;Die Xilinx-Toolchain ist immer für Überraschungen gut.&lt;p&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 15 Jul 2009 20:50:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.lothar-miller.de/s9y/archives/52-guid.html</guid>
    
</item>
<item>
    <title>Flinke Flankenerkennung</title>
    <link>http://www.lothar-miller.de/s9y/archives/18-Flinke-Flankenerkennung.html</link>
            <category>Flankenerkennung</category>
    
    <comments>http://www.lothar-miller.de/s9y/archives/18-Flinke-Flankenerkennung.html#comments</comments>
    <wfw:comment>http://www.lothar-miller.de/s9y/wfwcomment.php?cid=18</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.lothar-miller.de/s9y/rss.php?version=2.0&amp;type=comments&amp;cid=18</wfw:commentRss>
    

    <author>nospam@example.com (Lothar Miller)</author>
    <content:encoded>
    
&lt;p&gt;Manchmal hat man das Problem, dass ein Eingangsignal prellt, man aber nicht &lt;b&gt;warten&lt;/b&gt; kann, bis das Prellen aufgehört hat.  Eine Auswertung des Flankenwechsels soll schnellstmöglich, quasi beim ersten Prellen ausgelöst, nachfolgende Preller aber ignoriert werden. Als Bais dient dieses Signal:&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:40 --&gt;&lt;img height=&quot;123&quot; width=&quot;365&quot; src=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/Entprellen.gif&quot; style=&quot;border: 0px none ; padding-left: 5px; padding-right: 5px;&quot; class=&quot;serendipity_image_center&quot; /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;p&gt;Hier kann die Schieberegister-Entprellung wieder ganz einfach verwendet werden. Allein durch das Ändern des Vergleichswertes wird praktisch die Schaltempfindlichkeit der Erkennung angepasst. &lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;11111110&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)...   &amp;lt;&amp;lt; sofort beim Wechsel 1-&amp;gt;0&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;11110000&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)...   &amp;lt;&amp;lt; bei &amp;quot;sauberer Flanke&amp;quot; 1-&amp;gt;0 (eher kritisch)&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;10000000&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)...   &amp;lt;&amp;lt; wenn Wechsel 1-&amp;gt;0, und 0 liegt stabil&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;p&gt;Kritisch ist der zweite Fall, weil u.U. Flanken nicht erkannt werden, wenn der Übergang z.B. so aussieht:&lt;br /&gt;&lt;br /&gt;&lt;!-- s9ymdb:94 --&gt;&lt;img height=&quot;42&quot; width=&quot;572&quot; src=&quot;http://www.lothar-miller.de/s9y/uploads/Bilder/Prellen.gif&quot; style=&quot;border: 0px none ; padding-left: 5px; padding-right: 5px;&quot; class=&quot;serendipity_image_center&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Keine dieser unsauberen Flanken wird von der 2. Variante erkannt werden.&lt;br /&gt;&lt;br /&gt;Hier der VHDL Code der Flankenerkennung: &lt;/p&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;pre&gt;:&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;signal&lt;/span&gt; &lt;span&gt;sr&lt;/span&gt;     : &lt;span style=&quot;color: rgb(51, 51, 153); font-weight: bold;&quot;&gt;std_logic_vector&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;7&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;downto&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;0&lt;/span&gt;);&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;signal&lt;/span&gt; &lt;span&gt;flanke&lt;/span&gt; : &lt;span style=&quot;color: rgb(51, 51, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;signal&lt;/span&gt; &lt;span&gt;pegel&lt;/span&gt;  : &lt;span style=&quot;color: rgb(51, 51, 153); font-weight: bold;&quot;&gt;std_logic&lt;/span&gt;;&lt;br /&gt;:&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;process&lt;/span&gt; (&lt;span&gt;clk&lt;/span&gt;)&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span&gt;rising_edge&lt;/span&gt;(&lt;span&gt;clk&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Schieberegister&lt;/span&gt;&lt;br /&gt;      &lt;span&gt;sr&lt;/span&gt; &amp;lt;= &lt;span&gt;sr&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;downto&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 221); font-weight: bold;&quot;&gt;0&lt;/span&gt;) &amp;amp; &lt;span&gt;eingang&lt;/span&gt;;&lt;br /&gt;      &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Flankenerkennung, 1 Sync-FF, dann sofort reagieren&lt;/span&gt;&lt;br /&gt;      &lt;span&gt;flanke&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;0&#039;&lt;/span&gt;;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;11111110&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span&gt;flanke&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;1&#039;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt;; &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- fallend&lt;/span&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;00000001&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span&gt;flanke&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;1&#039;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt;; &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- steigend&lt;/span&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- Entprellen&lt;/span&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;11111111&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span&gt;pegel&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;1&#039;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt;; &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- high&lt;/span&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span&gt;sr&lt;/span&gt;=&lt;span style=&quot;background-color: rgb(255, 240, 240);&quot;&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 34, 0);&quot;&gt;00000000&lt;/span&gt;&lt;span style=&quot;color: rgb(119, 17, 0);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;then&lt;/span&gt; &lt;span&gt;pegel&lt;/span&gt; &amp;lt;= &lt;span style=&quot;color: rgb(0, 68, 221);&quot;&gt;&#039;0&#039;&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt;; &lt;span style=&quot;color: rgb(136, 136, 136);&quot;&gt;-- low&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;if&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;end&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 136, 0); font-weight: bold;&quot;&gt;process&lt;/span&gt;;&lt;br /&gt;:&lt;/pre&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; /&gt;&lt;p /&gt; 
    </content:encoded>

    <pubDate>Thu, 23 Oct 2008 10:57:50 +0200</pubDate>
    <guid isPermaLink="false">http://www.lothar-miller.de/s9y/archives/18-guid.html</guid>
    
</item>

</channel>
</rss>
