sta.vhd
来自「用fpga控制电梯,实现五层电梯的升降控制,运用vhdl编辑程序.」· VHDL 代码 · 共 24 行
VHD
24 行
library IEEE;
use IEEE.std_logic_1164.all;
entity sta is
port (
clk:in std_logic;
dir:out std_logic_vector(2 downto 0);
divide:out std_logic
);
end sta;
architecture a of sta is
signal did:std_logic;
signal dirr:std_logic_vector(2 downto 0);
begin
process(clk)
begin
if (clk'event and clk='1') then
did<=not did;
if(dirr="100") then dirr<="000";
else dirr<=dirr+1;
end if;
end if;
end process;
divide<=did;dir<=dirr;
end a;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?