【文章內(nèi)容簡(jiǎn)介】
1 downto 0)。功能轉(zhuǎn)換控制信號(hào)signal load :std_logic。 交通燈時(shí)長(zhǎng)裝載信號(hào)begin 交通燈和車(chē)流量控制信號(hào)的產(chǎn)生 process(clk,en,enemy) begin if enemy=39。139。 then lamp_rgy(5 downto 0)=100100。lamp_rgy(6)=clk。 elsif rising_edge(clk) then if en=39。139。 then if fuc=00 then sel1=01。sel2=00。green1 red2 南北通行時(shí) lamp_rgy=0001100。 elsif fuc=01 then sel1=00。sel2=00。yellow1 red2 lamp_rgy=0010100。 elsif fuc=10 then sel1=00。sel2=01。red1 green2 東西通行時(shí) lamp_rgy=0100001。 elsif fuc=11 then sel1=00。sel2=00。red1 yellow2 lamp_rgy=0100010。 end if。 end if。 end if。 end process。 確定交通燈時(shí)長(zhǎng) 產(chǎn)生時(shí)長(zhǎng)倒計(jì)時(shí)模塊 process(clk,en,enemy,fuc,load) begin if (rising_edge(clk) and en=39。139。) then if load=39。039。 then if fuc=00 then t1=39。039。amp。daIn11(3 downto 1)+5。 t2=39。039。amp。daIn12(3 downto 1)。 load=39。139。 elsif fuc=01 then t1=0101。 t2=0000。 load=39。139。 elsif fuc=10 then t1=39。039。amp。daIn21(3 downto 1)+5。 t2=39。039。amp。daIn22(3 downto 1)。 load=39。139。 elsif fuc=11 then t1=0101。 t2=0000。 load=39。139。 end if。 else if enemy=39。139。 then t1=0000。t2=0000。 elsif enemy=39。039。 then if t10 then t1=t11。 elsif t20 then t2=t21。t1=1001。 elsif (t1=0000 and t2=0000 and enemy=39。039。 and en=39。139。) then lo