【正文】
to 0)。輸出數(shù)碼管位選 chep : out std_logic_vector (11 downto 0)數(shù)碼管段碼 )。 architecture an of chepai is signal clock : std_logic。 signal b0,b1,b2 : integer range 0 to 9。數(shù)碼管位選掃描程序 遼東學(xué)院信息技術(shù)學(xué)院 EDA 課程設(shè)計(jì)報(bào)告 13 begin p=conv_integer(key)。 begin case bcd8421 IS 計(jì)算輸出值 WHEN 0 = smg4:=0000。1 WHEN 2 = smg4:=0010。3 WHEN 4 = smg4:=0100。5 WHEN 6 = smg4:=0110。7 WHEN 8 = smg4:=1000。9 when others=null。 RETURN smg4。 begin case p is when 0|10|20|30|40|50|60|70|80|90|100|110|120|130|140|150|160|170 |180|190|200|210|220|230|240|250=b0=0。 when 2|12|22|32|42|52|62|72|82|92|102|112|122|132|142|152|162|172 |182|192|202|212|222|232|242|252=b0=2。 When 4|14|24|34|44|54|64|74|84|94|104|114|124|134|144|154|164|174 |184|194|204|214|224|234|244|254=b0=4。 When 6|16|26|36|46|56|66|76|86|96|106|116|126|136|146|156|166|176 |186|196|206|216|226|236|246=b0=6。 When 8|18|28|38|48|58|68|78|88|98|108|118|128|138|148|158|168|178 |188|198|208|218|228|238|248=b0=8。 when others= end case。 when 10|11|12|13|14|15|16|17|18|19|110|111|112|113|114|115|116|117 |118|119|210|211|212|213|214|215|216|217|218|219=b1=1。 when 30|31|32|33|34|35|36|37|38|39|130|131|132|133|134|135|136|137 |138|139|230|231|232|233|234|235|236|237|238|239=b1=3。 when 50|51|52|53|54|55|56|57|58|59|150|151|152|153|154|155|156|157 |158|159|250|251|252|253|254|255=b1=5。 when 70|71|72|73|74|75|76|77|78|79|170|171|172|173|174|175|176|177 |178|179=b1=7。 when 90|91|92|93|94|95|96|97|98|99|190|191|192|193|194|195|196|197 |198|199=b1=9。 end case。 遼東學(xué)院信息技術(shù)學(xué)院 EDA 課程設(shè)計(jì)報(bào)告 15 elsif p=100 and p200 then b2=1。 end if。 chep(7 downto 4)=b_to_s4(b1)。 end process。 library ieee。 use 。 clk_minhz:in std_logic。 end。 signal c:std_logic。139。 else if(A39。139。139。 if B=39。 then c=39。 end if。139。event and clk_minhz=39。 then if data1(3 downto 0)=1001 then data1(3 downto 0)=0000。 data1(7 downto 4)=0000。 end if。 end if。 elsif c=39。 then data(15 downto 0)=data1(15 downto 0)。 end if。 end。 use 。 entity feilvqi is port(reset:in std_logic。 feilv:out std_logic_vector(7 downto 0) )。 architecture one of feilvqi is signal feilv1:std_logic_vector(7 downto 0)。 begin process(reset,clk_minhz) begin if reset=39。then feilv1=00000000。event and clk_minhz=39。then if feilv1(3 downto 0)=1001then feilv1(3 downto 0)=0000。 else feilv1(7 downto 4)=feilv1(7 downto 4)+1。 else feilv1 (3 downto 0)=feilv1(3 downto 0)+1。 end if。 end process。 library ieee。 use 。 entity gundong is port (A,B:in std_logic。 chep:in std_logic_vector(11 downto 0)。 clk_200HZ,clk_1HZ: in std_logic。 y:out std_logic_vector(3 downto 0))。 architecture body_chooser of gundong is signal c:std_logic。 signal t: std_logic_vector(3 downto 0)。event and A=39。) then c=39。 end if。139。039。 end process。event and clk_200HZ=39。)then if count111 then count=count+1。 end if。 end process。event and clk_1HZ=39。 THEN IF t1100 then t=t+1。 end if。 end process。139。sel=00000001。sel=00010000。sel=00001000。sel=00000100。sel=00001000。sel=00100000。sel=01000000。sel=10000000。 end case。sel=10000000。sel=01000000。sel=00100000。sel=00010000。sel=00001000。sel=00000100。sel=00000010。sel=00000001。 end case。sel=00000001。sel=00000010。 end case。sel=10000000。sel=01000000。sel=00100000。sel=00010000。sel=00001000。sel=00000100。sel=00000010。sel=00000001。 end case。 end process。 library ieee。 use 。 led7s:out std_logic_vector(6 downto 0))。 architecture one of ymq is begin process(y) begin case y is when0000=led7s=1000000。1 when0010=led7s=0100100。3 when0100=led7s=0011001。5 when0110=led7s=0000010。7 when1000=led7s=0000000。9 when others=null。 遼東學(xué)院信息技術(shù)學(xué)院 EDA 課程設(shè)計(jì)報(bào)告 20 附錄 B 系統(tǒng)原理圖