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

正文內(nèi)容

基于fpga的vhdl編寫的電子時鐘-文庫吧資料

2024-11-16 06:25本頁面
  

【正文】 多路掃描電源激活輸出線; seg2: 時的2個數(shù)字的多路掃描輸出,可顯示在七段顯示器上; p5,p6: 時的2個數(shù)字的多路掃描電源激活輸出線。 reset: 系統(tǒng)內(nèi)部重置信號; clock: 由外接信號發(fā)生器提供1Hz的系統(tǒng)時鐘信號; alarm: 鬧鐘設(shè)定按鍵信號; stop: 定時器設(shè)定動作按鍵; ok: 任何設(shè)定動作的確認鍵; sec_tune: 秒數(shù)調(diào)整的按鍵信號; min_tune: 分數(shù)調(diào)整的按鍵信號; hour_tune: 時數(shù)調(diào)整的按鍵信號。圖4-11 entity模塊 最后,我們必須設(shè)計主程序?qū)⑺泄δ芙M件整合起來,以完成最后的系統(tǒng)功能。顯示耗電量節(jié)省了3/4。 end arch。 end if。 when others = mux_out = 1011111。 when 11 = pa=’0’。 pa=’0’。pb=’0’。pb=’0’。 case sel is when 00 = mux_out = a。 begin process (rst,clk,a, b) begin if rst=’1’ then sel=00。 end scan2。 pa,pb : out std_logic。 entity scan2 is port (rst,clk : in std_logic。 use 。 圖4-10 scan2組件程序代碼the ieee standard 1164 package, declares std_logic, rising_edge(), etc. library ieee。信號仿真結(jié)果如圖410所示。 end arch。 end if。when others = mux_out = 1011111。pc=’0’。 pa=’0’。pd=’0’。pb=’0’。 when 10 = mux_out = c。pc=’0’。 pa=’0’。pd=’0’。pb=’0’。 case sel is when 00 = mux_out = a。 begin process (rst,clk,a, b, c, d) begin if rst=’1’ then sel=00。 end scan4。 pa,pb,pc,pd : out std_logic。 entity scan4 is port (rst,clk : in std_logic。 use 。 scan4組件程序代碼 the ieee standard 1164 package, declares std_logic, rising_edge(), etc. library ieee。只是放棄其中的2個七段顯示器不用即可。視覺暫留效應(yīng)讓我們感覺到,相隔(1/32)s亮一次的燈似乎一直都亮著。視覺暫留原理要求每一數(shù)字在1s內(nèi)必須亮32次。市面上賣的4個串聯(lián)在一起的四合一七段顯示器組,有7個端口a,b,c,d,e,f,g,另外4個電源引腳分別決定哪一個七段顯示器亮,另一只引腳接Vcc。七段顯示器可顯示0~9共10個數(shù)字,其他數(shù)字則顯示“E”,表示輸出錯誤。e for error display end arch。 7_segments led display end bin2led。 entity bin2led is port (bin : in std_logic_vector (3 downto 0)。 use 。 bin2led 組件程序代碼library ieee。若為10及其以上的數(shù)字,則顯示錯誤信息“E”。圖4-8 bin2led組件 在一般電路中,數(shù)值均以二進制的形式存儲與計算,但是要將其輸出至七段顯示器顯示時,則必須提供一個電路模塊專門將二進制轉(zhuǎn)換成十進制供輸出使用。 信號仿真結(jié)果如圖48所示。 end process。 when others = ten=1110。 when 10|11|12|13|14|15|16|17|18|19 = ten=0001。 end case。 when 9|19 = one=1001。 when 7|17 = one=0111。 when 5|15 = one=0101。 when 3|13|23 = one=0011。 when 1|11|21 = one=0001。 individual bit end i24bcd。interger number ten : out std_logic_vector (3 downto 0) 。 use 。 use 。組件的程序代碼。由圖47可知,當輸入整數(shù)在0~59的范圍時,個位數(shù)與十位數(shù)的值均正確;而超出范圍時,個位數(shù)與十位數(shù)的值則顯示“E”以警告錯誤。 end arch。 end case。 when 50|51|52|53|54|55|56|57|58|59 = ten=0101。 when 30|31|32|33|34|35|36|37|38|39 = ten=0011。 when 10|11|12|13|14|15|16|17|18|19 = ten=0001。 end case。 when 9|19|29|39|49|59 = one=1001。 when 7|17|27|37|47|57 = one=0111。 when 5|15|25|35|45|55 = one=0101。 when 3|13|23|33|43|53 = one=0011。 when 1|11|21|31|41|51 = one=0001。 ndividual bit end i60bcd。interger number ten : out std_logic_vector (3 downto 0) 。 use 。 use 。圖4-6 i60bcd組件 為了計算方便,前面都以整數(shù)形式來處理時間,但在一般電路中,數(shù)值均以二進制的形式存儲,所以需要設(shè)計一個查表程序來將秒數(shù)或分數(shù)的0~59共60個整數(shù)轉(zhuǎn)換成二進制編碼的十進制(BCD)表示法,以便將來轉(zhuǎn)換成七段顯示器格式輸出。 在1Hz的觸發(fā)信號下,若撥動開關(guān)stop=’1’,且按住調(diào)秒鍵sec_tune不放,則計時器定時一直到切換撥動開關(guān)ok=’1’時,定時10秒鐘,接著自動計時到0,再送出index=’1’的指針信號。 stop_hour=a_hour。 stop_sec=a_sec。 end if。 else disp=’0’。 disp=’1’。 else a_sec=a_sec 1。 a_sec=59。 end if。 a_min=59。 disp=’0’。 disp=’1’。 end if。 if min_tune=’1’ then if a_min=59 then a_min=0。 end if。 elsif rising_edge(hz1) then if stop=’1’ and ok=’0’ then –setting if sec_tune=’1’ then if a_sec=59 then a_sec=0。 begin process(stop,ok,hz1) begin if rst=’1’ then index=’0’。 architecture arch of stop_watch is signal a_sec,a_min: integer range 0 to 59。 disp: out std_logic)。 stop_hour: out integer range 0 to 23。pushing button to tune minutes hour_tune: in std_logic。keep pushing to declare stop setting sec_tune: in std_logic。system clock 1hz stop: in std_logic。 use 。 use 。當ok=’1’時,則停止設(shè)定,顯示時間為所設(shè)定的計時起始時間,并開始進行計時,直到計時器顯示00:00:00為止,則送出終止指針index=’1’。當持續(xù)按住調(diào)秒鍵sec_tune時,秒針將從0持續(xù)增加至59后,再返回0,任何時刻松開按鈕,則顯示當時的值。以1Hz的顯示速率來調(diào)整時分秒的顯示,可以適應(yīng)視覺要求。信號仿真結(jié)果如圖45所示。 end arch。 min=min_tmp。 end process tuning。 end if。 end if。 else hour_tmp=hour_tmp + 1。 end if。 else min_tmp=min_tmp + 1。 end if。 else sec_tmp=sec_tmp + 1。 hour_tmp=0。 begin tuning:process(rst,hz1,alarm,ok) begin if rst=’1’ then sec_tmp=0。 define the signal_structure and _flow of the device architecture arch of alarm_set is signal sec_tmp,min_tmp: integer range 0 to 59。 hour: out integer range 0 to 23)。 keep pushing to declare minute tuning hour_tune: in std_logic。 keep pushing to declare alarm set sec_tune: in std_logic。 entity alarm_set is port( rst,hz1: in std_logic。 use 。 libray and package declaraction library ieee。當持續(xù)按住調(diào)秒鍵sec_tune時,秒針將從0持續(xù)增加至59后,再返回0,任何時刻松開按鍵即顯示當時的值。以1Hz的顯示速率來調(diào)整時分秒的顯示,可以適應(yīng)視覺要求。 設(shè)定clk與rst兩個系統(tǒng)輸入信號后,可觀察到系統(tǒng)輸出信號ones與tens的波形,在計數(shù)值達到23以后,即進位到00(24),如圖44所示。 times=time。 end if。keep counting full=’0’。over 24
點擊復(fù)制文檔內(nèi)容
研究報告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1