【文章內(nèi)容簡(jiǎn)介】
大學(xué)出版社,[M].西安:西安交通大學(xué)出版社,譚克俊,(第四版)[M]. 北京:電子工業(yè)出版社,[M]. 北京:電子工業(yè)出版社,附錄:源程序清單 十字路口交通燈的設(shè)計(jì) 學(xué)號(hào)030940910 姓名 楊波library ieee。 庫(kù)文件use 。use 。use 。entity traffic is port(clk : in std_logic。 時(shí)鐘信號(hào) del : buffer std_logic_vector(2 downto 0)。 38譯碼器輸入 seg : out std_logic_vector(7 downto 0)。 數(shù)碼管段選 key : in std_logic。 按鍵S1,緊急情況 east_west_led_red : out std_logic。 東西方向紅燈 east_west_led_yellow : out std_logic。 東西方向黃燈 east_west_led_green : out std_logic。 東西方向綠燈 south_north_led_red : out std_logic。 南北方向紅燈 south_north_led_yellow : out std_logic。 南北方向黃燈 south_north_led_green : out std_logic。 南北方向綠燈 hang : out std_logic_vector(15 downto 0)。 點(diǎn)陣的行 lie : out std_logic_vector(3 downto 0) 416轉(zhuǎn)換輸入 )。 end traffic。 architecture behave of traffic is signal count_nanbei : integer range 0 to 45。 signal count_dongxi : integer range 0 to 45。 signal num_nanbei : integer range 0 to 25。 signal num_dongxi : integer range 0 to 25。 signal e_w_shiwei : integer range 0 to 9。 signal e_w_gewei : integer range 0 to 9。 signal s_n_shiwei : integer range 0 to 9。 signal s_n_gewei : integer range 0 to 9。 signal dis : std_logic_vector(7 downto 0)。 signal display : integer range 0 to 10。 signal clk_count : std_logic_vector(13 downto 0)。 signal clk1HZ : std_logic。 signal cdount : std_logic_vector(3 downto 0)。 signal dount : std_logic_vector(8 downto 0)。 signal s : std_logic_vector(2 downto 0)。 begin process(clk) 分頻 begin if (clk39。event and clk=39。139。) then if(clk_count10000) then clk_count=clk_count+1。 else clk_count=00000000000001。 end if。 end if。 clk1HZ=clk_count(13)。 end process。 process(clk) begin if(clk39。event and clk=39。139。) then del=del+1。 seg=dis。 end if。 end process。 process(clk1Hz) begin if(clk1Hz39。event and clk1Hz=39。139。) then if(key=39。039。) then 緊急情況到來(lái) count_nanbei=count_nanbei。 南北方向停止計(jì)數(shù) else if(count_nanbei=46) then count_nanbei=0。 else count_nanbei=count_nanbei+1。 end if。 end if。 end if。 end process。 process(clk1Hz) begin if(clk1Hz39。event and clk1Hz=39。139。) then if(key=39。039。) then 緊急情況到來(lái) count_dongxi=count_dongxi。 東西方向停止計(jì)數(shù) else if(count_dongxi=46) then count_dongxi=0。 else count_dongxi=count_dongxi+1。 end if。 end if。 end if。 end process。 process(clk1Hz,count_nanbei) begin if(key=39