在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 消費(fèi)電子 > 設(shè)計應(yīng)用 > 基于VHDL語言的FPGA簡易數(shù)字鐘設(shè)計

            基于VHDL語言的FPGA簡易數(shù)字鐘設(shè)計

            作者: 時間:2012-09-18 來源:網(wǎng)絡(luò) 收藏

            作為一個菜鳥我很愿意分享下我做的一些小東西,記得一年前好像少幾天吧,看記錄是2009年5月19日

            本文引用地址:http://www.biyoush.com/article/164887.htm

            我用51單片機(jī)做鐘的情景,那個時候用匯編,焦頭爛額,做了三天,還請教了老師。

            哎,現(xiàn)在都已經(jīng)用C了,而且重心已經(jīng)放在了AVR上,

            不過想想,這一年我還是學(xué)了很多東西,至少不是虛度了這一年。

            是挺好玩的,不過沒有時間搞,忙著比賽。

            不過憑借著學(xué)期前兩個禮拜實(shí)習(xí)天天晚上去圖書館自學(xué)的基礎(chǔ),加上單片機(jī)的基礎(chǔ),一直活到現(xiàn)在。呵呵呵

            臭屁一下,今天老師說我可以做他的助教,確實(shí)把我興奮了一把,

            其實(shí)我一直很心虛,因?yàn)槎紱]有時間搞,哪天出個難題答不上來就糗了。

            今天中午和下午花了6個小時左右的時間做了一個鐘,

            (Very high speed integrated circuit Hardware Description Language)即超高速集成電路硬件描述。

            顧名思義既然是硬件描述,當(dāng)然是描述硬件,這個相當(dāng)于在或CPLD芯片里熔出一個電路。

            硬件 芯片是ALTERA公司Cyclone II 系列的EP2C35F672C6

            使用的是ALTERA公司的開發(fā)板,型號DE2來張全圖,軟件為Quartus II 8.0,、ALTERA公司為自己產(chǎn)品打造的開發(fā)軟件。

            據(jù)說是5000塊錢,因?yàn)槭菍W(xué)校教學(xué)用,批量買,2500塊錢(不過我看下,就芯片貴,我看這個板子人家至少賺了1000多),我原來以為老師不會借,不過他似乎不介意,倒是他主動借給我的,額。。。

            不費(fèi)話了,貼程序吧

            library ieee;

            use ieee.std_logic_1164.all;

            use ieee.std_logic_unsigned.all;

            entity fpq is

            port(clk : in std_logic;

            k : in std_logic;

            k1 : in std_logic;

            k2 : in std_logic;

            ge : out std_logic_vector(0 to 6);

            shi : out std_logic_vector(0 to 6);

            feng : out std_logic_vector(0 to 6);

            fens : out std_logic_vector(0 to 6);

            shig : out std_logic_vector(0 to 6);

            shis : out std_logic_vector(0 to 6));

            end fpq;

            architecture first of fpq is

            signal clock : integer range 0 to 24999999;

            signal ge_t : integer range 0 to 9;

            signal shi_t : integer range 0 to 5;

            signal feng_t : integer range 0 to 9;

            signal fens_t : integer range 0 to 5;

            signal shig_t : integer range 0 to 9;

            signal shis_t : integer range 0 to 2;

            signal temp : integer range 0 to 9;

            begin

            t0: process(clk)

            begin

            if (clk'event and clk='1') then

            clock = clock + 1;

            if clock = 24999999 then

            ---------------------------------------------

            if k='0' then

            ---------------------------------------------

            if ge_t = 9 then

            ge_t = 0;

            if shi_t = 5 and ge_t = 9 then

            shi_t = 0;

            if feng_t = 9 and shi_t = 5 then

            feng_t = 0;

            if fens_t = 5 and feng_t = 9 then

            fens_t = 0;

            if shis_t = 2 and shig_t = 3 and fens_t = 5 then

            shig_t = 0;

            if shis_t = 2 and shig_t = 3 then

            shis_t = 0;

            else

            shis_t = shis_t + 1;

            end if;

            else

            if shig_t = 9 and fens_t = 5 then

            shig_t = 0;

            else

            shig_t = shig_t +1;

            end if;

            end if;

            else

            fens_t = fens_t + 1;

            end if;

            else

            feng_t = feng_t + 1;

            end if;

            else

            shi_t = shi_t + 1;

            end if;

            else

            ge_t = ge_t + 1;

            end if;

            else

            if k1='0' then

            if feng_t = 9 then

            feng_t = 0;

            if fens_t = 5 then

            fens_t = 0;

            else

            fens_t = fens_t + 1;

            end if;

            else

            feng_t = feng_t + 1;

            end if;

            end if;

            if k2='0' then

            if shig_t = 3 and shis_t = 2 then

            shig_t = 0;

            shis_t = 0;

            else

            if shig_t = 9 then

            shig_t = 0;

            if shis_t = 2 then

            shis_t = 0;

            else

            shis_t = shis_t + 1;

            end if;

            else

            shig_t = shig_t + 1;

            end if;

            end if;

            end if;

            end if;

            ------------------------------------------------

            end if;

            end if;

            ------------------------------------------------

            end process t0;

            c: process(clk,ge_t,shi_t,feng_t,fens_t,shig_t,shis_t)

            begin

            case ge_t is

            when 9 => ge = 0000100;

            when 8 => ge = 0000000;

            when 7 => ge = 0001111;

            when 6 => ge = 0100000;

            when 5 => ge = 0100100;

            when 4 => ge = 1001100;

            when 3 => ge = 0000110;

            when 2 => ge = 0010010;

            when 1 => ge = 1001111;

            when 0 => ge = 0000001;

            end case;

            case shi_t is

            when 5 => shi = 0100100;


            上一頁 1 2 下一頁

            評論


            相關(guān)推薦

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

            關(guān)閉