ltout.vhd

来自「用PLC程序编写十字路口的交通灯」· VHDL 代码 · 共 29 行

VHD
29
字号
library ieee;
use ieee.std_logic_1164.all;
entity ltout is
port(en,clk:in std_logic;
ar0,ag0,ay0,al0:in std_logic;
br0,bg0,by0,bl0:in std_logic;
ta:in std_logic_vector(6 downto 0);
tb:in std_logic_vector(6 downto 0);
ar,ag,ay,al:out std_logic;
br,bg,by,bl:out std_logic;
atime :out std_logic_vector(6 downto 0);
btime :out std_logic_vector(6 downto 0));
end ltout;
architecture behav of ltout is
begin
 ar <=en or ar0;
ag<=not en and ag0;
ay<=not en and ay0;
al<=not en and al0;
br<=en or br0;
bg<=not en and bg0;
by<=not en and by0;
bl<=not en and bl0;
atime <= ta when en='0' else
 (clk&clk&clk&clk&clk&clk&clk)and ta;
btime <= tb when en='0' else
 (clk&clk&clk&clk&clk&clk&clk)and tb;
end behav;

⌨️ 快捷键说明

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