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

📄 xs.vhd

📁 基本交通系统,实现城市交通路口的模拟仿真
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity xs is
 port(s,clk:in std_logic;
js1,js10a:in std_logic_vector(0 to 3);
r,g,y:out std_logic);
end xs;

architecture stl of xs is

  begin

process(clk,s,js1,js10a)
variable red,green,yellow: std_logic :='0';
begin
    
   
 if(  s='0'and conv_integer(js1)<=3 and js10a="0011")then
     red:='0';green:=not clk;yellow:='0';
 elsif(clk='0' and clk'event)then   
    if(s='0' and conv_integer(js1)>=3 and js10a="0011" )then
             red:='0';green:='0';yellow:='1';
  
    elsif(s='0'and js10a /="0011")then
             red:='0';green:='1';yellow:='0';

 
    elsif(s='1')then
       red:='1';green:='0';yellow:='0';
    end if;
 end if;
r<=red;g<=green;y<=yellow;
end process;

end stl;
  

⌨️ 快捷键说明

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