<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 汽車電子 > 設(shè)計應(yīng)用 > 汽車尾燈VHDL設(shè)計

          汽車尾燈VHDL設(shè)計

          作者: 時間:2011-05-01 來源:網(wǎng)絡(luò) 收藏

          設(shè)計

          標簽/分類:

          本文引用地址:http://www.ex-cimer.com/article/197462.htm

          1.系統(tǒng)設(shè)計要求
          用6個發(fā)光管模擬6個(左右各3個),用4個開關(guān)作為汽車控制信號,分別為:左拐、右拐、故障和剎車。
          車勻速行駛時,6個全滅;右拐時,車右邊3個尾燈從左至右順序亮滅;左拐時,車左邊3個尾燈從右至左順序亮滅;故障時車6個尾燈一起明滅閃爍;剎車時,6個尾燈全亮
          2.系統(tǒng)設(shè)計方案
          根據(jù)系統(tǒng)設(shè)計要求,采用自頂向下設(shè)計方法,頂層設(shè)計采用原理圖設(shè)計,它由主控模塊、左邊燈控制模塊和右邊燈控制模塊三部分組成。
          3參考源程序
          (1) 主控制模塊
          說明:此程序為系統(tǒng)主控制模塊。當左轉(zhuǎn)時,lft信號有效;右轉(zhuǎn)時,rit信號有效;當左右信號都有效的時,lr有效。
          libraryieee;
          useieee.std_logic_1164.all;
          entitykzis
          port(left,right:instd_logic;
          lft,rit,lr:outstd_logic);
          endkz;
          architecturekz_arcofkzis
          begin
          process(left,right)
          variablea:std_logic_vector(1downto0);
          begin
          a:=leftright;
          caseais
          when00=>lft='0';
          rit='0';
          lr='0';
          when10=>lft='1';
          rit='0';
          lr='0';
          when01=>rit='1';
          lft='0';
          lr='0';
          whenothers=>rit='1';
          lft='1';
          lr='1';
          endcase;
          endprocess;
          endkz_arc;

          (2)左邊燈控制模塊
          說明:此模塊的功能是當左轉(zhuǎn)時控制左邊的3個燈,當左右信號都有效時,輸出為全“1”。
          libraryieee;
          useieee.std_logic_1164.all;
          entitylftais
          port(en,clk,lr:instd_logic;
          l2,l1,l0:outstd_logic);
          endlfta;
          architecturelft_arcoflftais
          begin
          process(clk,en,lr)
          variabletmp:std_logic_vector(2downto0);
          begin
          iflr='1'then
          tmp:=111;
          elsifen='0'then
          tmp:=000;
          elsifclk'eventandclk='1'then
          iftmp=000then
          tmp:=001;
          else
          tmp:=tmp(1downto0)'0';
          endif;
          endif;
          l2=tmp(2);
          l1=tmp(1);
          l0=tmp(0);
          endprocess;
          endlft_arc;

          (2) 右邊燈控制模塊
          說明:此模塊的功能是控制右邊的3個燈,與上面模塊相似。
          libraryieee;
          useieee.std_logic_1164.all;
          entityritais
          port(en,clk,lr:instd_logic;
          r2,r1,r0:outstd_logic);
          endrita;
          architecturerit_arcofritais
          begin
          process(clk,en,lr)
          variabletmp:std_logic_vector(2downto0);
          begin
          iflr='1'then
          tmp:=111;
          elsifen='0'then
          tmp:=000;
          elsifclk'eventandclk='1'then
          iftmp=000then
          tmp:=100;
          else
          tmp:='0'tmp(2downto1);
          endif;
          endif;
          r2=tmp(2);
          r1=tmp(1);
          r0=tmp(0);

          endprocess;
          endrit_arc;


          關(guān)鍵詞: VHDL 汽車尾燈

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();