新聞中心

        EEPW首頁 > EDA/PCB > 設計應用 > FPGA驅動LED靜態顯示和動態顯示的VHDL程序

        FPGA驅動LED靜態顯示和動態顯示的VHDL程序

        作者: 時間:2012-05-29 來源:網絡 收藏

          din1 : in std_logic_vector(6 downto 0); --譯碼后的數據信號1(4位2進制數據

          通過例1中的decoder模塊譯碼得到din1,din2,din3,din4)

          din2 : in std_logic_vector(6 downto 0); --譯碼后的數據信號2

          din3 : in std_logic_vector(6 downto 0); --譯碼后的數據信號3

          din4 : in std_logic_vector(6 downto 0); --譯碼后的數據信號4

          shift: out std_logic_vector(3 downto 0); --位選信號

          bus4 : out std_logic_vector(6 downto 0)); --數據信號

          end dynamic;

          architecture Behavioral of dynamic is

          signal scan_clk:std_logic_vector(1 downto 0);

          begin

          process(clk,scan_clk,reset) --分頻進程

          variable scan:std_logic_vector(17 downto 0);

          begin

          if reset='1' then

          scan:=000000000000000000;

          scan_clk=00;

          elsif clk'event and clk='1'then

          scan:=scan+1;

          end if;

          scan_clk=scan(17 downto 16);

          end process;

          process(scan_clk,din1,din2,din3,din4) --掃描進程

          begin

          case scan_clk is

          when 00=>

          bus4=din1;

          shift=0001;

          when 01=>

          bus4=din2;

          shift=0010;

          when 10=>

          bus4=din3;

          shift=0100;

          when 11=>

          bus4=din4;

          shift=1000;

          when others=> bus4=0000000;shift=0000;

          end case;

          end process;

          end Behavioral;


        上一頁 1 2 下一頁

        關鍵詞: FPGA VHDL LED 驅動

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 崇明县| 阳西县| 华亭县| 龙胜| 即墨市| 区。| 克什克腾旗| 镇沅| 大埔县| 高雄市| 平利县| 卫辉市| 朝阳市| 宝鸡市| 泾阳县| 南部县| 南皮县| 读书| 丰原市| 三原县| 祁东县| 微山县| 安陆市| 江阴市| 华宁县| 郧西县| 延庆县| 炎陵县| 灵璧县| 宜兰县| 绥德县| 济宁市| 晋江市| 农安县| 株洲县| 新龙县| 林甸县| 南丹县| 隆林| 外汇| 潜江市|