新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 狀態機“毛刺”的產生及消除措施

        狀態機“毛刺”的產生及消除措施

        作者: 時間:2012-08-11 來源:網絡 收藏

        隨著EDA技術的高速發展, 以大規模和超大規模器件FPGA/CPLD為載體、以VHDL(硬件描述語言)為工具的電子系統設計越來越廣泛。有限機(簡稱機)作為數字系統控制單元的重要設計方案之一,無論與基于VHDL語言的其他設計方案相比,還是與可完成相似功能的CPU設計方案相比,在運行速度的高效、執行時間的確定性和高可靠性方面都顯現出強大的優勢。因此機在數字電子系統設計中的地位日益凸顯。

        本文引用地址:http://www.104case.com/article/148615.htm

          1 狀態機“”的

          狀態機通常包含主控時序進程、主控組合進程和輔助進程三個部分。其中,主控組合進程的任務是根據外部輸入的控制信號和當前狀態的狀態值確定下一狀態的取向,并確定對外輸出內容和對內部其他組合或時序進程輸出控制信號的內容。一方面,由于有組合邏輯進程的存在,狀態機輸出信號會出現——競爭冒險現象;另一方面,如果狀態信號是多位值的,則在電路中對應了多條信號線。由于存在傳輸延遲,各信號線上的值發生改變的時間則存在先后,從而使得狀態遷移時在初始狀態和目的狀態之間出現臨時狀態——

          例如,采用Moore型有限狀態機方案對ADC0809采樣過程實現控制,其主要程序如下:

          begin

          lock =lock1;

          process(current_state,eoc)

          begin

          case current_state IS

          when st0=>ale=‘0’;start=‘0’;oe=‘0’;lock1=‘0’;

          next_state =st1;

          when st1=>ale=‘1’;start=‘0’;oe=‘0’;lock1=‘0’;

          next_state =st2;

          when st2=>ale=‘0’;start=‘1’;oe=‘0’;lock1=‘0’;

          next_state =st3;

          when st3=>ale=‘0’;start=‘0’;oe=‘0’;lock1=‘0’;

          if (eoc=‘1’) then next_state =st3;

          else next_state =st4;

          end if;

          when st4=> ale =‘0’;start =‘0’;OE=‘0’;lock1=‘0’;

          if (eoc =‘0’) then next_state =st4;

          else next_state =st5;

          end if;

          when st5=> ale =‘0’; start =‘0’;oe=‘1’;lock1=‘0’;

          next_state =st6;

          when st6=> ale =‘0’; start =‘0’; oe =‘1’;lock1=‘1’;

          next_state =st0;

          when others=> ale =‘0’; start =‘0’;oe =‘0’;lock1=‘0’;

          next_state =st0;

          end case;

          end process;

          process (clk)

          begin

          if (clk’event and clk =‘1”) then

          current_state =next_state;

          end if;

          end process;

          process(lock1)

          begin


        上一頁 1 2 3 下一頁

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 万山特区| 沂源县| 东安县| 葵青区| 旬阳县| 沙雅县| 昭苏县| 临清市| 兰州市| 北京市| 溧阳市| 庄浪县| 洪泽县| 九江市| 偃师市| 普宁市| 红原县| 炉霍县| 东方市| 新密市| 山东省| 建湖县| 稷山县| 刚察县| 苍溪县| 江永县| 万州区| 万荣县| 防城港市| 确山县| 都兰县| 昌乐县| 伊宁市| 上饶县| 陇川县| 喀喇| 巴彦县| 康定县| 榆中县| 大化| 张家川|