lfta.vhd
来自「VHDL语言编写一个汽车尾灯显示的程序」· VHDL 代码 · 共 32 行
VHD
32 行
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY lfta IS
port(en,clk,lr:in std_logic;
l2,l1,l0:out std_logic);
end lfta;
ARCHITECTURE lft_arc OF lfta IS
begin
process(clk,en,lr)
variable tmp:std_logic_vector(2 downto 0);
begin
if lr='1' then
tmp:="111";
elsif en='0' then
tmp:="000";
elsif clk'event and clk='1' then
if tmp="000" then
tmp:="001";
else
tmp:=tmp(1 downto 0)&'0';
end if;
end if;
l2<=tmp(2);
l1<=tmp(1);
l0<=tmp(0);
end process;
end lft_arc;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?