freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于vhdl的數(shù)字跑表技術(shù)(文件)

 

【正文】 k_div : out std_logic)。 elsif ( count = “1001”) then count = ( others = ?0?)。 end process。 end if。 use 。 reset : in std_logic。 begin process (clk) begin if ( clk?event and clk =?1?) then if ( reset = ?1?) then count = (others = ?0?)。 end if。 end if。 時(shí)鐘分頻模塊的功能描述如源代碼 所示,在源代碼中引用了上面描述的兩個(gè)分頻電路。 use 。 clk1 : out std_logic)。 clk_div : out std_logic)。 clk_div : out std_logic)。 begin U0: clk_div10 port map (clk,sysreset,clk0_tmp)。 end rtl。該模塊的輸入信號(hào)是去除抖動(dòng)后的復(fù)位信號(hào) reset0、去除抖動(dòng)后的啟 /停信號(hào) on_off0、系統(tǒng)電源復(fù)位信號(hào) sysreset 和 跑表 的內(nèi)部計(jì)時(shí)時(shí)鐘信號(hào) clk0。 圖 控制模塊中輸入信號(hào)和輸出信號(hào)的時(shí)序關(guān)系 根據(jù) 圖 所 示的時(shí)序關(guān)系,不難寫出控制模塊的 VHDL 描述。 entity control is port ( sysreset : in std_logic。 end control。 end if。 跑表 計(jì)時(shí)模塊 跑表 計(jì)時(shí)模塊主要用來(lái)實(shí)現(xiàn) 跑表 的內(nèi)部定時(shí)計(jì)數(shù)功能。由計(jì)數(shù)器串聯(lián)起來(lái)形成的 跑表 計(jì)時(shí)模塊的結(jié)構(gòu)框圖如圖 6 所示。 use 。 enable : in std_logic。 end count10。 else q_tmp = q_tmp+1。 q = q_tmp。 三進(jìn)制計(jì)數(shù)器和六進(jìn)制計(jì)數(shù)器的描述結(jié)構(gòu)與十進(jìn)制計(jì)數(shù)器的描述結(jié)構(gòu)完全相同,所不同的僅僅是計(jì)數(shù)器輸出的位數(shù)不同。 use 。 clk : in std_logic。 architecture rtl of count6 is signal q_tmp : std_logic_vector(2 downto 0)。 end if。 end process。 use 。 enable : i。 use 。 38 end rtl。 end if。 elsif (enable =?1?) then if (q_tmp =”101”) then q_tmp = (others = ?0?)。 q : out std_logic_vector(2 downto 0))。 entity count6 is port ( reset : in std_logic。 源代碼 library ieee。 cout = ?1? when q_tmp =”1001” and enable =?1? else ?0?。 end if。 begin process(clk) begin if (clk?event and clk =?1?) then if (reset = ?1?) then q_tmp = (others = ?0?)。 cout : out std_logic。 use 。 先來(lái)描述十進(jìn)制計(jì)數(shù)器,它的輸入端口主要包括復(fù)位端口 reset、使能端口 enable和時(shí)鐘輸入端口 clk;輸出端口主要包括計(jì)數(shù)輸出端口 q 和進(jìn)位輸出端口 cout。 跑表 計(jì)時(shí)模塊的輸出信號(hào)就是 跑表 的計(jì)時(shí)信息,包括小時(shí)十位信號(hào) hr小時(shí)個(gè)位信號(hào) hr、分十位信號(hào) min分個(gè)位信號(hào) min、秒十位信號(hào) sec秒個(gè)位信號(hào) sec、 秒位信號(hào) sec01 和 秒位信號(hào) sec001。 enable = strobe。 begin process (sysreset,reset0,on_off0) begin 35 if (sysreset=?1? or reset0 = ?1?) then strobe = ?0?。 on_off0 : in std_logic; clk0 : in std_logic。 源代碼 library ieee。因此可以定義一個(gè)乒乓信號(hào),該信號(hào)在啟 / 34 停信號(hào) on_off0 有效時(shí)就進(jìn)行一次反相操作,然后以這個(gè)信號(hào)作為選通信號(hào),從而得到計(jì)數(shù)允許信號(hào) enable。由于用 4 分頻電路得到的脈沖寬度較寬,因此將得到的 4 分頻信號(hào) clk1_tmp 與得到的 10 分頻信號(hào) clk0_tmp 相與,從而得到有效脈沖寬度為 1ms 的時(shí)鐘信號(hào) clk1。 clk0 = clk0_tmp。 signal clk0_tmp : std_logic。 ponent clk_div4 port ( clk : in std_logic。 architecture rtl of clk_div is ponent clk_div10 33 port ( clk : in std_logic。 clk : in std_logic。 use 。 end process。 process (clk) begin if ( clk?event and clk =?1?) then if ( count = “11”) then clk_div = ?1? 。 else 32 count = count +1。 end clk_div4。 use 。 end rtl。 else clk_div = ?0? 。 end if。 architecture rtl of clk_div10 is signal count :std_logic_vector (3 downto 0)。 entity clk_div10 is port ( clk : in std_logic。 源代碼 library ieee。 時(shí)鐘分頻模塊 時(shí)鐘分頻模塊的功能是將輸入的外部時(shí)鐘信號(hào) clk 進(jìn)行分頻,從而產(chǎn)生用來(lái)消除抖動(dòng)的 25Hz 的時(shí)鐘信號(hào) clk1 和用于 跑表 內(nèi)部定時(shí)計(jì)數(shù)的 100Hz 的時(shí)鐘信號(hào) clk0。 end if。 on_off_tmp3 = not on_off_tmp2。 29 reset0 : out std_logic。 entity keyin is port ( reset : in std_logic。 圖 鍵輸入模塊中輸入信號(hào)和輸出信號(hào)之間的關(guān)系 從 圖 可以 看出:狀態(tài)控制信號(hào) on_off_tmp1 是開(kāi)關(guān) 信號(hào) on_off 在時(shí)鐘信號(hào) clk1的下降沿進(jìn)行鎖存的鎖存信號(hào);狀態(tài)控制信號(hào) on_off_tmp2 是狀態(tài)控制信號(hào) on_off_tmp1在時(shí)鐘信號(hào) clk1 的下降沿進(jìn)行鎖存的鎖存信號(hào);控制信號(hào) on_off_tmp3 是狀態(tài)控制信號(hào)on_off_tmp2 的反相信號(hào);開(kāi)關(guān) 脈沖就是時(shí)鐘信號(hào) clk控制信號(hào) on_off_tmp控制信號(hào) on_off_tmp3 的邏輯與。在 跑表 系統(tǒng)中,要求得到寬度為一個(gè)外部時(shí)鐘信號(hào) clk 的周期的鍵入脈沖,因此采用另一種同步消抖電路的形式。 鍵輸入模塊 前面已經(jīng)提到過(guò),由于 跑表 的復(fù)位開(kāi)關(guān)和啟 /停開(kāi)關(guān)采用按鍵的輸入方式,其產(chǎn)生時(shí)刻和持續(xù)時(shí)間的長(zhǎng)短是隨機(jī)不定的,且存在因開(kāi)關(guān)簧片反彈引起的電平抖動(dòng)現(xiàn)象,因此必須在每個(gè)開(kāi)關(guān)后面加一個(gè)鍵輸入模塊。 signal sec01 : std_logic_vector(3 downto 0)。 signal min10 : std_logic_vector(2 downto 0)。 signal enable : std_logic。 signal reset0 : std_logic。 sec001 : out std_logic_vector(3 downto 0)。 min : out std_logic_vector(3 downto 0)。 clk : in std_logic。 sec01 : out std_logic_vector(3 downto 0)。 min10 : out std_logic_vector(2 downto 0)。 enable : in std_logic。 enable : out std_logic)。 end ponent。 ponent clk_div port ( sysreset : in std_logic。 clk1 : in std_logic。同時(shí)在結(jié)構(gòu)體的說(shuō)明部分還定義了 許多中間信號(hào),主要用來(lái)在模塊之間傳遞信息。 (5) 跑表 顯示模塊 輸入信號(hào) ? 系統(tǒng)電源復(fù)位信號(hào) sysreset; ? 外部 時(shí)鐘信號(hào) clk; ? 小時(shí)十位信號(hào) hr10; ? 小時(shí)個(gè)位信號(hào) hr; ? 分十位信號(hào) min10; ? 分個(gè)位信號(hào) min; ? 秒十位信號(hào) sec10; ? 秒個(gè)位信號(hào) sec; ? 秒位信號(hào) sec01; ? 秒位信號(hào) sec001。 (3) 控制模塊 輸入信號(hào) ? 去除抖動(dòng)后的復(fù)位信號(hào) reset0; ? 去除抖動(dòng)后的啟 /停信號(hào) on_off0; ? 系統(tǒng)電源復(fù)位信號(hào) sysreset; ? 跑表 的內(nèi)部計(jì)時(shí)時(shí)鐘信 號(hào) clk0。 (1) 鍵輸入模塊 輸入信號(hào) ? 復(fù)位開(kāi)關(guān)信號(hào) reset; ? 啟 /停開(kāi)關(guān) 信號(hào) on_off; ? 外部時(shí)鐘信號(hào) clk; ? 來(lái)消除抖動(dòng)的時(shí)鐘信號(hào) clk1,由時(shí)鐘分頻模塊提供。 跑表 顯示的功能可以通過(guò)一個(gè)單獨(dú)的電路來(lái)實(shí)現(xiàn)。 當(dāng) 跑表 開(kāi)始 正常計(jì)時(shí)的時(shí)候,需要進(jìn)行定時(shí)計(jì)數(shù)操作,由于時(shí)間顯示器是由 8 個(gè)LED 七段顯示數(shù)碼管組成的,因此需要產(chǎn)生 8 位的計(jì)時(shí)信息:小時(shí)十位信號(hào)、小時(shí)個(gè)位信號(hào)、分十位信號(hào)、分個(gè)位信號(hào)、秒十位信號(hào)、秒個(gè)位信號(hào)、 秒位信號(hào)和 秒位 22 信號(hào)。 圖 一種常用的消抖同步電路 由于外部時(shí)鐘信號(hào) clk 的頻率為 1000Hz,而實(shí)際需要的內(nèi)部計(jì)時(shí)時(shí)鐘頻率為 100Hz和提供給消抖同步電路的頻率為 25Hz,因此需要一個(gè)時(shí)鐘分頻電路。 21 頂層結(jié)構(gòu)體的設(shè)計(jì)及 VHDL 源代碼 在任何自頂向下的 VHDL 設(shè)計(jì)描述中,設(shè)計(jì)人員常常將整個(gè)設(shè)計(jì)的系統(tǒng)劃分為幾個(gè)模塊,然后采用結(jié)構(gòu)描述方式對(duì)整個(gè)系統(tǒng)進(jìn)行描述。 clk : in std_logic。 use 。下面是用 圖 31 所示的 結(jié)構(gòu)框圖生成的 跑表 頂層實(shí)體說(shuō)明的 VHDL 源代碼。需要描述的不僅是信號(hào)的方 向,還包括信號(hào)的類型。 (3) 跑表 進(jìn)行計(jì)時(shí)操作的計(jì)時(shí)時(shí)鐘是由外部時(shí)鐘信號(hào) clk 提供的。這 時(shí) ,通過(guò)輸出線 choose( 7 downto 0)來(lái)選擇指定的一位 LED 七段顯示數(shù)碼管 。 (2) 顯示器的 每一位都采用
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1