《電子技術應用》
您所在的位置:首頁 > 可編程邏輯 > 設計應用 > 汽車尾燈VHDL設計
汽車尾燈VHDL設計
摘要: 汽車尾燈VHDL設計標簽/分類:1.系統設計要求用6個發光管模擬6個汽車尾燈(左右各3個),用4個開關作為汽車控制信號,分別為:左拐、右拐、故障和剎車。車勻速行駛時,6個汽車尾燈全滅;右拐時,車右邊
Abstract:
Key words :

汽車尾燈VHDL設計

標簽/分類:


1.系統設計要求
     用6個發光管模擬6個汽車尾燈(左右各3個),用4個開關作為汽車控制信號,分別為:左拐、右拐、故障和剎車。
    車勻速行駛時,6個汽車尾燈全滅;右拐時,車右邊3個尾燈從左至右順序亮滅;左拐時,車左邊3個尾燈從右至左順序亮滅;故障時車6個尾燈一起明滅閃爍;剎車時,6個尾燈全亮
2.系統設計方案
   根據系統設計要求,采用自頂向下設計方法,頂層設計采用原理圖設計,它由主控模塊、左邊燈控制模塊和右邊燈控制模塊三部分組成。
3參考VHDL源程序
(1) 主控制模塊
     說明:此程序為系統主控制模塊。當左轉時,lft信號有效;右轉時,rit信號有效;當左右信號都有效的時,lr有效。
library ieee;
use ieee.std_logic_1164.all;
entity kz is
   port(left,right:in std_logic;
        lft,rit,lr:out std_logic);
end kz;
architecture kz_arc of kz is
begin
   process(left,right)
   variable a:std_logic_vector(1 downto 0);
   begin
     a:=left&right;
     case a is 
        when"00"=>lft<='0';
                  rit<='0';
                  lr<='0';
        when"10"=>lft<='1';
                  rit<='0';
                  lr<='0';
        when"01"=>rit<='1';
                  lft<='0';
                  lr<='0';
        when others=>rit<='1';
                     lft<='1';
                     lr<='1';
     end case;
   end process;
end kz_arc;
        
(2)左邊燈控制模塊
說明:此模塊的功能是當左轉時控制左邊的3個燈,當左右信號都有效時,輸出為全“1”。
library ieee;
use ieee.std_logic_1164.all;
entity lfta is
   port(en,clk,lr:in std_logic;
        l2,l1,l0:out std_logic);
end lfta;
architecture lft_arc of lfta is
begin
   process(clk,en,lr)
   variable tmp:std_logic_vector(2 downto 0);
   begin
      if lr='1' then
         tmp:="111";
      elsif en='0' then
         tmp:="000";
      elsif clk'event and clk='1' then
         if tmp="000" then
            tmp:="001";
         else
            tmp:=tmp(1 downto 0)&'0';
         end if;
      end if;
      l2<=tmp(2);
      l1<=tmp(1);
      l0<=tmp(0);
   end process;
end lft_arc;
 
(2) 右邊燈控制模塊
說明:此模塊的功能是控制右邊的3個燈,與上面模塊相似。
library ieee;
use ieee.std_logic_1164.all;
entity rita is
    port(en,clk,lr:in std_logic;
         r2,r1,r0:out std_logic);
end rita;
architecture rit_arc of rita is
begin
   process(clk,en,lr)
   variable tmp:std_logic_vector(2 downto 0);
   begin
    if lr='1' then
       tmp:="111";
    elsif en='0' then
       tmp:="000";
    elsif clk'event and clk='1' then
       if tmp="000" then
          tmp:="100";
       else
         tmp:='0'&tmp(2 downto 1);
       end if;
    end if;
       r2<=tmp(2);
       r1<=tmp(1);
       r0<=tmp(0);
    
   end process;
end rit_arc;
此內容為AET網站原創,未經授權禁止轉載。
主站蜘蛛池模板: 狠狠色噜噜狠狠狠狠69| 高清有码国产一区二区| 成人午夜在线播放| 亚洲一卡二卡三卡四卡无卡麻豆| 精品国产三级a∨在线欧美| 国产成人免费ā片在线观看老同学| JAPANESEHD熟女熟妇伦| 无码专区人妻系列日韩精品| 亚洲乱人伦中文字幕无码| 男人和女人做爽爽视频| 国产一级特黄a大片免费| www.亚洲成在线| 天天射天天干天天插| 久久久久久91| 欧美A∨在线观看| 亚洲精品老司机| 经典国产乱子伦精品视频| 国产成版人视频网站免费下| 99re6在线播放| 忘忧草社区中文字幕| 久久成人免费播放网站| 欧美在线观看www| 人妻一本久道久久综合久久鬼色| 脱了美女内裤猛烈进入gif| 国产成人精品999在线观看| 91香蕉视频污| 婷婷国产偷v国产偷v亚洲| 久久久久99精品成人片欧美| 极品人妻少妇一区二区三区| 亚洲精品无码久久毛片| 精品国产一区二区三区不卡在线| 国产亚洲综合色就色| 国产在线一卡二卡| 国产精品极品美女自在线| ?1000部又爽又黄无遮挡的视频| 性久久久久久久| 久久一区二区三区精品| 日韩高清一级毛片| 亚洲国产精品综合久久网络| 爱情岛论坛免费视频| 内射白浆一区二区在线观看 |