⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cross_street_lights.txt

📁 Cross street lights driver in VHDL. It have been tested on XILINX 9500.
💻 TXT
字号:

Program

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity sygnalizacja is
port(
c: in std_Logic;
piebutton1: in std_logic;
piebutton2: in std_logic;
swiatla: out std_logic_vector(9 downto 0)
);

end sygnalizacja;

architecture a1 of sygnalizacja is
signal licz: integer:=0;
signal zakres: integer:=0;

begin
process(c)
begin
if rising_edge(c) then
licz<=licz+1;
end if;
end process;

process(piebutton1,piebutton2)
begin
if licz<=60 then
if piebutton2='1' then
licz<=61;
else
zakres<=1;
end if;
elsif licz>60 and licz<=70 then
zakres<=2;
elsif licz>70 and licz<=80 then
zakres<=3;
elsif licz>80 and licz<=140 then
if piebutton1='1' then
licz<=141;
else
zakres<=4 ;
end if;
elsif licz>140 and licz<=150 then
zakres<=5 ;
elsif licz>150 then
zakres<=6 ;
if licz=16 then
licz<=0;
end if;
end if;
end if;
case zakres is
when 1 => swiatla <= not("1000010110");
when 2 => swiatla <= not("1000100110");
when 3 => swiatla <= not("1101001010");
when 4 => swiatla <= not("0011001001");
when 5 => swiatla <= not("0101001001");
when 6 => swiatla <= not("1001101010");
when others => null;
end case;
end process;
end a1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -